2

I am looking for a way to tell a wms client which zoom levels or resolutions that are appropriate for a layer. Something like

...
<layer>
  ...
  <resolutions>
     <resolution>1.0<resolution>
     <resolution>2.0<resolution>
     <resolution>4.0<resolution>
  </resolutions>

One "less preferred" way would be the VendorSpecificCapabilities in the WMS GetCapabilities 1.1.1 DTD, but it is dropped in the 1.3.0 XSD.

Is there another way to do this within the WMS protocol?

1 Answers1

1

You can provide a ScaleHint for a layer

Layers may include a element that suggests minimum and maximum scales for which it is appropriate to display this layer. Because WMS output is destined for output devices of arbitrary size and resolution, the usual definition of scale as the ratio of map size to real-world size is not appropriate here. The following definition of Scale Hint is recommended. Consider a hypothetical map with a given Bounding Box, width and height. The central pixel of that map (or the pixel just to the northwest of center) will have some size, which can be expressed as the ground distance in meters of the southwest to northeast diagonal of that pixel. The two values in ScaleHint are the minimum and maximum recommended values of that diagonal. It is recognized that this definition is not geodetically precise, but at the same time the hope is that by including it conventions will develop that can be later specified more clearly. (page 19 WMS Spec)

However if you really need resolutions then you might be better off using a WMTS which has the concept baked in.

Ian Turton
  • 81,417
  • 6
  • 84
  • 185
  • Thanks for you reply! However, there is no way to provide the exact resolutions with ScaleHint. The client can only "guess" 1,2,4 if min=sqrt(1+1) and max=sqrt(4^2+4^2), since both are irrational numbers. Also, for the resolution sequence 1,2,4,10,20 you're also out of luck. – Jonas Andersson Jun 28 '13 at 11:23
  • 1
    Maybe you want a WMTS instead of a WMS? – Ian Turton Jun 28 '13 at 11:30
  • That's probably the most viable solution. We have some legacy clients though, that uses getMap of WMS, switching to getTile of those would be time consuming. Adding to getCapabilities would be easier, but when looking at the WMTS spec, I get the feeling it can't be done within WMS, and that WMTS is the correct answer. – Jonas Andersson Jun 28 '13 at 12:26
  • BTW, If you add your last comment as an answer, I'll go ahead and mark that one as correct :) – Jonas Andersson Jun 28 '13 at 12:32