In the ArcPy Geometry Class documentation, could ESRI provide more detailed information about the hierarchical structure of gemetries?
For example, provide a hierarchical diagram, kind 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.
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.
Thanks.
Hi @Bud, there is some discussion about geometry structure in this topic: https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/reading-geometries.htm
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.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.