Conditional BANDS directive based on underlying data

Peter Schmitt <[email protected]>
Newsgroups gmane.comp.gis.mapserver.user
Message-ID <CACkcqcW3OqBzpbC4hC7goHrEC6q_+40CDLL4dbzdyhv_buFWPw@mail.gmail.com>
Hi,

When my data is 4-band (BGRN), I use the BANDS processing directive to
yield RGB tiles, like so:

    PROCESSING    "BANDS=4,3,2"

Is there a way to have a single layer within a Mapfile that will set this
directive to 4,3,2 when the underlying data has four bands and either skip
the directive or set it to 1,2,3 when the underlying data is 3-band?

The only thing I can think of is it to try runtime substitution, where my
request might include the band order like
"REQUEST=WMS&the_band_order=4,3,2&...." and then configure my mapfile
accordingly:

    PROCESSING    "BANDS=%the_band_order%"

Is there another way which doesn't require the client to know about the
underlying data?  FWIW, my ultimate use-case serves mosaics using a tile
index generated from Postgis. The Postgis table could have a column storing
the band information, but I'm not sure how to extract that in my
LAYER/BANDS Processing directive.

Thanks!
Pete

_______________________________________________
mapserver-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.