bands = ['Band_1', 'Band_2', 'Band_3'] for band in bands: desc = arcpy.Describe(os.path.join(raster, band)) desc.noDataValue
If they are multiple bands what are your no data values you are looking for? 0,0,0?
Check if the ANYNODATA or ALLNODATA properties of GetRasterPorperties_management will do what you want:http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000m7000000Here is an exmple of running thru the Default.gdb on my system and reporting the raster name and ANYNODATA value ws = r'H:\Documents\ArcGIS\Default.gdb' arcpy.env.workspace = ws rasters = arcpy.ListRasters() for raster in rasters: nodatval = arcpy.GetRasterProperties_management(raster, "ANYNODATA") print str(raster) + " NoData = " + str(nodatval) sys.exit()
ws = r'H:\Documents\ArcGIS\Default.gdb' arcpy.env.workspace = ws rasters = arcpy.ListRasters() for raster in rasters: nodatval = arcpy.GetRasterProperties_management(raster, "ANYNODATA") print str(raster) + " NoData = " + str(nodatval) sys.exit()
desc = arcpy.Describe(raster) desc.noDataValue
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.