I am using ArcGIS Pro 2.4.
In the following equation, can "X" be replaced with the maximum cell value of another raster? Alternately, replacing "X" with a field from a table would work.
Con("udlen", 1, 0, "Value > X")
2 Answers 2
Yes. Raster
objects have a maximum
property. Just make sure statistics have been calculated for the raster or maximum
will return None
.
E.g.
Con("my_raster.tif" > "other_raster.tif".maximum, value_if_true, value_if_false)
You could use the MAXIMUM
argument in arcpy.GetRasterProperties_management()
to get the highest cell value in the raster. See the documentation for Get Raster Properties (Data Management).
eg, x = arcpy.GetRasterProperties_management("udlen", "MAXIMUM")
Is that what you're after?
-
I'm using ModelBuilder and am hoping to populate the value within the raster calculator. I also have the option of creating a table with the max value and have been trying to figure out how to extract the data from the table. Looks like I need to step up my Python education - but I am hoping to do this within Model Builder for now.Jim-wy– Jim-wy2020年02月11日 05:09:36 +00:00Commented Feb 11, 2020 at 5:09
-
The other answer from @user2856 looks like a better option, anyhow.Son of a Beach– Son of a Beach2020年02月11日 05:12:41 +00:00Commented Feb 11, 2020 at 5:12
-
Thank you - I'll be trying your solution in Python also, I appreciate the input!Jim-wy– Jim-wy2020年02月11日 05:51:57 +00:00Commented Feb 11, 2020 at 5:51
Explore related questions
See similar questions with these tags.