Saturday 17 February 2018

Calculating 3d polygons' surface area using ArcGIS Desktop?


I've got a polygon feature class with Z values enabled. The polygon entities represent billboards. I'm looking for a way to measure the front surface area of this entities - i.e the area of the billboards from one side.



Can I do this using a Geoprocessing tool?


Some snapshots


enter image description here


Polygon in ArcMap


enter image description here


Polygon in ArcScene



Answer



First, copy and paste the defs in the accepted answer of the post that you mentioned to the python interpreter of ArcMap. And then run a cursor on the shapes to calculate the 3D area, such as:


for row in arcpy.SearchCursor("Billboard Layer on My Table of Content"):
area_array=[[j.X,j.Y,j.Z] for i in row.Shape.getPart() for j in i]

print row.OBJECTID, area(area_array)

This routine just prints the ID and the area of the feature but it can be used to record areas into a new field as well by UpdateCursor. Intentionally, I have exemplified the old cursor approach, otherwise there are much more efficient utilities in arcpy's data access module (i.e., arcpy.da)


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...