Hey everyone.
I have two raster datasets with the same spatial resolution and extent. Both these datasets have values between 0 to 16.
How do I extract only the values that are the same in both datasets?
Thank you!
Best regards
Ditlev Reventlow
Solved! Go to Solution.
Dan,
Thank you for this. I don't want the "not-similar" data to be set to 0, I just want them not to be included in the output raster.Then I guess that it is fine to write:
Con("bsh_lu_2012_e" == "bsh_lu_2001_e","bsh_lu_2012_e")
Right? (just wanted to make sure because this is the statement I have used)
Yes, when you don't provide a "false expression" to Con, and the first argument resolves to false, the output cell value will be NoData.
If you are doing this in the Raster Calculator explore your options
Con("x4" == "x2",5,"x4") F:\Test\x5... if x4 is equal to x2 give it a value of 5, otherwise keep x4's values
From the Results Window
Messages
Executing: RasterCalculator Con("x4" == "x2",5,"x4") F:\Test\x5
Start Time: Fri Jun 12 23:46:41 2015
Con(Raster(r"x4") == Raster(r"x2"),5,Raster(r"x4"))
Succeeded at Fri Jun 12 23:46:41 2015 (Elapsed Time: 0.11 seconds)
Note the addition of Raster around the input raster layer names