Documentation: Hierarchical structure of ArcPy Geometry class

02-05-2022 03:07 PM
Status: Already Offered
Labels (1)
Notable Contributor

In the ArcPy Geometry Class documentation, could ESRI provide more detailed information about the hierarchical structure of gemetries?

For example, provide a hierarchical diagramkind of like we have for the SDE.ST_GEOMETRY spatial type, but for the ArcPy Geometry class:

Like this, but better:

- Geometry - PointGeometry - Multipoint - Point - Polygon - Ring (aka part) - Point - Polyline - Path (aka part) - Point

That would help people who are trying to learn ArcPy understand how to access the various levels of the Geometry class.

  • I know there is some info about that in the Cursor docs. But it doesn't explain the hierarchical structure of geometries.

For example, as a novice, it was difficult to know how to iterate through a Polyline's components — to get at the individual points/vertices within a feature-part:

import arcpy
connection = "Database Connections\my_conn.sde"
feature_class = connection + "\my_owner.my_fc"

with arcpy.da.SearchCursor(feature_class, ["SHAPE@","OID@"]) as cursor:
for row in cursor:
geometry = row[0]
print("Geometry/Polyline: {}".format(row[1]))
for i, part in enumerate(geometry):
print(" Part: {}".format(i))
for j, point in enumerate(part):
print(" Point: {}".format(j))

Geometry/Polyline: 100
Part: 0
Point: 0
Point: 1
Point: 2
Point: 3
Point: 4
Part: 1
Point: 0
Point: 1


It would help a lot if if we could get some more detailed information about the hierarchical structure.



Hi @Bud, there is some discussion about geometry structure in this topic:

Is this sufficient, or is there more information you'd like to see?



Yes, now I realize that the Geometry class isn't as hierarchical as I originally thought. So I think the link you mentioned is sufficient.


Status changed to: Already Offered