[geotk] CRS issue with WFS module

Stephane Fellah stephanef at imagemattersllc.com
Thu Oct 26 11:41:54 PDT 2017


Martin,

After further investigation of a integration problem with Geoserver WFS
using Geotoolkit 4.0.0 WFS module (for OGC Testbed 13), we have determined
that there is a bug in the Geotoolkit implementation.

The following WFS
http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?service=WFS&request=GetCapabilities
<http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?service=WFS&request=GetCapabilities>publishes
the following EPSG code  urn:ogc:def:crs:EPSG::4326. The client is able to
access the server and read the information from the feature types and
capabilities. However, when it comes to sending a GetFeature request to the
server, the CRS is truncated to EPSG:4326. The service does not return any
features.

http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?
> service=WFS&NAMESPACE=xmlns(daraa=http://daraa.cloudsdi.
> geo-solutions.it/)&FILTER=<?xml version="1.0" encoding="UTF-8"
> standalone="yes"?>
> <ogc:Filter xmlns:ns6="http://geotoolkit.org" xmlns:se="
> http://www.opengis.net/se" xmlns:ns8="http://www.opengis.net/gml/3.2"
> xmlns:gml="http://www.opengis.net/gml" xmlns:sld="http://www.opengis.
> net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="
> http://www.w3.org/1999/xlink">
>   <ogc:BBOX>
>     <ogc:PropertyName>the_geom</ogc:PropertyName>
>     <gml:Envelope srsName="*EPSG:4326*">
>       <gml:lowerCorner>33.017708886669986 36.201202221667494</gml:
> lowerCorner>
>       <gml:upperCorner>33.20039111333 36.2924977783325</gml:upperCorner>
>     </gml:Envelope>
>   </ogc:BBOX>
> </ogc:Filter>
> &PROPERTYNAME=the_geom&TYPENAME=daraa:daraa_worldview_timeseries_index&
> REQUEST=GETFEATURE&VERSION=1.1.0&SERVICE=WFS


*http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?service=WFS&NAMESPACE=xmlns%28daraa%3Dhttp%3A%2F%2Fdaraa.cloudsdi.geo-solutions.it%2F%29&FILTER=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22+standalone%3D%22yes%22%3F%3E%0A%3Cogc%3AFilter+xmlns%3Ans6%3D%22http%3A%2F%2Fgeotoolkit.org%22+xmlns%3Ase%3D%22http%3A%2F%2Fwww.opengis.net%2Fse%22+xmlns%3Ans8%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%2F3.2%22+xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%22+xmlns%3Asld%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%22+xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%22+xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A++%3Cogc%3ABBOX%3E%0A++++%3Cogc%3APropertyName%3Ethe_geom%3C%2Fogc%3APropertyName%3E%0A++++%3Cgml%3AEnvelope+srsName%3D%22EPSG%3A4326%22%3E%0A++++++%3Cgml%3AlowerCorner%3E33.017708886669986+36.201202221667494%3C%2Fgml%3AlowerCorner%3E%0A++++++%3Cgml%3AupperCorner%3E33.20039111333+36.2924977783325%3C%2Fgml%3AupperCorner%3E%0A++++%3C%2Fgml%3AEnvelope%3E%0A++%3C%2Fogc%3ABBOX%3E%0A%3C%2Fogc%3AFilter%3E%0A&PROPERTYNAME=the_geom&TYPENAME=daraa%3Adaraa_worldview_timeseries_index&REQUEST=GETFEATURE&VERSION=1.1.0&SERVICE=WFS
<http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?service=WFS&NAMESPACE=xmlns%28daraa%3Dhttp%3A%2F%2Fdaraa.cloudsdi.geo-solutions.it%2F%29&FILTER=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22+standalone%3D%22yes%22%3F%3E%0A%3Cogc%3AFilter+xmlns%3Ans6%3D%22http%3A%2F%2Fgeotoolkit.org%22+xmlns%3Ase%3D%22http%3A%2F%2Fwww.opengis.net%2Fse%22+xmlns%3Ans8%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%2F3.2%22+xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%22+xmlns%3Asld%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%22+xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%22+xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A++%3Cogc%3ABBOX%3E%0A++++%3Cogc%3APropertyName%3Ethe_geom%3C%2Fogc%3APropertyName%3E%0A++++%3Cgml%3AEnvelope+srsName%3D%22EPSG%3A4326%22%3E%0A++++++%3Cgml%3AlowerCorner%3E33.017708886669986+36.201202221667494%3C%2Fgml%3AlowerCorner%3E%0A++++++%3Cgml%3AupperCorner%3E33.20039111333+36.2924977783325%3C%2Fgml%3AupperCorner%3E%0A++++%3C%2Fgml%3AEnvelope%3E%0A++%3C%2Fogc%3ABBOX%3E%0A%3C%2Fogc%3AFilter%3E%0A&PROPERTYNAME=the_geom&TYPENAME=daraa%3Adaraa_worldview_timeseries_index&REQUEST=GETFEATURE&VERSION=1.1.0&SERVICE=WFS>*


I assume that the server does not honor this code because it expects the
URN. *I am  not sure whether the specification indicates that the previous
query is valid or not. If anyone can provide information about this, that
would be great.  *

The following request is working when I set the EPSG urn published in the
capabilities.

http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?
> service=WFS&NAMESPACE=xmlns(daraa=http://daraa.cloudsdi.
> geo-solutions.it/)&FILTER=<?xml version="1.0" encoding="UTF-8"
> standalone="yes"?>
> <ogc:Filter xmlns:ns6="http://geotoolkit.org" xmlns:se="
> http://www.opengis.net/se" xmlns:ns8="http://www.opengis.net/gml/3.2"
> xmlns:gml="http://www.opengis.net/gml" xmlns:sld="http://www.opengis.
> net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="
> http://www.w3.org/1999/xlink">
>   <ogc:BBOX>
>     <ogc:PropertyName>the_geom</ogc:PropertyName>
>     <gml:Envelope srsName="*urn:ogc:def:crs:EPSG::4326*">
>       <gml:lowerCorner>33.017708886669986 36.201202221667494</gml:
> lowerCorner>
>       <gml:upperCorner>33.20039111333 36.2924977783325</gml:upperCorner>
>     </gml:Envelope>
>   </ogc:BBOX>
> </ogc:Filter>
> &PROPERTYNAME=the_geom&TYPENAME=daraa:daraa_worldview_timeseries_index&
> REQUEST=GETFEATURE&VERSION=1.1.0&SERVICE=WFS


http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?
service=WFS&NAMESPACE=xmlns%28daraa%3Dhttp%3A%2F%2Fdaraa.
cloudsdi.geo-solutions.it%2F%29&FILTER=%3C%3Fxml%20version%
3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%
22yes%22%3F%3E%0A%3Cogc%3AFilter%20xmlns%3Ans6%3D%
22http%3A%2F%2Fgeotoolkit.org%22%20xmlns%3Ase%3D%22http%3A%
2F%2Fwww.opengis.net%2Fse%22%20xmlns%3Ans8%3D%22http%3A%2F%
2Fwww.opengis.net%2Fgml%2F3.2%22%20xmlns%3Agml%3D%22http%3A%
2F%2Fwww.opengis.net%2Fgml%22%20xmlns%3Asld%3D%22http%3A%2F%
2Fwww.opengis.net%2Fsld%22%20xmlns%3Aogc%3D%22http%3A%2F%
2Fwww.opengis.net%2Fogc%22%20xmlns%3Axlink%3D%22http%3A%
2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A%20%20%3Cogc%
3ABBOX%3E%0A%20%20%20%20%3Cogc%3APropertyName%3Ethe_
geom%3C%2Fogc%3APropertyName%3E%0A%20%20%20%20%3Cgml%
3AEnvelope%20srsName%3D%22urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%
3A4326%22%3E%0A%20%20%20%20%20%20%3Cgml%3AlowerCorner%
3E33.017708886669986%2036.201202221667494%3C%2Fgml%
3AlowerCorner%3E%0A%20%20%20%20%20%20%3Cgml%3AupperCorner%
3E33.20039111333%2036.2924977783325%3C%2Fgml%3AupperCorner%3E%0A%20%20%20%
20%3C%2Fgml%3AEnvelope%3E%0A%20%20%3C%2Fogc%3ABBOX%3E%0A%
3C%2Fogc%3AFilter%3E%0A&PROPERTYNAME=the_geom&TYPENAME=daraa%3Adaraa_
worldview_timeseries_index&REQUEST=GETFEATURE&VERSION=1.1.0&SERVICE=WFS


The code snippet that breaks is in the WFSFeatureStore.java  (line 138)

//extract the feature type -----------------------------------------
CoordinateReferenceSystem crs;
FeatureType sft;
try {
    String defaultCRS = ftt.getDefaultCRS();
    if(defaultCRS.contains("EPSG")){
        final int last = defaultCRS.lastIndexOf(':');
       * defaultCRS = "EPSG:"+defaultCRS.substring(last+1);*
    }
    crs = CRS.forCode(defaultCRS);
    if (getLongitudeFirst()) {
        crs = AbstractCRS.castOrCopy(crs).forConvention(AxesConvention.RIGHT_HANDED);
    }
    sft = requestType(typeName);
}


I am not sure how this issue can be fixed. Could you provide quickly a
patch to this error (for branch based on 4.0.0) ?


I appreciate your help. Hope we can successfull integrate after these
changes.

Regards

-- 
Stephane Fellah
Chief  Knowledge Scientist
Image Matters LLC
Office: +(703) 669 5510
Cell: 703 431 9420
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20171026/2148cb5f/attachment-0001.html>


More information about the Geotoolkit mailing list