10

I have a GeoTIFF raster in ArcGIS Desktop, which can be downloaded from the following two links:

  1. http://www.rtwilson.com/downloads/MODIS_MOD04_16-06-2006_Subset.tfw
  2. http://www.rtwilson.com/downloads/MODIS_MOD04_16-06-2006_Subset.tif

If you load these into ArcGIS Desktop you will see large uniform areas. Clicking on these areas with the Info tool shows the pixel value to be No Data. However, when you choose to display No Data values as transparent (or as any colour) in the Symbology preferences for the layer, the No Data values do not follow that rule.

Interestingly, the No Data values outside of the main area of the image do follow the rule (set the colour to red to see that), but the ones inside the image don't.

I have really struggled to try and fix this problem - and can't work out how to do it at all.

Does anyone have any ideas?

6 Answers 6

5

There's definitely something very funky going on with that file/data.

You're right in that ArcGIS shows two different types of NoData even though the attributes both show the same thing. QGIS does this too. I have absolutely no idea whats happening in the data (but my guess would be that there are two different "noData" values being used behind the scenes, one may be "null" the other "-9999" for instance) but would be interested to know, maybe someone else can enlighten us.

However, there are a couple of possible workarounds:

Export the data - If you export the data being sure to "use renderer" it will start working correctly. If you don't tick the use-renderer your new file will have the same issues. On the downside this converts it to 8 bit data (0-255). Some other tool may be able to re-render it while keeping the data as 32bit floats.

Use Classified - The Classified symbology method seems to display both NoData types properly (i.e.e as the same thing) so use that if possible and you don't want to alter the data. Stretched exhibits your reported bug and "Unique Values" just doesn't show anything.

(Using ArcGIS 9.3.1)

2
  • Thanks for the response - I'm glad it's not just me that thinks this is weird. Unfortunately the classified symbology won't be suitable for what I need to do, but I'll do the exporting using a renderer at the moment. The frustrating thing is that this happens for all files that I get from the MODIS satellite using the MODIS online processing system. I think the issue may well be two different types of NoData - I think in this case they may be "null" and NaN, but I don't know.
    – robintw
    Jul 17, 2012 at 12:57
  • I think 'Use Classified' is by far the least onerous of all the suggested techniques to work around this bug. You can approximate almost everything you can do in the 'Stretched' menu in the 'Classified' menu.
    – Alexander
    May 12, 2019 at 16:04
3

I downloaded the file and converted it to a numpy array and when I loop over the values in the array I can see that I get -3.40282347e+38 and NaN as nodata values. Maybe you could reclassify these to values to one or the other, so all nodata values are the same.

You could use the reclassify tool, arcpy.sa.setnull or I am sure numpy has some fancy functions that could do this if you convert the image to a numpy array.

Gdal translate could also be useful if you want to go down the open source path.

3
  • Do you have any idea how I can reclassify these values? I can't seem to get ArcGIS to recognise anything for NaN, and it doesn't seem to deal with the very low value (basically NaN it seems - as that is the range of floats in Arc) either.
    – robintw
    Jul 17, 2012 at 15:26
  • If it was me I would convert each image to a numpy array, loop over the array converting all the nodata values to -9999 or whatever and then convey the array back to an image. I sure there is a smarter way of doing it but I haven't worked with numpy that much.
    – dango
    Jul 17, 2012 at 17:13
  • if you decide to use the method I suggested above you might want to look at using the python math.isnan() function to identify NaN values.
    – dango
    Jul 18, 2012 at 6:37
2

I just came across the same issue - and found a "solution". If you multiply the raster by 1.0 with the raster calculator, ArcMap will recognize the NoData values.

1

Had the same problem with 32 bit ESRI grids. The 16 bit ones worked fine and NoData was invisible but would show up black for the 32bit ones. Fixed it by exporting individually and changing the nodata value to -32768 as opposed to the -2147483647 the 32bit ones normally have.

1

I had the same problem. What worked for me was to export the raster on the geodatabase folder. If the raster is exported to a geodatabase, arcmap displays the NoData values correctly.

0

I have a similar problem with Landsat 8-OLI images when performing a mosaic. The "NoData" values on the outside (background) do nothing, but any missing data blocks, such as cloud/shadow removal on the inside will change the color of the reference mosaic layer. I performed it in ERDAS and Arcmap, both the same result. For some reason it has an effect on the symbology, but if you use the "Identify" tool, the pixel values are correct. If you are going after results and not display, you should be fine.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.