CRS problems with WMS: definitions, axis-order, GetMap-reqests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

CRS problems with WMS: definitions, axis-order, GetMap-reqests

Elias Wolf
Hello,

I've got a problem that is more like a general question regarding CRS's
of a WMS.
It involves CRS-definitions and axis-order of a WMS-GetMap-request of
different WMS versions (1.1.1 vs. 1.3.0)
But first things first:


========= 1. INITIAL SITUATION: =========
- I'm using deegree 3.3 to create a WMS
- The original datasource for the WMS consists of a raster file (EPSG:
25832; ETRS89 Zone 32)
- In the deegree-workspace-directory I created a "crs"-directory as
mentioned here:
http://wiki.deegree.org/deegreeWiki/deegree3/WorkspaceConfiguration/CRSConfiguration
- That "crs"-directory looks like this:

crs
  |
  |____ deegree ; user.xml
           |
           |____ d3
                    |
                    |____ config ; parser-files.xml
                             |
                             |____ crs-definitions.xml ;
datum-definitions.xml ; ellipsoid-definitions.xml ; ...


- The user.xml points to the parser-files.xml which again points to the
xml-files in the config-folder (i.e. crs-definitions.xml,...).
- The crs-definitions.xml defines all CRS's - amongst others, the
following two which define a WGS 84 CRS (No 1: only one crs:Id; No 2:
several crs:Ids):

1.1)
         <crs:GeographicCRS>
                 <crs:Id>epsg:4326</crs:Id>
                 <crs:Name>WGS 84</crs:Name>
<crs:Version>2008-1-16T9:49</crs:Version>
                 <crs:Description>Handmade proj4 geographic crs
definition (parsed from nad/epsg).</crs:Description>
<crs:AreaOfUse>-180.0,-90.0,180.0,90.0</crs:AreaOfUse>
                 <crs:AreaOfUse>World.</crs:AreaOfUse>
                 <crs:Axis>
                         <crs:Name>longitude</crs:Name>
                         <crs:Units>degree</crs:Units>
<crs:AxisOrientation>east</crs:AxisOrientation>
                 </crs:Axis>
                 <crs:Axis>
                         <crs:Name>latitude</crs:Name>
                         <crs:Units>degree</crs:Units>
<crs:AxisOrientation>north</crs:AxisOrientation>
                 </crs:Axis>
                 <crs:UsedDatum>epsg:6326</crs:UsedDatum>
         </crs:GeographicCRS>


1.2)
         <crs:GeographicCRS>
<crs:Id>http://www.opengis.net/gml/srs/epsg.xml#4326</crs:Id>
<crs:Id>urn:ogc:def:crs:epsg:4326</crs:Id>
<crs:Id>urn:ogc:def:crs:epsg::4326</crs:Id>
<crs:Id>urn:opengis:def:crs:epsg::4326</crs:Id>
<crs:Id>urn:x-ogc:def:crs:epsg:4326</crs:Id>
<crs:Id>urn:x-ogc:def:crs:epsg:6.11.2:4326</crs:Id>
<crs:Id>urn:x-ogc:def:crs:epsg:6.11:4326</crs:Id>
<crs:Id>urn:ogc:def:crs:EPSG:6.11.2:4326</crs:Id>
<crs:Id>urn:ogc:def:crs:EPSG:6.3:4326</crs:Id>
<crs:Id>urn:ogc:def:crs:EPSG:7.4:4326</crs:Id>
                 <crs:Name>WGS 84</crs:Name>
<crs:Version>2008-1-16T9:49</crs:Version>
                 <crs:Description>Handmade proj4 geographic crs
definition (parsed from nad/epsg).</crs:Description>
<crs:AreaOfUse>-180.0,-90.0,180.0,90.0</crs:AreaOfUse>
                 <crs:AreaOfUse>World.</crs:AreaOfUse>
                 <crs:Axis>
                         <crs:Name>latitude</crs:Name>
                         <crs:Units>degree</crs:Units>
<crs:AxisOrientation>north</crs:AxisOrientation>
                 </crs:Axis>
                 <crs:Axis>
                         <crs:Name>longitude</crs:Name>
                         <crs:Units>degree</crs:Units>
<crs:AxisOrientation>east</crs:AxisOrientation>
                 </crs:Axis>
                 <crs:UsedDatum>epsg:6326</crs:UsedDatum>
         </crs:GeographicCRS>
         <crs:GeographicCRS>


========= 2. EXAMPLES OF GetMap-REQUEST: =========
2.1) I am sending a GetMap-request with the following parameters which
returns a nice map as expected (note: version=1.1.1 and SRS-key):
         request=getmap
         service=wms
         version=1.1.1
         layers=Gelaendemodell
         SRS=EPSG:4326
         width=500
         height=500
         format=image/png
         styles=
         bbox=8.2662103,49.9819605,8.3074993,50.0138828

2.2) But as soon as I send this request with version=1.3.0 it just
returns a white map (probably because of the axis-order (lon/lat; XY;
East/North) within the bbox parameter)
     --> Note: version=1.3.0 and CRS-key:
         request=getmap
         service=wms
         version=1.3.0
         layers=Gelaendemodell
         CRS=EPSG:4326
         width=500
         height=500
         format=image/png
         styles=
         bbox=8.2662103,49.9819605,8.3074993,50.0138828

2.3) Howerver, when I send that last request with switched axis-order
("North, East" instead of "East, North"),
     it shows the expected part of the map, BUT it's rotated clockwise
by 90° and then mirrored vertically:
         request=getmap
         service=wms
         version=1.3.0
         layers=Gelaendemodell
         CRS=EPSG:4326
         width=500
         height=500
         format=image/png
         styles=
         bbox=49.9819605,8.2662103,50.0138828,8.3074993



========= 3. WHAT I THINK TO KNOW (SO FAR), AFTER SOME RESEARCH: =========
3.1) There is a thing called "axis-awareness"

     "A CRS identifier consists of an authority and a code. Due to
historical reasons, there are several ways to encode them.
     Here are some examples that all refer to the common CRS with code
4326 from EPSG (http://www.epsg-registry.org/):

     EPSG:4326
     http://www.opengis.net/gml/srs/epsg.xml#4326
     urn:ogc:def:crs:epsg::4326
     urn:x-ogc:def:crs:epsg:6.11.2:4326
     urn:ogc:def:crs:EPSG:7.4:4326

     NOTE: The CRS authority defines the parameters of the CRS,
including axis order.
     If the axes of a coordinate keep the official ordering of the
authorities' definition, this is also called axis-awareness.
     A lot of GIS software (e.g. PostGIS) is not axis-aware at all and
always uses XY ordering, regardless of the definition of the CRS."

     Source: https://github.com/deegree/deegree3/wiki/Axis-order-handling


3.2) There is a convention to associate axis-awareness with the way an
EPSG code is specified:
         - EPSG:4326 (not axis-aware, XY)
         - "urn:ogc:def:crs:epsg::4326" (axis-aware, YX, "modern")

3.3) While WMS's in version 1.1.1 always treat coordinates as
XY-ordered, WMS's in version 1.3.0 treat them axis-aware (depending on
CRS-specification).



========= 4. WHAT I DON'T UNDERSTAND / MY QUESTION: =========
Assuming that point 3.2 is correct, a GetMap-request with an SRS/CRS of
"EPSG:4326" should always expect the coordinates of the bbox in XY
(East, North) order,
no matter if it is a WMS v1.1.1 or v1.3.0.

4.1) Why is the XY-ordered request (2.2) not working?
     I thought that the way of providing the EPSG-code (EPSG:4326
instead of urn:ogc:def:crs:epsg::4326) would mean, that I always need to
provide the coordinates of the bbox in XY-axis-order.

4.2) Why is the response of the YX-ordered request (2.3) rotated/mirrored?

4.3) In this context: How are the different CRS's (from the
crs-definitions.xml) addressed? As you might have noticed already, the
first CRS-definition (1.1) has got XY-axis-order,
     while the second (1.2) has got YX-axis-order.

4.4) A general question about the <crs>-elements in the themes- and
layers-xml's of the deegree-workspace (see examples 4.2.1 and 4.2.2 below).
     What exactly is their function? I thought you could limit the CRS's
that are supported by the WMS.
     But when I send a GetMap-request with a CRS that's not listed in
the <crs>-element it still responds with a valid Map.
     And then I asked myself if there is a difference in the way how I
provide the CRS's in the themes- and layer-xml's.

     <s:CRS>EPSG:25832 EPSG:25833 EPSG:4326</s:CRS>
             vs.
     <s:CRS>urn:ogc:def:crs:epsg::25832 urn:ogc:def:crs:epsg::25833
urn:ogc:def:crs:epsg::4326</s:CRS>


     4.3.1) Example of themes-xml:

     <LayerStoreId>test</LayerStoreId>
     <Theme>
         <Identifier>Some Theme Name</Identifier>
         <d:Title>Some Title</d:Title>
         <d:Abstract>Some more infos about WMS.</d:Abstract>
         <d:Keywords>
             <d:Keyword>elevation</d:Keyword>
         </d:Keywords>
         <s:CRS>EPSG:25832 EPSG:25833 EPSG:4326</s:CRS>
         <Theme>
           <Identifier>elevationmodel</Identifier>
           <d:Title>elevationmodel</d:Title>
           <Layer>testinger</Layer>
         </Theme>
     </Theme>


     4.3.2) Example of layers-xml:

     <CoverageStoreId>test_cover</CoverageStoreId>
     <CoverageLayer>
         <l:Name>testinger</l:Name>
         <d:Title>test</d:Title>
         <s:CRS>EPSG:25832 EPSG:25833 EPSG:4326</s:CRS>
         <l:Dimension isElevation="true">
             <l:Source>ELEV</l:Source>
<l:DefaultValue>-32768.0/180/-32768.0</l:DefaultValue>
             <l:MultipleValues>true</l:MultipleValues>
             <l:NearestValue>true</l:NearestValue>
             <l:Units>m</l:Units>
             <l:Extent>-32768.0/180/0.01</l:Extent>
         </l:Dimension>
         <l:StyleRef>
             <l:StyleStoreId>test</l:StyleStoreId>
         </l:StyleRef>
     </CoverageLayer>


Sorry for this long post, but I think that the content might be
interesting for others, too.

I appreciate any help :-)

Thank you,
Elias

--
____________________
codematix GmbH
Felsbachstrasse 5/7
D-07745 Jena
Tel. +49 (3641) 3038-54
www.codematix.de
[hidden email]


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
deegree-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/deegree-users