Re: [mapserver-users] Conditional BANDS directive based on underlying data

2019-04-30 Thread Peter Schmitt
On Tue, Apr 30, 2019 at 4:41 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

>
> As Even already answered, using vrt files over the BGRN originals will
> work. We had a need to use both grayscale originals and vrt-falsified RGB
> versions (the only band pointing to red, green, and blue in .vrt) in the
> same service. We have only one tileindex in PostGIS, made from the tiff
> images, but it can be modified on-the-fly in the tileindex layer
>
>
>
> DATA "the_geom from (SELECT the_geom, fid, CASE WHEN filepath like
> '%_mv_%' THEN replace(filepath,'TIFF','vrt') ELSE filepath END AS location,…
>
>
>

Thanks Jukka & Even! A tile index of VRTs should work quite well for my use
case.

Cheers,
Pete
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Conditional BANDS directive based on underlying data

2019-04-30 Thread Rahkonen Jukka (MML)
Hi,

As Even already answered, using vrt files over the BGRN originals will work. We 
had a need to use both grayscale originals and vrt-falsified RGB versions (the 
only band pointing to red, green, and blue in .vrt) in the same service. We 
have only one tileindex in PostGIS, made from the tiff images, but it can be 
modified on-the-fly in the tileindex layer

DATA "the_geom from (SELECT the_geom, fid, CASE WHEN filepath like '%_mv_%' 
THEN replace(filepath,'TIFF','vrt') ELSE filepath END AS location,…

-Jukka Rahkonen-

Lähettäjä: mapserver-users  Puolesta 
Peter Schmitt
Lähetetty: maanantai 29. huhtikuuta 2019 19.41
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] Conditional BANDS directive based on underlying data

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_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
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Conditional BANDS directive based on underlying data

2019-04-29 Thread Even Rouault
On lundi 29 avril 2019 10:40:32 CEST Peter Schmitt wrote:
> 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_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.

Use a VRT that does the band reordering, and use it in your tile index.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Conditional BANDS directive based on underlying data

2019-04-29 Thread Peter Schmitt
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_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
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users