Model Builder and Get Raster Properties -> Raster Calculator

4254
6
02-24-2011 01:20 PM
AliceDeschamps2
New Contributor
In Model builder I am trying to use Get Raster Properties tool (ex. Min and Max)  from the Data Management Toolbox and feed the output to the raster calculator to do raster math.  Is that possible?

Otherwise, my solution may be to go to python scripting.  Not very good at coding, any tips or script examples? 

I am using ArcGIS v10.

Thanks.

Alice
0 Kudos
6 Replies
GregForcey
New Contributor
I've spent a long time try to do what you described but haven't had any luck. Did you ever get it to work?
0 Kudos
MichelleTotman1
New Contributor
I have been trying to accomplish the same thing. I'm going to post something to the Python scripting community.

Michelle
0 Kudos
GregForcey
New Contributor
If you use the get raster properties tool, you can create a bunch of different properties for grids (mean, median, std, etc). After those are generated, they show up as layers in the raster calculator when you are typing your equation. It's not as elegant as I was hoping for, but it works.
0 Kudos
MichelleTotman1
New Contributor
Thanks for the advise. I'll give it a shot.
0 Kudos
StefanHaglund1
Esri Contributor
This thread is old so maybe this has been solved elsewhere. Anyway, I found a way to accomplish this so I'd thought I'd post it here.

I simply put GetRasterProperties in a script-tool and set the output datatype to Double. That made the raster calculator able to handle the input. It seems the problem with GetRasterProperties tool is that it outputs it's value as Variant which makes RastCalc fail.
0 Kudos
AlexandruVasile2
New Contributor II

Solved!

An extra step in Model builder but it works.

Insert > Model Tools Only > Calculate Value; and simply add a short script that transforms the Output of the GetRasterProperties from Variant type to Double type [attached]. And than simply use the output from the Calculate Value tool inside the Raster Calculator.CalculateValue.png