[Geoserver-users] Color palette statically configured on a Layer or a Style?

GeoServer supports "palette" - vendor parameter on WMS requests as
documented here:

- http://docs.geoserver.org/latest/en/user/services/wms/vendor.html
-
http://docs.geoserver.org/latest/en/user/tutorials/palettedimage/palettedimage.html#tutorials-palettedimages

This feature is usefull in some cases, such as producing PNG8 indexed image
with only 256 colors, as standard GeoServer quantization methods (octree or
mediancut) distort some colors too much on colorful topographic maps.
The problem is that palette parameter must be delivered on a WMS request.
For example when using layer group with sub layers representing different
SLD visualizations on different scales it would be necessary to have
separate palette files for each sub layers. However when accessing layer
group from WMS using layer group name only one palette file name can be
specified.
Also some clients do not support providing non-standard "palette" parameter
on WMS request.
So the actual question : is there any way to configure palette file
configuration statically to a Layer or Style configuration under workspaces?

regards,
Jakob

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Color-palette-statically-configured-on-a-Layer-or-a-Style-tp5132589.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Wed, Apr 2, 2014 at 7:19 AM, Jakob Ventin <jventin@anonymised.com> wrote:

GeoServer supports "palette" - vendor parameter on WMS requests as
documented here:

- http://docs.geoserver.org/latest/en/user/services/wms/vendor.html
-

http://docs.geoserver.org/latest/en/user/tutorials/palettedimage/palettedimage.html#tutorials-palettedimages

This feature is usefull in some cases, such as producing PNG8 indexed image
with only 256 colors, as standard GeoServer quantization methods (octree or
mediancut) distort some colors too much on colorful topographic maps.
The problem is that palette parameter must be delivered on a WMS request.
For example when using layer group with sub layers representing different
SLD visualizations on different scales it would be necessary to have
separate palette files for each sub layers. However when accessing layer
group from WMS using layer group name only one palette file name can be
specified.

What you are asking is not achievable in general. The output image can only
have 256 colors, and it might not be possible to combine all the original
layer
by layer pallettes into a single one that preserves all the original colors.
It might work only if the overall set of colors, unioning all the ones from
the original
palettes, sums to less than 256 colors total.

Also some clients do not support providing non-standard "palette" parameter
on WMS request.
So the actual question : is there any way to configure palette file
configuration statically to a Layer or Style configuration under
workspaces?

No, there is no way, but have a single palette per layer (and one for the
whole
layer group) would make sense and I guess would be a welcome addition.
Patches welcomed :slight_smile:

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------