I am trying to loop through all the feature classes in an SDE geodatabase and get their name and feature count. When I attempt to get the feature count of each feature class I run into an error because in my list there are raster datasets. Why are there raster datasets in my resulting list from arcpy.ListFeatureClasses()? I pasted the code but it doesn't make sense to me why raster datasets are included in ListFeatureClasses? What am I missing?
I looped through fcList using this code
This is where I realized the list contained raster datasets with dataTypes of "RasterDataset"? I want to avoid having to use arcpy.Describe() to filter to to get feature classes because there are hundreds of feature classes in the SDE geodatabase and it slows it down a ton.
Code:
import arcpy
from arcpy import env
env.workspace = r'Database Connections\MySDEgeodatabase.sde'
fcList = arcpy.ListFeatureClasses()
Code:
for fc in fcList:
desc = arcpy.Describe(f)
print '{0} {1}'.format(desc.name, desc.dataType)