ArcGIS Python获得一个图层所有线长
import arcpy # Create an empty Geometry object # g = arcpy.Geometry() # Run the CopyFeatures tool, setting the output to the geometry object. GeometryList # is returned as a list of geometry objects. # geometryList = arcpy.CopyFeatures_management("c:/data/streets.shp", g) # Walk through each geometry, totalling the length # length = 0 for geometry in geometryList: length += geometry.length print "Total length: %f" % length