I'm trying to create a dynamic heatmap using GeoServer 2.8.3, but when it comes to validating the colormap-part of my SLD i keep getting the same error:
line 66: cvc-datatype-valid.1.2.1: '${env('high',1)}' ist kein gültiger Wert für 'double'.
line 66: cvc-attribute.3: Wert '${env('high',1)}' des Attributs 'quantity' bei Element 'ColorMapEntry' hat keinen gültigen Typ 'double'.
My code looks as followed
<ColorMap type="ramp">
<ColorMapEntry color="#FFFFFF" quantity="0" opacity="1.0"/>
<ColorMapEntry color="#4444FF" quantity="0.3" opacity="1.0"/>
<ColorMapEntry color="#FF0000" quantity="0.7" opacity="1.0"/>
<ColorMapEntry color="#FFFF00" quantity="${env('high',1)}" opacity="1.0"/>
</ColorMap>
While the first three entrys work just fine, the fourth is causing the error to appear. I am pretty confused since i took the code right from the documentation (http://docs.geoserver.org/2.8.x/en/user/styling/sld-reference/rastersymbolizer.html#cql-expressions). Since i want the colormap to be fully customizable by the getmap-method, i would like to make every colormap-entry (color aswell as quantity) dynamic using the env-function.
Putting in ('high',1.0)
instead of ('high',1)
wont work.
I also found another question regarding the same matter, but it didnt help either (How do I use env parameter variables in an SLD colormap?).
Did anyone experience something similar?
The dynamic quantitys do work, but once i apply the same to the colors, it won't display the map at all.
<ColorMap type="ramp">
<ColorMapEntry color="${env('c1',#FFFFFF)}" quantity="${env('zero',0)}" opacity="1.0"/>
<ColorMapEntry color="${env('c2',#4444FF)}" quantity="${env('low',0.3)}" opacity="1.0"/>
<ColorMapEntry color="${env('c3',#FF0000)}" quantity="${env('med',0.7)}" opacity="1.0"/>
<ColorMapEntry color="${env('c4',#FFFF00)}" quantity="${env('high',1)}" opacity="1.0"/>
</ColorMap>
Do i have to do something special with the color-codes? I am not getting any error outputs for these.