I am having a problem with getting my Landsat 8 RGB (bands 2-7) .tif background values (very small number but not zero) set to null. I have tried the following tools:

Raster Calculator (image 2)

Set Null (image 3)

I have also gone to (Windows / image analysis), selected one of the files, added a function, and computed the "NoData" values. Ran the function, and I still get the same result shown in image 1. I tried using the value as well in Set Null and the Raster Calculator, no luck.

enter image description here

enter image description here

enter image description here

enter image description here

  • 1
    Have a read of GDAL NearBlack gdal.org/programs/nearblack.html, it's specifically for this type of situation where an image has been JPEG or ECW compressed at some stage though it may not work for float data type, give it a shot and see if this utility fixes the raster otherwise you may need to separate the bands with an arcpy.sa.Con and stack the bands back up again. BTW packbits is a horrible compression type for continuous rasters, consider Deflate or LZW (LZMA) compression instead. Jul 11 '19 at 2:03
  • How do I exactly use this? Am I supposed to download GDAL or is this a tool I can upload into software programs such as Arcmap or ERDAS?
    – Zman3
    Jul 11 '19 at 5:59
  • Downloading GDAL and using the shell is the easiest way if you're comfortable with CMD, if a command shell is something you'd rather not use then you would be better served by installing the latest version of QGIS and run near black from that GUI docs.qgis.org/2.8/en/docs/user_manual/processing_algs/gdalogr/…. Jul 11 '19 at 6:50
  • I have not had any experience with a command shell, so I will opt to using the QGIS. Plus I've been working on installing GDAL for the past hour and haven't had any luck. I'll give QGIS a go and let you know if I run into any issues.
    – Zman3
    Jul 11 '19 at 7:06
  • If you're on windows I recommend the GISInternals binary package gisinternals.com/release.php but understand your reticence with the antiquated CMD interface. From the same site you can install the python bindings which will play nice with your ArcGIS python install - as long as you get the correct bindings for your version of ArcGIS. This thread from GeoNet might be interesting for you community.esri.com/thread/47189 Jul 11 '19 at 7:28

It appears the problem is that the band values somehow got converted to a signed float, so you have a value that is near zero but not actually zero (or something similar). It should resolve if you use the copy raster tool in an ESRI environment and output an unsigned integer and specify zero as the no data value. I'm not sure at this point if you can run it on the entire image or if you must run it on individual bands and reassemble the bands as an image.

  • Getting it out of 32-bit float and back to integer will also improve processing speed and make your life a lot easier. Jul 12 '19 at 17:55
  • I ended up changing the band to integer using the int tool. I don't think I could change the whole raster image because each band had a different "NoData" value. So I had to separate by each band.
    – Zman3
    Jul 15 '19 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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