Handling Raster backgrounds and NoData

Sometimes there are homogeneous areas in a raster dataset that you do not want to display. These can include borders, backgrounds, or other data considered to not have valid values. Sometimes these are expressed as NoData values, although at other times they may have real values.

Backgrounds and outlines can often be the result of georeferencing your raster dataset. If your raster data has a background, border, or other NoData values, you can choose not to display them or choose to display them as a particular color.

All renderers allow you to set the NoData value to a color or No Color, while the Stretched renderer allows you to identify a specific background value and display color or No Color.

What do you do if you’re still seeing a background colour after applying a 255,255,255 RGB background and the NoData options as in the example below?

If you had other values other than 255, 255, 255 for colours close to white (like 250 for example) and the NoData and Background colour settings were not enough to handle them, then it’s likely that that they may otherwise be rendering errors coming from the image preprocessing, perhaps from compressing the images.

Trying to apply the Spatial Analyst > Reclass > Reclassify tool try to handle that problematic range would only result in you losing the detail in your image by simplifying the spectrum into a new classification.

A better solution is a workflow that should make your data management more efficient as a consequence.

You will need to create a Mosaic Dataset to manage your images and be able to specify the reclassification this way.
The mosaic dataset simply acts as a reference to your images to spatially index them with pyramids for processing and any queries or conditions (like the reclassification of RGB values > 250 for example) you may want to add to them during display.

From ArcCatalog:
1) Create a new File Geodatabase.
2) Create a new Mosaic Dataset: Right click on the geodatabase, New > Mosaic Dataset and enter your parameters, using your image’s coordinate system (with Import) and making sure to use the pixel properties from your ecw.
3) Right click on the empty mosaic dataset and select: Add Rasters, then add your images and accept the defaults.
4) Right click on the mosaic dataset and select: Build Overviews, and accept the defaults.

From ArcToolbox:
1) Data Management Tools > Raster > Mosaic Dataset > Build Footprints … here you can set a ‘Maximum Data Value’ to squeeze out
the whites that are above 250 for example. Accept the other defaults and press OK.

No change yet? Make sure to deactivate your original raster layers underneath if you have them in ArcMap.

Esri Australia Technical Support

1 thought on “Handling Raster backgrounds and NoData

  1. Berrit Bredemeier

    I tried this method, unfortunately in my case it did not get rid of all the -9999 values which I wanted to eliminate. There were still areas left around the edges and also where there were gaps within the raster, where no data was collected and the person that processed the data had set the NoData Value to -9999, those didn’t get clipped either. I can understand that the tool only does the surrounding, not the holes within, but it seems to have limited capacity for vertices, even if you do use the setting of -1 to not limit the vertices created.
    I now tried reclassifying to create a polygon for cutting, but unfortunately the resulting grid is shifted north by 3.7cm…. Technology is against me today, it seems.
    Thanks anyway for the tip with the footprint, it might be useful at some point with a less complex, smaller raster.


Got something to say?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s