1

I have a raster dataset in ArcGIS displaying altitude.

I want to replace all values < 8 with value 8.

Other values have to stay the same. How can I do this?

I tried raster calculator, but I don't seem to get the expression right.

2 Answers 2

2

With the raster calculator, you can use the Con() statement(condiotion, value if true, value if false)

Con("raster" < 8 , 8, "raster")
0
1
# Import system modules   
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/project/input/data"

# Execute Con
outCon = Con("altitude" < 8, 8, "altitude")

# Save the outputs 
outCon.save("C:/project/output/output.img")

References:

Your Answer

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

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