Friday, 11 May 2018

arcgis desktop - What special values can be included in the Con tool's conditional statement?


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?



Answer



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


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...