# Different NoData values when processing a GeoTIFF in QGIS and bringing it to ArcGIS

I'm trying to process a GeoTIFF in QGIS 1.8 using SEXTANTE and GRASS via the r.neighbors tool. I'd like to process the image, then be able to utlize it in ArcGIS.

The problem I'm running into is that the output file has a different nodata value than the input, and Arc isn't recognizing the correct nodata value (which is 3 E-38). Arc reads the output file as having a nodata value of 0, and QGIS reads it of having a nodata value of NaN. This causes Arc to render the file incorrectly, and makes utilizing the output file in Arc difficult.

When identifying nodata pixels in ArcGIS, they return the cell value of nodata, however the raster's nodata value is 0, instead of nodata (as in the cell value nodata). This causes them to be rendered as black, instead of nofill, and may impact further processing of the file.

Suggestions?

-
You can also answer your own questions on this site. If your answer is upvoted, you will even be able to accept it. –  underdark Oct 8 '12 at 18:36

I ended up just warping the image with a new no data value.

gdalwarp -dstnodata -3.40282346639e+038 -of GTiff C:/inraster.tif C:/outraster.tif


I think the issue was that QGIS outputs nodata as the cell value nodata, while arc actually uses an arbitrarily low number (-3.40282346639e+038, but still a floating point number) and includes in the file properties the definition that the nodata value is that number. Arc had trouble reading the cell value nodata as the file definition nodata value, and having the cell values as nodata caused problems in arc.

-
I've encountered the same issue when I was trying to to import some geotiffs with arcgis 9.3. I haven't tried but I read reports that the issue has been resolved with arcgis10? –  nickves Oct 9 '12 at 0:39
yes arcgis 10+ has much better support for nodata values –  nickves Sep 22 '13 at 22:00

I would try running Calculate Statistics on your raster dataset/s in ArcGIS. According to ESRI:

• Calculating statistics allows ArcGIS applications to properly stretch and symbolize raster data for display.

• The Ignore Values option allows you to exclude a specific value from the calculation of statistics. You may want to ignore a value if it is a NoData value or if it will skew your calculation.

Edit: Here is a good discussion in GISse to handling NoData in ArcGIS using conditional if/else evaluation. The example:

Con example 1 (Python window)

In this example the original value will be retained in the output where the input conditional raster is greater than a value of 2000, and a value of NoData where it is not.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outCon = Con("elevation", "elevation", "", "VALUE > 2000")
outCon.save("C:/sapyexamples/output/outcon.img")

# Execute Con using a map algebra expression instead of a where clause
outCon2 = Con(Raster("elevation") > 2000, "elevation")
outCon2.save("C:/sapyexamples/output/outcon2")

-
I've calculated statistics, which allows it to stretch properly, however the nodata value is still being read incorrectly by Arc. When identifying nodata pixels in arc, they return the cell value of nodata, however the raster's nodata value is 0, instead of nodata (as in the cell value nodata). –  DPierce Oct 8 '12 at 17:36
@DPierce Post edited to address comments –  Aaron Oct 8 '12 at 17:54
I did not try this, but I expect it might run into problems due to the fact that the QGIS output nodata cells had no value, so arc would have to ignore them by default. I did attempt SETNULL ("VALUE" IS NULL) but that didn't work because I believe it ignores cell value = nodata by default. –  DPierce Oct 8 '12 at 18:35