Select to view content in your preferred language

Can't convert NoData to 0

4679
5
Jump to solution
04-27-2016 11:35 AM
Zihan_Lin
New Contributor III

I have a NDVI image from MODIS product. Detailed information of this raster file is shown in the picture below.

1.PNG

I wanted to convert NoData (-3.4028234663e+038) value into 0 and keep other values unchanged. Then I used Con and IsNull statements on raster calculator. But it didn't work, the NoData value of output image is still the same with before it was. Here is the calculation: Con(IsNull("NDVI.tif"), 0, "NDVI.tif").

I used other ways to change NoData to 0 ie exporting the original raster file, using Set Null tool, changing data type. None of them worked.

Is there any other way to replace NoData values with 0?

Thank you so much for all comments in advance.

0 Kudos
1 Solution

Accepted Solutions
SteveLynch
Esri Regular Contributor

or run the IsNull tool and if your output raster has any 0s it means that you have NoData.

View solution in original post

5 Replies
DanPatterson_Retired
MVP Emeritus

is 0 a valid class? are there any nodata cells in the inputs? examine its histogram

SteveLynch
Esri Regular Contributor

or run the IsNull tool and if your output raster has any 0s it means that you have NoData.

curtvprice
MVP Esteemed Contributor

The value in the properties is just the code used in that raster dataset for NoData cells (if any exist).

Because it is listed there does not mean you necessarily have any NoData cells.

AlfredWagtendonk
New Contributor II

I had the same experience, using the conditional function (Con(IsNull("NDVI.tif"), 0, "NDVI.tif"), doesn't help if there are no NoData values in your raster (which can be checked several ways). The problem here is simply the way NoData is defined in the raster properties of the file. If it is defined as '-3.4028234663e+038' this can indeed give execution problems in several operations further down the line (I suppose because this NoData value is read from the raster properties and used someway, somehow. However, an easy solution to this all is exporting your raster (right click -> Data / Export Data) and change the value of the field 'NoData as' to another value.

curtvprice
MVP Esteemed Contributor

If [NoData] is defined as '-3.4028234663e+038' this can indeed give execution problems in several operations further down the line

Depending on your workflow and the raster formats you are using the defaults sometimes don't do what you need, so:

  • The Copy Raster tool includes a NoData_value parameter.
  • The NoData environment setting controls how NoData gets mapped in by most raster tools. (The help for a tool tells you which env settings are used by a particular tool.)
0 Kudos