0

I was wondering if there is a way in OL3 or Leaflet to load another SLD file other than the one is coupled with the layer in Geoserver. I have tried to find some topic related to this but no luck. That would be quite handy in cases you fetch data from a remote geoserver without permissions to style them. In that case you could apply your sld style (in url format) stored locally in your server. Are you aware if this is actually supported?

1

1 Answer 1

3

GeoServer supports SLD, SLD_BODY, and GET_STYLES with WMS version 1.1.1 if service administrator has not turned the feature off. It is less and less common to support remote styling with SLD because it has never been a great success and it also opens a way to send unfriendly SLD that at least makes heavy load for the WMS server.

You can test if server supports SLD by making a GetStyles request. If it is supported then probably also SDL and SLD_BODY are supported as well. That is not guaranteed, support for SLD requires that the remote server has connections open in the firewall so that it can read the SLD from the net.

The boundless demo server seems to send SLD with GetStyles

https://demo.boundlessgeo.com/geoserver/wms?service=WMS&version=1.1.1&request=GetStyles&layers=topp:states

Save the SLD, edit for example the fill, save it on your http server and try if GetMap with &SLD=http://my_server.com/my_sld.sld works as well.

1
  • thanks for the answer. Indeed having users creating the styles (e.g. using a webapp) could result to heavy slds. But that would be the only way to load remote wms services (which you dont' have access) and style them.
    – user1919
    Commented Apr 25, 2018 at 12:10

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.