That list function should be only return feature classes. ListDatasets gives you both flavors. But to answer your question, the properties of an object are determined using the Describe function. You're looking for the "datasetType" property:arcpy.Describe(dataset).datasetType in ["RasterDataset","RasterBand"]
arcpy.Describe(dataset).datasetType in ["RasterDataset","RasterBand"]
Using Arcpy, what test can I use to distinguish fc from raster?
arcpy.env.workspace = r'C:\temp' rasterList = arcpy.ListRasters() for raster in rasterList: print raster # do something with these fc_list = arcpy.ListFeatureClasses() for fc in fc_list: print fc # do something with these
rasterList = arcpy.ListRasters() for raster in rasterList: print raster
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.