3

I am looking for a programmatic way using arcpy to determine whether or not a feature class (FC) has Z and/or M geometry. It's easy enough to get the geometry type using the code below, but this just tells me the base type (point, line, polygon) and does not have details about ZM. I would rather not have to create a cursor and read the actual feature geometries (it should not be necessary, since the entire FC must have the same geometry).

import arcpy
desc = arcpy.Describe("D:\\MyData\\Scratch.gdb\\polyzm")
geometryType = desc.shapeType
print geometryType

which returns this result:

Polygon

1 Answer 1

10

The Describe object also has the hasM and hasZ properties which:

Indicates if the geometry is m-value enabled

and

Indicates if the geometry is z-value enabled

respectively.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.