5

I recently read an answer to this question, which used a rather creative solution involving ArcGIS's Raster Calculator. The part that I was most interested in was that the solution's conditional statement,

Con("raster" == maxvalue, 1)

used the special variable maxvalue, clearly the input image's maximum value. I'm curious whether the maxvalue variable name can also be used within the conditional statement of the Con tool? The documentation for the tool hasn't revealed anything, which makes me think that perhaps it is restricted to the Raster Calculator.

If it is a valid conditional statement for use in the Con tool, then what other similar variables are possible? I assume there is a corresponding minvalue, but is there a variable for grid cell resolution? How about one for the northern coordinate of the edge of the raster or the y-coordinate for the grid cell?

7
  • Yeah I found the original answer to that post fascinating as well. Had no idea. Oct 10, 2014 at 19:12
  • 1
    @usertwoseventwothreenine It's like radouxju is an ArcGIS ninja, isn't it ;) Oct 10, 2014 at 19:26
  • 1
    Yeah I stared at that answer for about 10 minutes like a deer in headlights. So simple and yet so elegant. Oct 10, 2014 at 19:28
  • @usertwoseventwothreenine Yes, it's so incredibly elegant I did the same thing where I was just staring at it for several minutes. About three days ago I added a tool to Whitebox called 'Find Lowest/Highest Locations' which will create a shapefile of point(s) containing the lowest/highest grid cells of a raster...that's about as simple as it can get. But when I was looking at radouxju's answer, I thought to myself, 'why did I just spend all that time writing that tool and why didn't I think of that?' Ha! Oct 10, 2014 at 19:33
  • I am sorry to disappoint you but I am no ninja. I just meant that the maximum value from the first step , so that the OP had to fill with his maximum value (a raster layer if he used zonal stat, or a numeric value. I've tried just in case but maxvalue does not work.
    – radouxju
    Oct 10, 2014 at 20:42

1 Answer 1

6

It seems that the arcpy syntax can be used directly in raster calculator. Therefore the properties of this page can be used. For instance

Con("raster" > "raster".mean, 1, 0)

works. Other examples :

minimum, maximum, mean, meanCellHeight, meanCellWidth, extent.XMin, extent.YMax, etc

1
  • 1
    Now that is truly very cool! I think I would rate this is one of my favourite all-time answers. Thanks. Oct 10, 2014 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.