How To: Use description of SDE Raster colormap values with an Image Service
The colormap for an ArcSDE Raster is stored, along with its dataset, in the database. The descriptions for the colormap indexes can be stored in a separate table within the database and displayed in the legend generated by the Image Server.
Instructions provided explain how to display these descriptions in the legend of an Image Service's output image.
Colormap descriptions for file based images can be included in the *.clr file itself, so this article applies only to ArcSDE Rasters.
The first step is to create a colormap description table.
For SDE raster, colormaps should have scheme: VARCHAR COLORMAP_INDEX, VARCHAR DESCRIPTION
The first column contains the index values and the second column contains the descriptions for these indexes. This table should be stored in the same database location as the raster.
Order of entries in the table is unimportant. If any of the field values has a null value, the record is skipped.
Also, if the entry index is out of data range, record is skipped.
Indexes refer to the value of cell, not the color value. The following example illustrates the indexes for a 3x3 raster:
0 1 2
1 2 3
2 3 4
The description table should look similar to this example:
After the creation of the description table, include it in the legend by taking the following steps:
- Open the Image Service's configuration file (*.axl) in a text editor.
- Find the DATASET element of the ArcSDE raster layer and specify the table name as the value of the description attribute.
- Continuing in the same DATASET element, set the value of the showcolormaplegend attribute to true.
This example shows the configuration file's modified ArcSDE raster LAYER element. The name of the description table is TEST.ELEVMAPDESC.
<LAYER type="image" name="TEST.ELEVMAP" visible="true" id="0">
<DATASET name="TEST.ELEVMAP.IMAGE" description="TEST.ELEVMAPDESC"
showcolormaplegend ="true" workspace="sde_ws-0"/>