0

Trying to filter a WMS layer with the following query:

https://wms.geo.admin.ch/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=ch.bafu.klima-co2_ausstoss_gebaeude&STYLES=&WIDTH=800&HEIGHT=600&CRS=EPSG:2056&BBOX=2485410.215,1075268.1362500004,2833857.723749999,1295933.6975000016&SLD=https://gist.githubusercontent.com/maxcollombin/aea50283656b7d8344046e0c39ed149d/raw/f8a525d7bb28180e66962157a3e2d719a60c221e/ch.bafu.klima-co2_ausstoss_gebaeude_features_constraints.sld

I'm getting the following error:

msDrawMap(): Image handling error. Failed to draw layer named 'ch.bafu.klima-co2_ausstoss_gebaeude'.
msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs

If it helps, here's a GetFeatureInfo request on the same layer to obtain the attributes and associated values:

https://wms.geo.admin.ch/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&LAYERS=ch.bafu.klima-co2_ausstoss_gebaeude&QUERY_LAYERS=ch.bafu.klima-co2_ausstoss_gebaeude&CRS=EPSG:2056&BBOX=2531423.89,1155079.22,2532223.89,1155679.22&FEATURE_COUNT=2&HEIGHT=2&WIDTH=2&FORMAT=image/png&INFO_FORMAT=text/plain&I=1&J=1

3
  • what does the log file say happened?
    – Ian Turton
    Jul 5, 2023 at 15:41
  • what if you use <ogc:Literal>1</ogc:Literal>
    – nmtoken
    Jul 5, 2023 at 17:49
  • It doesn't work either.. I also asked about the swisstopo user group. I'll keep you posted. Jul 7, 2023 at 8:39

1 Answer 1

0

Works in the end. The parameters and value passed were wrong.

https://wms.geo.admin.ch/?
SERVICE=WMS
&VERSION=1.3.0
&REQUEST=GetMap
&FORMAT=image/png
&TRANSPARENT=TRUE
&LAYERS=ch.bafu.klima-co2_ausstoss_gebaeude
&STYLES=&
WIDTH=800&
HEIGHT=600
&CRS=EPSG:2056
&BBOX=2485410.215,1075268.1362500004,2833857.723749999,1295933.6975000016
&SLD=https://gist.githubusercontent.com/maxcollombin/aea50283656b7d8344046e0c39ed149d/raw/33bc789cf449dfcdc232837bea6840691a774482/ch.bafu.klima-co2_ausstoss_gebaeude_features_constraints.sld&
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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