I have a 4-bit thematic raster image with a color map from white to dark blue (Figure 1). The values 1 - 6 represent tree canopy cover at various breakpoints. I also created a raster attribute table with the various classified breakpoints (Figure 2). Is there a way (i.e. other than creating a .mxd document) for the image to immediately display the "Cover" attributes in Figure 2, rather than what currently displays in figure 1?

Essentially what I am trying to do is eliminate the classes with no data (e.g. 0, 7-15) and make the "Cover" raster attributes display by default when the user brings up the image in the viewer.

Figure 1

enter image description here

Figure 2

enter image description here

  • 2
    what about using a .lyr ? – radouxju May 13 '14 at 19:14
  • 2
    Loading the raster using a lyr file will allow for this. You may also be able to replace the raster function in the raster itself so it loads by default by saving a Raster Function Template XML file from a symbolized version of the raster, then using the Edit Raster Function GP tool to insert or replace the function originally stored in the raster. I mention this at this recent question but did not test the method to establish permanence. – Chris W May 13 '14 at 20:19
  • 1
    That's what I get for not testing. For that tool to work, the raster must already have a function in it or be a mosaic. I don't know if that's the case with your data, but it isn't with my test rasters and therefore isn't working. – Chris W May 13 '14 at 20:41

Since your data has fewer than 25 values, you should be able to open the Symbology tab for the raster and choose Unique Values. This should allow pretty straight-forward selection of colors, including NOT displaying undesired values just as with vector data. You then have two options to get the symbology to persist.

Option 1: Use a layer file. Right-click the raster in the ToC and choose Save as Layer File. If you add the lyr file to a map instead of the raster, it will symbolize as you want. This method is subject to issues with pathing, but will save your value labels if you set them up to match your cover attribute.

Option 2: Use a color map 'sidecar' file. At the bottom of the Symbology tab click the Colormap drop-down button and choose Export. The colormap (clr) file must have the same name as the raster for it to apply automatically. As long as the clr file is present, when the raster is added it should use those colors. However (at least in my testing) it will not preserve any labels you set up.

You can also manually generate color maps via other means (for instance if your data has more than 25 values), or use the one you have to apply to other rasters using the Add Colormap GP tool. The help file on Raster Rendering Behavior is where I started my research tree for all of this - it lists default raster rendering behaviors and some options, along with links to other relevant help pages.

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.