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?

WhiteboxDev
  • 11,025
  • 1
  • 35
  • 65
  • Yeah I found the original answer to that post fascinating as well. Had no idea. – If you do not know- just GIS Oct 10 '14 at 19:12
  • 1
    @usertwoseventwothreenine It's like radouxju is an ArcGIS ninja, isn't it ;) – WhiteboxDev Oct 10 '14 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. – If you do not know- just GIS Oct 10 '14 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! – WhiteboxDev Oct 10 '14 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 '14 at 20:42
  • @radouxju Ah, that is disappointing, I thought that you had some hidden secret functionality like an Easter egg. But it's an answer nonetheless. Would you mind posting your answer so that I can accept it? Thanks for taking the time. – WhiteboxDev Oct 10 '14 at 20:48
  • the question was so good that there was an answer ! – radouxju Oct 10 '14 at 21:04

1 Answers1

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

radouxju
  • 49,636
  • 2
  • 71
  • 144