Reading geometry from a feature class

There may be times when you need to retrieve the geometric definition of features in a feature class. ArcPy provides the ability to read this information through various objects.

Getting ready

In ArcPy, feature classes have associated geometry objects including Polygon, Polyline, PointGeometry, and MultiPoint that you can access from your cursors. These objects refer to the shape field in the attribute table for a feature class. You can read the geometries of each feature in a feature class through these objects.

Polyline and polygon feature classes are composed of features containing multiple parts. You can use the partCount property to return the number of parts per feature and then use getPart() for each ...

Get Programming ArcGIS 10.1 with Python Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.