I use cql expressions to make my color map entries dynamic as described here: http://docs.geoserver.org/2.8.x/en/user/styling/sld-reference/rastersymbolizer.html#cql-expressions

It works basically, but as soon as I add an additional layer in my WMS call (&layers=layer1,layer_raster) the parameters I pass in the URL (&env=low:10;medium:100;...) are just ignored and the default values I defined with the cql expression are applied.

Does anyone know about this issue? I am using GeoServer 2.8.0.

  • Thinking that semicolon is used as a separator between layer wise CQL filters if WMS request is made with a list of layers. Perhaps the same thing happens for you because the ENV variable contains semicolons. Perhaps semicolons should be escaped or the whole value of "ENV" enclosed somehow. – user30184 Jun 10 '16 at 10:38
  • I tried it with one cql filter variable only, so I didn't use a semicolon here – MikeHuber Jun 10 '16 at 12:07
  • 1
    You mean you tried something else than (&env=low:10;medium:100;...)?, Could you add a complete request? Even better if you can get the error to appear with the GeoServer demo layers. – user30184 Jun 10 '16 at 12:17
  • This is my request: server:8080/geoserver/prog/… (I anonymized the coordinates) – MikeHuber Jun 10 '16 at 12:35

Has been answered on the geoserver-users mailing list, it's a bug in env usage inside raster symbolizer happening when multiple layers are requested: http://osgeo-org.1560.x6.nabble.com/Variable-substitution-not-working-if-multiple-layers-are-provided-in-WMS-call-td5271011.html

The env function works otherwise fine (against one or more vector layers, or against single layer raster ones).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.