0

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")
PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Feb 11, 2020 at 4:33

2 Answers 2

4

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)
answered Feb 11, 2020 at 5:06
2
  • Yes! Thank you user2856 - That solution worked perfectly!! Commented Feb 11, 2020 at 5:50
  • @FelixIP this has worked since ArcGIS10.0 Commented Feb 11, 2020 at 6:47
0

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?

answered Feb 11, 2020 at 4:49
3
  • 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. Commented Feb 11, 2020 at 5:09
  • The other answer from @user2856 looks like a better option, anyhow. Commented Feb 11, 2020 at 5:12
  • Thank you - I'll be trying your solution in Python also, I appreciate the input! Commented Feb 11, 2020 at 5:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.