Is it possible, and if so how, to set the maximum scale a WMS layer can be viewed?

I know you can set it in a rule in the SLD style, but from the client you can always(?) change the style and thereby have other max scale limits. And that's not what I want.

I want to on the server side set that this layer should not be possible to view for scale larger than 1:1000.

Or is there any other good solution to accomplish this?

  • Ciao, not sure what you mean by " the client you can always(?) change the style" if you set a single stile that's the one users would use. If you are referring to the possibility to inline styles or pass a URL you can prevent users from doing that working at the webserver level (IIS or Apache HTTP). Simone.
    – simogeo
    Aug 3, 2014 at 16:52
  • 1
    There is sth like Scale denominators - WMS 1.3.0 (OpenGIS Web Map Service (WMS) Implementation Specification s.27, p., but I don't know how to set it up in geoserver, so this information could be usefull 4 me too.
    – Jendrusk
    Aug 4, 2014 at 6:37
  • Simone>Yes Im referring to the possiblity that the user with a little "hack" sends a different style parameter then the default in the url call. But yes that might be a solution to add something on the serverside. However if possbile to set this in GoeServer that would be much better?
    – Mike001
    Aug 4, 2014 at 10:08
  • Jendrusk>That sounds very interesting indeed. So if anyone knows how to apply it in GeoServer I guess that is the perfect solution
    – Mike001
    Aug 4, 2014 at 10:08

1 Answer 1


The proper way to set the maximum level of a WMS layer is the use of rules in the style associated with the layer. If you are afraid that users can zoom out of 1:1000 with other style, you can define only one style associated with the layer.

  • I think the poster is saying that clients could pass a new style sheet using the SLD_BODY parameter which would override the assigned style sheet. Aug 4, 2014 at 1:27
  • Hi and thanks for the reply. Correct Im thinking thats what the user can do. Or is it possible to lock that only style X can be usedn with a specific layer? If thats possible then I guess that would work as well?
    – Mike001
    Aug 4, 2014 at 10:01
  • @Leasye - I'm using now this method, but it's only half resolution. e.g. buildings layer - if I set proper scale in style of layer buildings are not rendered, but still client is asking about this layer and geoserver is replaying empty tiles. The best way is to tell the client not to ask about buildings at all cause scale is too big.
    – Jendrusk
    Aug 5, 2014 at 7:02
  • A client can send an SLD_BODY or SLD parameter with a different style, and thus override the defined style. This is defined at service level, so if you want some layers to allow dynamic SLD and others not, you're a bit stuck relying on SLD for restricting scale rendering.
    – nmtoken
    Aug 19, 2019 at 11:46
  • In recent versions of GeoServer it's possible to disable SLD_BODY and SLD parameters, go to the WMS service configuration and search for "dynamic styling". If some layers need to have dynamic styling, they could be placed in their own workspace and configure WMS to allow dynamic styling for it. The GeoFence also provides ways to control styling at the layer level. Aug 19, 2019 at 12:06

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.