AnsweredAssumed Answered

How to use Min/Max values of raster in Python script

Question asked by qwerty@ on Jul 27, 2015
Latest reply on Oct 15, 2015 by curtvprice

I would like to use Min/Max values of my raster data in Python script. However, I cannot find an information how to implement these values properly in script. My script is as follow:


#Get the geoprocessing result object

elevMINResult = arcpy.GetRasterProperties_management("6", "MINIMUM")

elevMAXResult = arcpy.GetRasterProperties_management("6", "MAXIMUM")

#Get the elevation min/max value from geoprocessing result object

elevMin = elevMINResult.getOutput(0)

elevMax = elevMAXResult.getOutput(0)

# Set local variables

inRaster1 = Raster("6")

# Execute Minus

outMinus = ((inRaster1 - (elevMin)))/((elevMax) - (elevMin))

# Save the output"C:/out")


After running the script, I have the following error:

ERROR 000732: Dataset -1.79666268825531 does not exist or is not supported. -1.79666268825531 is elevMin in my data


Does anyone know how to implement Min/Max values to Python script?