Tuesday 19 April 2016

Normalizing raster using raster calculator in ArcGIS 10.3.1?



I have been trying to 'range standardise' or normalise my raster values from 0-100 and I know how to do this mathematically:



("raster"-min("raster"))/(max("raster")-min("raster"))*100



and I have input this equation into the raster calculator using both the min() and max() and the .minimum and .maximum syntax.



Why are these not working for me? ArcGIS 10.3.1



Answer



Raster objects have minimum and maximum (as well as mean and standardDeviation) properties that can be accessed in the raster calculator.


("raster" - "raster".minimum) / ("raster".maximum - "raster".minimum) * 100


This will work as long as you have already calculated statistics for the raster, otherwise it will fail as "raster".minimum will return None.


enter image description here


Messages
Executing: RasterCalculator "("raster" - "raster".minimum) / ("raster".maximum - "raster".minimum) * 100" c:\Temp\Default.gdb\rastercalc
Start Time: Tue May 10 09:46:45 2016
(Raster(r"raster") - Raster(r"raster").minimum) / (Raster(r"raster").maximum - Raster(r"raster").minimum) * 100

Succeeded at Tue May 10 09:46:48 2016 (Elapsed Time: 3.17 seconds)

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...