-1

Why does a WMS GetCapabilities has different scale values according to version response for the same map?

And the map visible scale is yet different on GetMap requests?

For example in WMS server hydro.nationalmap.gov there's a map name "7" and title "FlowDirection" (full definition below). A GetMap request with scale 1:70000 or lower (i.e. 1:71000) returns a blank image, but in 1:69000 and above (i.e. 1:68000) it is drawn. And in GetCapabilities response the MaxDenominator values are (39.59) and (94494).

How to interpret/understand these values?

Why they are different?

They do really has something to deal with the map not draw a blank image?

In version 1.1.1 the layer ScaleHint is:

(min="0.0" max="39.597980")

In version 1.3.0 the same layer Scale is:

(<MaxScaleDenominator>94494.047619</MaxScaleDenominator>)

The given example is just to ilustrate the issue. My question is about how to interpretate the Scale bounds in capabilities. How to know what area i could request without getting an empty map.

Example requests in QGIS using a OpenStreetMap as basemap to show is the same place at different scales.

Map at scale 1:69k drawn: https://hydro.nationalmap.gov:443/arcgis/services/NHDPlus_HR/MapServer/WmsServer?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-99.0108095171964635,27.92574341140148775,-98.55777862952200508,28.26501764446166121&CRS=CRS:84&WIDTH=1135&HEIGHT=850&LAYERS=7&STYLES=&FORMAT=image/png&DPI=57&MAP_RESOLUTION=57&FORMAT_OPTIONS=dpi:57&TRANSPARENT=TRUE

FlowDirection is visible and the basemap is behind

Map at scale 1:70k (just base map and empty FlowDirection map): https://hydro.nationalmap.gov:443/arcgis/services/NHDPlus_HR/MapServer/WmsServer?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-99.01409234971585249,27.92328490246626416,-98.55449579700261609,28.2674761533968848&CRS=CRS:84&WIDTH=1135&HEIGHT=851&LAYERS=7&STYLES=&FORMAT=image/png&DPI=57&MAP_RESOLUTION=57&FORMAT_OPTIONS=dpi:57&TRANSPARENT=TRUE

Just the basemap, flowdirection is blank

Layer in Capabilities 1.1.1:

<Layer queryable="1">
    <Name>7</Name>
    <Title>
        <![CDATA[FlowDirection]]>
    </Title>
    <Abstract>
        <![CDATA[]]>
    </Abstract>
    <SRS>EPSG:4326</SRS>
    <SRS>EPSG:3857</SRS>
    <!-- alias 3857 -->
    <SRS>EPSG:102100</SRS>
    <LatLonBoundingBox minx="-160.247041" miny="17.673736" maxx="-64.565192" maxy="63.630037"/>
    <BoundingBox SRS="EPSG:4326" minx="-160.247041" miny="17.673736" maxx="-64.565192" maxy="63.630037"/>
    <BoundingBox SRS="EPSG:3857" minx="-17838618.997300" miny="1999394.962800" maxx="-7187364.275300" maxy="9256431.967300"/>
    <BoundingBox SRS="EPSG:102100" minx="-17838618.997300" miny="1999394.962800" maxx="-7187364.275300" maxy="9256431.967300"/>
    <Style>
        <Name>default</Name>
        <Title>7</Title>
        <LegendURL width="174" height="180">
            <Format>image/png</Format>
            <OnlineResource xlink:href="https://hydro.nationalmap.gov:443/arcgis/services/NHDPlus_HR/MapServer/WmsServer?request=GetLegendGraphic%26version=1.1.1%26format=image/png%26layer=7" xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" />
        </LegendURL>
    </Style>
    <ScaleHint min="0.0" max="39.597980"/>
</Layer>
<Layer queryable="1">

Layer in Capabilities 1.3.0

<Layer queryable="1">
    <Name>7</Name>
    <Title>
        <![CDATA[ FlowDirection ]]>
    </Title>
    <Abstract>
        <![CDATA[ ]]>
    </Abstract>
    <CRS>CRS:84</CRS>
    <CRS>EPSG:4326</CRS>
    <CRS>EPSG:3857</CRS>
    <!--  alias 3857  -->
    <CRS>EPSG:102100</CRS>
    <EX_GeographicBoundingBox>
        <westBoundLongitude>-160.247041</westBoundLongitude>
        <eastBoundLongitude>-64.565192</eastBoundLongitude>
        <southBoundLatitude>17.673736</southBoundLatitude>
        <northBoundLatitude>63.630037</northBoundLatitude>
    </EX_GeographicBoundingBox>
    <BoundingBox CRS="CRS:84" minx="-160.247041" miny="17.673736" maxx="-64.565192" maxy="63.630037"/>
    <BoundingBox CRS="EPSG:4326" minx="17.673736" miny="-160.247041" maxx="63.630037" maxy="-64.565192"/>
    <BoundingBox CRS="EPSG:3857" minx="-17838618.997300" miny="1999394.962800" maxx="-7187364.275300" maxy="9256431.967300"/>
    <BoundingBox CRS="EPSG:102100" minx="-17838618.997300" miny="1999394.962800" maxx="-7187364.275300" maxy="9256431.967300"/>
    <Style>
        <Name>default</Name>
        <Title>7</Title>
        <LegendURL width="174" height="180">
            <Format>image/png</Format>
            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://hydro.nationalmap.gov:443/arcgis/services/NHDPlus_HR/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=7" xlink:type="simple"/>
        </LegendURL>
    </Style>
    <MaxScaleDenominator>94494.047619</MaxScaleDenominator>
</Layer>

Examples:

WMS 1.3.0: https://hydro.nationalmap.gov/arcgis/services/NHDPlus_HR/MapServer/WmsServer?request=GetCapabilities&version=1.3.0&service=WMS

WMS 1.1.1: https://hydro.nationalmap.gov/arcgis/services/NHDPlus_HR/MapServer/WmsServer?request=GetCapabilities&version=1.1.1&service=WMS

4
  • The definitions of scales and scale denominators in WMS are a bit special. I recommend to read them from the standards first and come back with further questions if something is still unclear. In WMS 1.3.0 the starting point could be section 7.2.4.6.9 Scale denominators. – user30184 Mar 29 at 8:15
  • @user30184 I've read it. The documentations mention a epsilon in function: scale ≥ (min_scale – epsilon) AND scale < (max_scale + epsilon) With epsilon: 1e-6. But the limit of Visible extention is 69k and maxScaleDenominator in Capabilities is 94k. So nothing new to help here. – Asfixia Mar 29 at 15:27
  • There exist also poorly configured servers. I haven't checked yet if these belong to that group. – user30184 Mar 29 at 18:44
  • I just put this Capabilities example to ilustrate this issue. This happens in many servers, i just want to interpretate the results in any server. I clarified this in question now, thanks! – Asfixia Mar 30 at 14:55
2

WMS 1.1.1 standard defines

Layers may include a <ScaleHint> 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.

WMS 1.3.0 defines Scale denominators

7.2.4.6.9 Scale denominators The <MinScaleDenominator> and <MaxScaleDenominator> elements define the range of scales for which it is appropriate to generate a map of a Layer. Because maps from a WMS may be viewed on arbitrary displays rather than on paper, the values used are actually the scale denominators relative to a common display pixel size. The intent of scale denominators is not that the translation between “actual” and “standard” scales always be completely accurate. Rather, the intent is to reduce the amount of clutter or crowding of features portrayed on the map. The scale denominator values are guidelines for clients, not firm limits. Upon receiving a request for a map that is not within the scale denominator range, the server may return a blank map, or may return a portrayal of the Layer that is crowded with features or otherwise poorly suited for display; the server shall not respond with a service exception. For the purposes of this International Standard, the common pixel size is defined to be 0,28 mm × 0,28 mm. Because arbitrary clients can request maps from a server, the true pixel size of the final rendering device is unknown to the server.

By these rules and very rough calculations with your GetMap requests I get the scaleDenominator for WMS 1.3.0

Height of the map

(28.2674761533968848-27.92328490246626416) degrees * 110772 m/degree = 38128 m

and

38218 m / 851 pixels / 0,00028 m = 160000

For WMS 1.1.1 the height of a pixel is

38218 / 851 = 44.8 m

and scaleHint that is the diagonal size of the pixel is then about

44.8 m * 1.4 = 62.7 m

The values differ quite a lot from those in GetCapabilities (94494.047619 and 39.597980). Feel free to find where I have calculated wrong.

1
  • I guess your calculation is right. I comparated with another formulas as: var degrees2meters = function(lon,lat) { var x = lon * 20037508.34 / 180; var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); y = y * 20037508.34 / 180; return [x, y] } But i've found a responde that in Geoserver the ScaleHint refers to scale itself despite the definition. osgeo-org.1560.x6.nabble.com/… So looks like there is more meanings in these numbers than the definition says. – Asfixia Apr 3 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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