You are here: Reference > Performing Common Tasks in XML and on the Command Line > Specifying Band Combinations from Multispectral Images Using XML Files

Specifying Band Combinations from Multispectral Images Using XML Files

The latest version of MrSID format, MrSID Generation 4 (MG4), supports multibanded or multispectral imagery. Accordingly, Express Server supports multispectral MrSID images as source images. Express Server also supports multispectral source imagery in JPEG 2000 format. Selecting which bands to serve from multispectral images is called band mapping.

The user's browser or other client has no conception of band selection or band mapping. To serve multispectral MrSID images, you must specify the source bands that Express Server should use to satisfy a request from a client. This is done by editing the file catalogs.xml, which by default is located in <Express Server installation directory>/ImageServer/etc/.

Band mapping applies to MG4, NITF, and JPEG 2000 source files. If images of another file format are present in the catalog, band mapping will not be applied to them.

To specify bands from multispectral images:

  1. Open the catalogs.xml file.
  2. Create a catalog for the image or images.
  3. Add a Bands element to the catalog and specify either a single band number or three numbers in a comma-delineated list.
  4. If the catalog is spatially indexed, update the spatial index.
  5. If an overview exists for the spatial index, update the overview.

In the following example, the catalog "cuprite_123" consists of the first three bands of any images placed in that catalog: (This happens to be Express Server's default behavior, so in this case the Bands element does not actually have any effect).

<Catalog name="cuprite_123" enabled="true">
<Path>C:\TestImages\cuprite</Path>
<Bands>1,2,3</Bands>
...
</Catalog>

Express Server identifies the first band as Band 1 (some applications start band numbering at 0 [zero] instead of 1).

If an image in a catalog cannot satisfy that catalog's band mapping a default band-mapping is applied, in which Express Server uses the first three bands if the image is RGB or multispectral and the first band if the image is grayscale.

NOTE: Multicatalogs cannot take the Bands element. Individual catalogs comprising a mutlicatalog must each be band-mapped separately.

Serving Different Band Combinations from the Same Images

If you want to serve different bands from the same images, you must define a new catalog for each band or set of three bands that you would like to serve. Give each catalog a new name and specify different bands in the Bands element. Here are two more examples of catalogs created using the same image directory as in the example above. The first specifies a single infrared band (band 4 in this case), and the second specifies bands 5, 7, and 10.

<Catalog name="cuprite_infrared" enabled="true">
<Path>C:\TestImages\cuprite</Path>
<Bands>4</Bands>
...
</Catalog>
<Catalog name="cuprite_5_7_10" enabled="true">
<Path>C:\TestImages\cuprite</Path>
<Band>5,7,10</Bands>
...
</Catalog>

NOTE: If a catalog contains only non-MG4 files no band selection is applied.

Changing Which Bands are Served from Multispectral Images

If you wish, you may edit existing catalogs in the catalogs.xml file to specify a different band or set of three bands using the bands element.

Remember that if the catalog is spatially indexed you must update the index after specifying different bands, and if an overview exists for that spatial index it too will need to be regenerated to reflect the new band selection.

See also Updating a Spatial Index Using the Command Line and Updating an Overview Using the Command Line.