Adding certain value to raster (Plus tool), but result fails.

1472
2
03-28-2021 01:22 AM
Labels (2)
BartOversteegen
New Contributor

Hey! My DEM (raster) is located in the south of the Netherlands. I would like to make an image based map with the DEM. In further processes I need to have the map with NoData cells as value 0 and the original DEM with values from 1000-1255 (instead of the orginial DEM-values 0 - 1255). Basically, I want to plus 1000 to the original DEM and then assign NoData cells with 0.

Unfortunately, when I'm adding 1000 to the DEM (with raster calculator, or the Plus-tool) the result is distorted. Does anyone know how I can fix this problem? I'm looking on the internet for the answer for a week now 😉

Attached to this post are the original DEM (which I want to sum with 1000) and the result after raster calculator.  Maybe it has something to do with the settings of the DEM (see attachments)

Thanks a lot!

2 Replies
JayantaPoddar
MVP Esteemed Contributor

Is the value range of output showing 1000-1255 (Assuming original DEM value range is 0-255 since it is an 8-bit raster)?

I hope you are using Raster Calculator (Spatial Analyst) . Try saving the output as a TIFF (*.tif) file.

The expected output should be a 16 bit Floating/Integer.

Once output is generated, you may stretch its symbology based on a suitable stretch type (e.g. Min-Max), if required.



Think Location
0 Kudos
MervynLotter
Occasional Contributor III

If you want the original DEM values between 1000 and 1255, why do you want to add 1000? 

I will share with you the workflow I would follow to achieve this (but without adding the 1000). I like using Raster Functions as I can test the settings and I don't have to save the final output to disk.

From Imagery tab, open up Raster Functions and search for Calculator.  Add you DEM as the Raster Variable and assign a character to it (like x in my below image). 

Under Expression, Type in Con and hit enter to enter your conditional statement. Then you can type Con((x>=1000)&(x<=1255) , x , 0 ). I was not sure whether your highest pint is 1255 or you only wanted to display that range. Then under the General tab, change the Output Pixel Type to values to 16 Bit Unsigned, then hit the Create new layer at bottom of pane.

As Jayanta pointed out, your DEM is unlikely to be a 8 Bit Unsigned type as the values are greater than 255. I also noted from your image that it has 3 bands. Are you displaying the properties for the DEM you want to work with?  Similarly, the output of the Raster Function cant be a 8 But but rather a 16 Bit type to show values greater than 255. 

MervynLotter_0-1616928835699.png

If you want to add 1000 to teh DEM values then you modify the Con statement to something like:

Con((x>=1000)&(x<=1255) , x+1000 , 0 )

 

0 Kudos