import sys, os, arcpy from arcpy import env from arcpy.sa import * if arcpy.CheckExtension("Spatial"):    arcpy.CheckOutExtension("Spatial") else:    print "No SA licence"    exit HomeDir = "c:/Path to directory here/" fgdb = "Name of your fgdb.gdb" InData = os.path.join(HomeDir, fgdb) env.workspace = InData env.overwriteOutput = True ListRast = arcpy.ListRasters() for r in ListRast:    print "Processing", r    Ras = arcpy.Raster(r)    NullRas = IsNull(Ras)    NCol = NullRas.width    NRow = NullRas.height    NCell = NCol * NRow    Mean = NullRas.mean    NNull = Mean * NCell    print "{} % Null {}".format(r, NNull / NCell * 100)   Â
Neil
To loop through a raster table you can use.
input = "myIntRaster" cursor = arcpy.da.SearchCursor(input, ['value', 'count']) for row in cursor: Â Â Â Â print (row)
-Steve
If you run IsNull followed by Get Raster Properties with MEAN you will get the mean of the 1 and 0 output from IsNull. Multiply this number by 100 and you have the percentage NoData in the raster.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.