Select to view content in your preferred language

Any geoprocessing "Reclassify" type tool that uses a matrix?

939
4
04-11-2011 06:02 PM
RemiBrisson
Deactivated User
I'm looking for a geoprocessing tool that would this: given this value in raster x and this value in raster y, raster z (output) gets this value. I'm thinking something like "Reclass using Ascii file" but using a matrix of two paramaters maybe? Any ideas?
0 Kudos
4 Replies
curtvprice
MVP Alum
I'm looking for a geoprocessing tool that would this: given this value in raster x and this value in raster y, raster z (output) gets this value. I'm thinking something like "Reclass using Ascii file" but using a matrix of two paramaters maybe? Any ideas?

This sounds like something that could be pretty handily accomplished using map algebra. You could use the Calculate Value tool to build a map algebra expression and pass it to the single-output map algebra tool (9.3.1) or the new map algebra tool (10.0). You could get pretty fancy building the expression by writing a function in python in the code window of the Calculate Value tool.
0 Kudos
RemiBrisson
Deactivated User
Thanks for the input Curtis. Are you thinking a series of embedded CON statements? Only problem I forsee with that is I have about 30 values for "x" and about 10 values for "y", meaning 300 possible "z" values... and I have about 20 variations of this. That's why I was hoping to find a tool that would access a file that holds the matrix and finds the proper "z" directly. Or is what you are thinking different than this...
0 Kudos
curtvprice
MVP Alum
Are you thinking a series of embedded CON statements?


That's exactly what I was thinking. You could write python code to generate the map algebra needed.

Now that I think about it, I think the approach I'm suggesting is way too complex. If these are integer codes, why not run a combine() to make a temp grid with all unique combinations in the VAT, add a field to the VAT, and then use Calculate Value to populate your output using a Python or VBScript function, then use the Lookup tool (equivalent to the old grid.item syntax) to create your output grid. (Python would be neater because you can use dictionaries and/or lists to elegantly do your lookup.)
0 Kudos
RemiBrisson
Deactivated User
This sounds promising. I will give it a shot. Thanks Curtis.
0 Kudos