1

I'm trying to understand the relation between a <LatLongBoundingBox> and <BoundingBox> in a GetCapabilities WMS response, given that the SRS of the bounding box is EPSG:4326.

Here's an example of the WMS that I'm trying to query:

<Layer>
<!-- snip -->
<LatLonBoundingBox maxx="37.968" maxy="70.144" minx="-4.646" miny="48.833"/>
<BoundingBox SRS="EPSG:4326" maxx="0.662672" maxy="1.224240" minx="-0.081091" miny="0.852295"/>
<!-- other BoundingBoxes omitted -->
</Layer>

My questions related to this response:

  • Why are the BoundingBox values different from the LatLonBoundingBox values an how is this useful? It looks like a scaling hint of some sorts.
  • Is it possible to determine the 'native' resolution of the layer (in pixels) using these values?
botteaap
  • 113
  • 3

1 Answers1

1

There does seem to be something very odd going on there. In a WMS 1.1.1 response such as the one you have given (because it has LatLonBoundingBox) they should exactly match for example here's the output for a UK wide WMS:

<LatLonBoundingBox minx="-8.6476" miny="49.8639" maxx="1.76943" maxy="60.8622" />
<BoundingBox SRS="EPSG:27700"
            minx="-77493.4" miny="-4039.86" maxx="670977" maxy="1.23824e+006" />
<BoundingBox SRS="EPSG:29902"
            minx="153489" miny="-154594" maxx="901891" maxy="1.10946e+006" />
<BoundingBox SRS="EPSG:3034"
            minx="2.71888e+006" miny="2.60232e+006" maxx="3.56176e+006" maxy="3.88362e+006" />
<BoundingBox SRS="EPSG:3413"
            minx="1.91073e+006" miny="-3.64649e+006" maxx="3.29885e+006" maxy="-2.20789e+006" />
<BoundingBox SRS="EPSG:3857"
            minx="-962646" miny="6.42274e+006" maxx="196972" maxy="8.59425e+006" />
<BoundingBox SRS="EPSG:4258"
            minx="-8.6476" miny="49.8639" maxx="1.76943" maxy="60.8622" />
<BoundingBox SRS="EPSG:4326"
            minx="-8.6476" miny="49.8639" maxx="1.76943" maxy="60.8622" />
<BoundingBox SRS="EPSG:900913"
            minx="-8.6476" miny="49.8639" maxx="1.76943" maxy="60.8622" />

There is something else odd in your example too, the order of the bounds for a LatLonBoundingBox MUST be minx="" miny="" maxx="" maxy="" but you have it the other way around.

<!-- The LatLonBoundingBox attributes indicate the edges of the enclosing
rectangle in latitude/longitude decimal degrees (as in SRS EPSG:4326 [WGS1984
lat/lon]). -->
<!ELEMENT LatLonBoundingBox EMPTY>
<!ATTLIST LatLonBoundingBox 
    minx CDATA #REQUIRED
    miny CDATA #REQUIRED
    maxx CDATA #REQUIRED
    maxy CDATA #REQUIRED>

The response from a WMS 1.3.0 GetCapabilities request (for the same area above) is as below, note we no longer have a LatLonBoundingBox element.

<EX_GeographicBoundingBox>
<westBoundLongitude>-8.6476</westBoundLongitude>
<eastBoundLongitude>1.76943</eastBoundLongitude>
<southBoundLatitude>49.8639</southBoundLatitude>
<northBoundLatitude>60.8622</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox CRS="EPSG:27700" minx="-77493.4" miny="-4039.86" maxx="670977" maxy="1.23824e+006"/>
<BoundingBox CRS="EPSG:29902" minx="153489" miny="-154594" maxx="901891" maxy="1.10946e+006"/>
<BoundingBox CRS="EPSG:3034" minx="2.60232e+006" miny="2.71888e+006" maxx="3.88362e+006" maxy="3.56176e+006"/>
<BoundingBox CRS="EPSG:3413" minx="1.91073e+006" miny="-3.64649e+006" maxx="3.29885e+006" maxy="-2.20789e+006"/>
<BoundingBox CRS="EPSG:3857" minx="-962646" miny="6.42274e+006" maxx="196972" maxy="8.59425e+006"/>
<BoundingBox CRS="EPSG:4258" minx="49.8639" miny="-8.6476" maxx="60.8622" maxy="1.76943"/>
<BoundingBox CRS="EPSG:4326" minx="49.8639" miny="-8.6476" maxx="60.8622" maxy="1.76943"/>
<BoundingBox CRS="EPSG:900913" minx="-8.6476" miny="49.8639" maxx="1.76943" maxy="60.8622"/>

It looks like your GetCapabilities request response is in error here, and that is the root of your problem.

As a hunch I would guess that this GetCapabilities response has been hand crafted, and whoever has created it has made some mistakes...

nmtoken
  • 13,355
  • 5
  • 38
  • 87
  • Hm, yeah I'm assuming that the response is wrong somehow then. Odd thing is that the BBOX parameter to get a tile does use the given coords in BoundingBox. From your answer I also take that if the response is correct, there's still no way to get the optimal or native resolution for the given layer right? – botteaap Apr 22 '14 at 15:35
  • There is no way to determine the native coordinate system from a GetCapabilities response; even if only one CRS/SRS is declared, there is no way of knowing whether the data is in that system or being reprojected by the service. – nmtoken Apr 23 '14 at 08:34