Restricting the list of feature classes returned with a feature type.

In addition to using a wildcard to restrict the feature classes returned by ListFeatureClasses(), you can also filter by feature type.

Getting ready

In addition to using a wildcard to restrict the list returned by the ListFeatureClasses() function, a type restriction can also be applied in conjunction with the wildcard or by itself. For example, the following code sample shows the two being used together to restrict the list returned to only polygon feature classes beginning with the letter B. In this recipe, you will restrict the feature classes returned through the use of a feature type parameter along with a wildcard:

fcs = arcpy.ListFeatureClasses("B*", "Polygon")

How to do ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.