Identify Feature Classes within a GDB by shape type?

264
1
Jump to solution
02-17-2022 10:28 AM
SteveKim1
New Contributor II

Hi everyone,

Is there a script to identify on polylines or whatever shape type I'm looking for within a gdb? 

For example, I want a script that finds all the polylines in a gdb.

 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
HuubZwart
Occasional Contributor

2 options:

arcpy.ListFeatureClasses built in search function

arcpy.env.workspace = gdb # your path 
polyline_fcs = arcpy.ListFeatureClasses(feature_type="Polyline")

 

Use arcpy.Describe instead

arcpy.env.workspace = gdb # your path 
polyline_fcs = [fc for fc in arcpy.ListFeatureClasses() if arcpy.Describe(fc).shapeType == "Polyline"]

View solution in original post

0 Kudos
1 Reply
HuubZwart
Occasional Contributor

2 options:

arcpy.ListFeatureClasses built in search function

arcpy.env.workspace = gdb # your path 
polyline_fcs = arcpy.ListFeatureClasses(feature_type="Polyline")

 

Use arcpy.Describe instead

arcpy.env.workspace = gdb # your path 
polyline_fcs = [fc for fc in arcpy.ListFeatureClasses() if arcpy.Describe(fc).shapeType == "Polyline"]
0 Kudos