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:
<RasterSymbolizer>
[... ETC ...]
<ColorMapEntry color="${env('c11','#2E6000')}" quantity=" 8" label="
+8°C"/>
[... 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
________________________________
This message is subject to and does not create or vary any contractual
relationship between Campbell Scientific Limited, its subsidiaries or
affiliates ("CSL") and you. Internet communications are not secure and
therefore CSL does not accept legal responsibility for the contents of this
message. The message is intended for the addressee only and its contents and
any attached files are strictly confidential. If you have received it in error,
please telephone +44 (0)1509 601141 or email postmas...@campbellsci.co.uk.
Thank you.
Campbell Scientific Ltd.
Company Registration Number: 1933935 (England and Wales) Registered Address:
Campbell Park, 80 Hathern Road, Shepshed, Loughborough, Leicestershire LE12
9GX, UK
Tel: +44 (0) 1509 601141
Fax: +44 (0) 1509 601091
Web: www.campbellsci.co.uk
________________________________
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users