PROCESSING directive - scale

Frank Warmerdam warmerdam at POBOX.COM
Mon Nov 22 10:26:30 EST 2004


Nuno GIL wrote:
> Hi listers,
> I have a Landsat5 dataset for Africa tiled and in
> separate bands (1, 2 and 3). This dataset is not
> contrast stretched.
> With the PROCESSING directive SCALE I can
> automatically contrast stretch each band and serve
> them in a WMS as separate contrast stretched Landsat5
> bands, but is there any way of joining the 3 bands on
> the fly to generate a composite RGB contrast stretched
> image?
>
> Can someone explain me how the PROCESSING BANDS
> directive work? I could not understand it quite well.
> In the raster document for MapServer it is first shown
> as BANDS=red_or_grey[,green,blue[,alpha]] and then the
> example is PROCESSING "BANDS=4,2,1". Where can I find
> more info on it?

Nuno,

What part don't you understand?  The BANDS directive takes a list of
band number as arguments.  If you supply only a single band number it will
be treated as a single greyscale band.  If you support 3 they will be
treated as an RGB composite.

I suspect your problem is that you have the bands in seperate files.
MapServer provides no mechanism to merge different files on the file into
an RGB composite with red, green and blue coming from different sources.

The obvious option is to build a multispectral file from your input files
and then serve from that.  You can use the gdal_merge.py script with the
-separate switch to build a composite from a bunch of single band files.

Another alternative is to build a GDAL "virtual file" that will virtually
stack all the individual files into one multispectral virtual file without
having to actually copy data.  Then MapServer can use the virtual file for
composites.

I hope this helps.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list