bobird

import arcpy

# Describe a feature class with a geographic coordinate system
#
desc = arcpy.Describe("d:/base/data.gdb/latlongbnd")

# Create search cursor. Use the spatial reference object from the
#   described feature class so geometries are returned in decimal degrees.
#
rows = arcpy.SearchCursor("d:/base/data.gdb/buildings", "", desc.spatialReference)

# Open the file for output. This also creates the file if it does not exist.
#
out = open(arcpy.GetParameterAsText(0), "w")

# Print the coordinates of each building point feature
#
for row in rows:
    # Create the geometry object
    #
    feat = row.shape

    # Get the geometry\'s point object.
    #
    pnt = feat.getPart()

    # Write the x,y coordinate to the output file
    #
    out.write(pnt.X + ";" + pnt.Y + "\n")

# Close the output file
#
out.close()

分类:

技术点:

相关文章: