How can I create a shapefile using Python in ArcGIS 10?
I have lat & long.
From this I need Python code which will create a shapefile in ArcGIS Desktop 10.
Answer
For creating points:
ptList =[[20.000,43.000],[25.500, 45.085],[26.574, 46.025], [28.131, 48.124]]
pt = arcpy.Point()
ptGeoms = []
for p in ptList:
pt.X = p[0]
pt.Y = p[1]
ptGeoms.append(arcpy.PointGeometry(pt))
arcpy.CopyFeatures_management(ptGeoms, r"C:\Temp\test.shp")
It will return a message like this:
No comments:
Post a Comment