Select to view content in your preferred language

Defining NoData pixels in a raster PLEASE HELP

7538
5
07-12-2011 02:15 PM
CyndyBresloff
Emerging Contributor
Hi folks -

I have the need to process a set of Geotiff rasters outside of the ArcGIS environment, and then port them back in.  I am having extreme difficulties with 'NoData' pixels.  I have input rasters  created in ArcGIS and that contain many NoData values.  These NoData values must remain distinguishable from, say, 0 value pixels. (My input rasters all contain float values).  I import these rasters to IDL for numerous calculations.  When saving newly created output rasters, I attempt to define the NoData values as 'NaN' in IDL; but this does not work when my output rasters return to ArcGIS.  I also have attempted to read in the ArcGIS "NoData' pixel value - the exact bit pattern -  and then rewrite it in my created rasters, to FORCE them to work as NoData in ArcGIS - and THIS does not work!  I feel there must be something that defines the ARcGIS 'NoData' values which I am not aware of and cannot set.  What am I missing?

Alternatively, is there a way to take a raster, and set, say, flagged pixel values (ie, '-9999') to NoData values and NOT change anything else in the raster. 

Many thanks for any advice.

Cyndy
0 Kudos
5 Replies
JeffreyEvans
Frequent Contributor
So the simple fix is to not use GeoTIFF's. ArcGIS can write ENVI format bil rasters. You can then bring these into IDL and designate -9999 as nodata in the read statement. The nodata information should also be in the bil header, so may not even need to define it.
0 Kudos
CyndyBresloff
Emerging Contributor
Thanks for the response, and I see your point, but I'm coming in on a project where a ton of rasters have already been created as geotiffs, and I'd have to write a script to convert them, so... that seems excessively complicated, given the rasters I need to work with have already been created.
0 Kudos
curtvprice
MVP Esteemed Contributor
Thanks for the response, and I see your point, but I'm coming in on a project where a ton of rasters have already been created as geotiffs, and I'd have to write a script to convert them, so... that seems excessively complicated, given the rasters I need to work with have already been created.


The Copy Raster tool allows you to set a background and NoData value. However, this requires you to make a new raster. If you're using Arc 10, the batch conversion isn't too hard now that modelbuilder includes iterators.

Another approach is to get and use USGS's Batch" rel="nofollow" target="_blank">http://arcscripts.esri.com/details.asp?dbid=15759]Batch Image Toolbox; chances are it will work fine with Arc 10, as it uses arcgisscripting.
0 Kudos
JeffreySwain
Esri Regular Contributor
Also be advised all of the tools mentioned in the USGS toolbox can be 'batched' by right clicking the tool and select 'Batch' and the python scripting and model builder with iterators can work as well.

Using the Con tool to evaluate the rasters and then set them to null may work, depending on the program.  Here is the link that describes how to utilize the Con and ISNULL statement, they will require Spatial Analyst.
0 Kudos
MintuMedhi
New Contributor
I also have the same problem. I want to do cube root of B4-B3 which comes Nodata if B3>B4. So I want to replace the Nodata pixels with 0 value programatically using C#.Please help.Any suggestion is appriciated.
e-mail:-medhimintu123@gmail.com
0 Kudos