1

I have an issue with using the parameter SLD in GetMap when using the WMS service via the geoserver's API. When passing a style into the parameters of a GET call to a WMS layer using the STYLES parameter I get the desired result. However, when I copy and paste the sld code into a file on GitHub and use the SLD parameter accordingly, everything is grey.

Any idea?

Geoserver version: 2.19.1

Using parameter styles

Using parameter SLD

5
  • 1
    So it's giving you the default style stage.xcube-geodb.brockmann-consult.de/geoserver/…
    – nmtoken
    Commented Jun 25, 2021 at 7:11
  • Is dynamic styling enabled ~ docs.geoserver.org/latest/en/user/services/wms/…
    – nmtoken
    Commented Jun 25, 2021 at 7:22
  • 1
    A request without the layers parameter (which is allowed) gives an exception ServiceException>Error while getting SLD. See the log for details. so either the server can't see the SLD or there is some other issue with the SLD
    – nmtoken
    Commented Jun 25, 2021 at 7:47
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Commented Jun 25, 2021 at 10:10
  • Welcome to Geographic Information Systems! You need to turn up the logging level to developer in the global settings page, and then make the request again. Then edit your question with the relevant part of the log file.
    – Ian Turton
    Commented Jun 25, 2021 at 10:10

1 Answer 1

1

Your SLD on GitHub has:

<sld:NamedLayer>
    <sld:Name>CH001L2_ZURICH_UA2018</sld:Name>

The SLD schema (http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd) tells us that:

<xsd:element name="NamedLayer">
    <xsd:annotation>
        <xsd:documentation>
    A NamedLayer is a layer of data that has a name advertised by a WMS.
  </xsd:documentation> 

But the WMS has no layer called CH001L2_ZURICH_UA2018 only layers eea-urban-atlas_DE002L1_HAMBURG_UA2018 and eea-urban-atlas_SI001L2_LJUBLJANA_UA2018

So the SLD is not applied, and you get the default.

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.