[Geoserver-users] SLD RasterSymbolizer: ColorMapEntry color variable substitution

Actually GetLegendGraphic works well (it was my mistake and I apologize), but GetMap query still returns default value colors…

···

From: Victor.Sinceac
Sent: Tuesday, June 14, 2016 9:19 PM
To: geoserver-users@lists.sourceforge.net
Subject: SLD RasterSymbolizer: ColorMapEntry color variable substitution

Hi,

I’m trying to use variable substitution for color values in ColorMapEntry in SLD with GeoServer V2.8.3. The SLD is as follows:

[… ETC …]

[… ETC …]

This works well with both WMS GetMap and GetLegendGraphic queries for default values, but cannot change the result by sending ENV values different from default.

When sending WMS GetMap and GetLegendGraphic queries, with or without ENV values, the result is always the same (i.e. with default color values as defined in the SLD).

I tried “&ENV=c11:%23000000;”, “&ENV=c11:#000000;”, “&ENV=c11:0xFF0000;”, etc.: all queries return the same result as without ENV.

I’ve already read http://gis.stackexchange.com/questions/188440/geoserver-dynamic-colormap-using-cql-wont-work, which has the same subject and which says it should work with “&ENV=c11:%23000000;”.

GeoServer log shows a priori a correct parsed query (here for the GetLegendGraphic query try with “&ENV=c11:%23000000;”):

2016-06-14 20:56:47,834 INFO [geoserver.wms] -

Request: getLegendGraphic

Transparent = false

Width = 20

Height = 20

Scale = -1.0

Env = {C11=#000000, GSUSER=admin}

Styles = [StyleImpl[ name=Data_Raster]]

FeatureType = null

Layers = [SimpleFeatureTypeImpl /messir:ODB_SYNOP_Data identified extends Feature(station_id:station_id,data_time:data_time,paramvalue:paramvalue,geom:geom)]

LegendOptions = {}

Exceptions = SE_XML

Locale = null

Format = image/png

Rules = [Palette_Temperature_0_R]

Strict = true

Get = false

BaseUrl = …

RawKvp = {STYLE=messir:Data_Raster, LAYER=messir:ODB_SYNOP_Data, VERSION=1.0.0, FORMAT=image/png, RULE=Palette_Temperature_0_R, ENV=c11:#000000, REQUEST=GetLegendGraphic}

RequestCharset = null

Version = 1.0.0

Request = GetLegendGraphic

Nevertheless, the result is for default color value as defined in ColorMapEntry.

How can I get working the color change with variable substitution?

Many Thanks,

Victor