>>> import arcpy >>> doc = arcpy.mapping.MapDocument('CURRENT') >>> lyr = arcpy.mapping.ListLayers(doc)[0] >>> g = arcpy.Geometry() >>> geometryList = arcpy.CopyFeatures_management(lyr, g) >>> acres = 0.0 >>> for geometry in geometryList: ... acres += (geometry.area)/43560 ... >>> print acres 776.613255807 >>> 33829273.422968/43560 776.6132558073461 >>> This below is way faster! >>> area = 0.0 >>> with arcpy.da.SearchCursor("hab60","SHAPE@AREA") as cursor: ... for row in cursor: ... area += row[0] ... >>> print area 33829273.423 >>> print area/43560 776.613255807 >>>
Ingelogde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Maak gratis een account aan.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.