AnsweredAssumed Answered

Assign a Mask file to Get Raster Properties

Question asked by india123 on Mar 31, 2017
Latest reply on Apr 4, 2017 by curtvprice

Hi All, 

BY the help of below script, i trying to get properties of raster using mask file. I want certain area statistics value of raster.  

So far i have, but its getting error while performing the task

 

import arcpy
arcpy.env.workspace = r"D:\Annomaly_SPEI_12"
arcpy.env.Mask = r"D:\Agro_Zone\Zone-1.shp"
Mask = arcpy.env.Mask
rasterList = arcpy.ListRasters()

for raster in rasterList:
     rasterObj = arcpy.Raster(raster)
     print raster

     bands = arcpy.GetRasterProperties_management(Mask ,raster, "MEAN")
     print "MEAN VALUE: %s" %bands



 Error Massage : 

 

ERROR 000864: Property type: The input is not within the defined domain.
ERROR 000800: The value is not a member of MAXIMUM | MINIMUM | MEAN | STD | TOP | LEFT | RIGHT | BOTTOM | CELLSIZEX | CELLSIZEY | VALUETYPE | COLUMNCOUNT | ROWCOUNT | BANDCOUNT | ALLNODATA | ANYNODATA | SENSORNAME | PRODUCTNAME | ACQUSITIONDATE | SOURCETYPE | CLOUDCOVER | SUNAZIMUTH | SUNELEVATION | SENSORAZIMUTH | SENSORELEVATION | OFFNADIR | WAVELENGTH.
ERROR 000864: Band Name: The input is not within the defined domain.
ERROR 000800: The value is not a member of Band_1.
Failed to execute (GetRasterProperties).

Outcomes