Menu

#9 WFS test assertion misunderstanding

open
nobody
None
5
2012-10-17
2010-01-28
No

Hello all,

Some of the WFS CITE tests fail for us but we believe the tests
themselves to be in error due to either incorrect construction or to
inaccurate handling of coordinate system axis order.

For example, the WFS test 209.1 makes a request based on the OGC defined
URN "urn:ogc:def:crs:epsg:4326" but seems to make its test comparison
based on the CRS identifier "EPSG:4326". The comparison itself seems to
match the test assertion so perhaps the CITE test's request has not been
built correctly to match the test assertion or perhaps there is an issue
with the axis order handling in the test comparision. We include our
analysis below.

Hopefully someone can clarify the situation,

thanks,
The Geomatys Team.

CITE tests rely on the PostGIS "spatial_ref_sys" table for their
coordinate system definitions. PostGIS offers all values and CRS
definitions in the (longitude,latitude) order as we can see when it
extracts a CRS definition in either Proj4 format or in WKT.

    Proj4 syntax: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

    Note that in Proj4, axis order is always (longitude,latitude).


    WKT sytntax:
    GEOGCS["WGS 84",
    DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

    Note that there is no AXIS element. For WKT, according OGC 01-009 section
    7.3.2, "If the optional AXIS terms are not present, then the default
    values are assumed. They are Geographic Coordinate Systems:
    AXIS[“Lon”,EAST],AXIS[“Lat”,NORTH]".

All tests which perform requests using the OGC defined URN
"urn:ogc:def:crs:epsg:4326" should expect the (latitude,longitude) axis
order since the OGC "urn" syntax requires that the axis order be "as the
authority defines it", which is (latitude, longitude) for the OGC. Note
that this is different from the identifier "EPSG:4326", which, as we all
know, has many different interpretations for axis order. Therefore, when
the WFS CITE tests in the 'POST-Spatial-ops' section, numbers 201 to 210
use the "urn:ogc:def:crs:epsg:4326" CRS, they must make their spatial
comparisons in the (latitude, longitude) order.

The test number 209.1 illustrates the problem easily.

0) The test asserts:
Assertion: The response to a GetFeature request that specifies
the default EPSG:4326 CRS should return coordinates that exactly
match
the original test data coordinates.

1) The test requests a feature in the envelope:
<gml:envelope srsname="urn:ogc:def:crs:epsg:7.4:4326">
<gml:lowercorner>-10.52 34.94</gml:lowercorner>
<gml:uppercorner>-10.52 34.94</gml:uppercorner>
</gml:envelope>
which must be interpreted at 10.52 degrees south of the equator, 34.94
degrees east of the WGS84 Greenwich meridian, as per the OGC URN
definition. Note that this is a slightly different request from that
specified in the test's assertion.

2) When we return a point with the same position:
<gml:point srsname="urn:ogc:def:crs:epsg:7.4:4326">
<gml:pos>-10.52 34.94</gml:pos>
</gml:point>

3) The test fails with the assertion
FAILURE: Expected gml:pos of "34.94 -10.52" (found: -10.52
34.94).

Something is happening differently from what we expect.

Recap of our understanding:

The test is set up by inserting a point into the PostGIS database:

    File "dataset-sf0_postgis.sql" at line 31 declares:

    INSERT INTO "PrimitiveGeoFeature" VALUES (NULL, 'name-f015',
    NULL,
    geometryfromtext('POINT(34.94 -10.52)',4326), NULL, -900, NULL,
    2.4,
    NULL, NULL, 7.90, 'f015');

In geometryfromtext(..., 4326), the SRID 4326 refers to the
"spatial_ref_sys" table, which declares (longitude,latitude) axis order.
Consequently in the POINT(34.94 -10.52), 34.94 is the longitude and
-10.52 is the latitude.

The test is performed using the "urn:ogc:def:crs:epsg:4326"
CRS, which should require the point returned by the server to use
(latitude,longitude) axis order, which gives (-10.52, 34.94).

Our server correctly responds to the request but the test comparison
produces a failure.

CITE test output:

Test wfs:wfs-1.1.0-Basic-GetFeature-tc209.1

Assertion: The response to a GetFeature request that specifies the default
EPSG:4326 CRS should return coordinates that exactly match
the original test data coordinates.

Request d1e12307_1:
Method: POST
URL: http://demo.geomatys.com/cstl-trunk/WS/wfs?
Body: <wfs:getfeature xmlns="http://www.occamlab.com/ctl" xmlns:ctl="http://www.occamlab.com/ctl" xmlns:gml="http://www.opengis.net/gml" xmlns:myparsers="http://teamengine.sourceforge.net/parsers" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:p="http://teamengine.sourceforge.net/parsers" xmlns:parsers="http://www.occamlab.com/te/parsers" xmlns:saxon="http://saxon.sf.net/" xmlns:sf="http://cite.opengeospatial.org/gmlsf" xmlns:te="http://www.occamlab.com/te" xmlns:tec="java:com.occamlab.te.TECore" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WFS" version="1.1.0">
<wfs:query srsname="urn:x-ogc:def:crs:epsg:4326" typename="sf:PrimitiveGeoFeature">
<ogc:filter>
<ogc:propertyisequalto>
<ogc:propertyname>gml:name</ogc:propertyname>
<ogc:literal>name-f015</ogc:literal>
</ogc:propertyisequalto>
</ogc:filter>
</wfs:query>
</wfs:getfeature>

Response from parser p:XMLValidatingParser.GMLSF1:
<wfs:featurecollection xmlns:gml="http://www.opengis.net/gml" xmlns:ns0="http://cite.opengeospatial.org/gmlsf" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gml:id="id" xsi:schemalocation="http://cite.opengeospatial.org/gmlsf &lt;a href=" http:="" demo.geomatys.com="" cstl-trunk="" ws="" wfs?request="DescribeFeatureType&amp;version=1.1.0&amp;service=WFS&amp;namespace=xmlns"">http://demo.geomatys.com/cstl-trunk/WS/wfs?request=DescribeFeatureType\&version=1.1.0\&service=WFS\&namespace=xmlns(sf=http://cite.opengeospatial.org/gmlsf)&Typename=sf:PrimitiveGeoFeature">
<gml:boundedby>
<gml:envelope srsname="urn:ogc:def:crs:epsg:7.4:4326">
<gml:lowercorner>-10.52 34.94</gml:lowercorner>
<gml:uppercorner>-10.52 34.94</gml:uppercorner>
</gml:envelope>
</gml:boundedby>
<gml:featuremember>
<ns0:primitivegeofeature gml:id="PrimitiveGeoFeature.f015">
<gml:name>name-f015</gml:name>
<ns0:pointproperty>
<gml:point srsname="urn:ogc:def:crs:epsg:7.4:4326">
<gml:pos>-10.52 34.94</gml:pos>
</gml:point>
</ns0:pointproperty>
<ns0:intproperty>-900</ns0:intproperty>
<ns0:measurand>2.4</ns0:measurand>
<ns0:decimalproperty>7.9</ns0:decimalproperty>
</ns0:primitivegeofeature>
</gml:featuremember>
</wfs:featurecollection>

Message d1e12371_1:
FAILURE: Expected gml:pos of "34.94 -10.52" (found: -10.52 34.94).

Discussion


Log in to post a comment.

MongoDB Logo MongoDB