TransWikia.com

set cells with specific values as NoData in afloating raster

Geographic Information Systems Asked on November 2, 2020

I have a raster file which includes floating values. I need to set cells with specific values as Nodata. For Raster integer values, the setnull tool can be applied, is it any tool for floating point?

The image that I have problem with it is the outcome of linear spectral analysis of ENVI software. I imported the image from ENVI to ArcMap by using ASCII to raster tool.

I have tried the Con in the raster calculator of ArcMap but It did not change my image and I got my original image again as output. I need to set the values less than zero to Nodata.

2 Answers

Seeing as you talk about SetNull I will assume ArcGis. You will need the Spatial Analyst extension to perform this type of extraction.

Your friends in ArcGis are Con and Extract by Attributes, this will allow you to specify a clause on what values you want to keep, anything else will be Null.

For example, if you wanted only the parts of a DEM that are above 0:

enter image description here

The biggest problem is creating an appropriate 'where clause'. For example to extract only a range: enter image description here

Con is a bit more powerful when used in raster calculator, you can use it to set null values or replace values with a constant (or a different raster):

enter image description here

Will give you a raster that is NoData for less than 215 and the value of the input for values greater than 215.

With both of these tools the output will be the same as the input, so if input is Float 32 then output will also be Float 32.

If you don't have Spatial Analyst you can try the QGIS raster calculator, which is very much like Esri Raster Calculator or GDAL_Calc, both will work if you're prepared to learn how to use them.

Correct answer by Michael Stimson on November 2, 2020

The following expression will keep all the values between -1 and 1. The values outside this range will be set to null.

Out_Raster = Con((yourraster > -1) & (yourraster < 1), yourraster)

Answered by studysmart on November 2, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP