arcpy根据txt创建点图层

sr = arcpy.SpatialReference(4326)
fc=arcpy.CreateFeatureclass_management( r"D:\cs","test.shp", "POINT", "", "","", sr)
arcpy.AddField_management(r"D:\cs\test.shp", "leibie", "TEXT")
cursor=arcpy.InsertCursor(fc)
for line in cent:
    feature = cursor.newRow()
    # Add the point geometry to the feature
    vertex = arcpy.CreateObject("Point")
    vertex.X = line[0]
    vertex.Y =line[1]
    feature.shape = vertex
    # Add attributes
    feature.leibie = "shumu"
    # write to shapefile
    cursor.insertRow(feature)
del cursor
del fc

猜你喜欢

转载自blog.csdn.net/A873054267/article/details/84302867