WPS with GML 3.2 data from WFS 2.0 services

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

WPS with GML 3.2 data from WFS 2.0 services

rususorinvick
I have been trying out several solutions to try to process GML 3.2 geometry served through a WFS 2.0 data services. There seems to be very little experience and software out there that manages to handle complex feature types and GML3.2 geometries.

One of the more promissing solutions is in my opinion provided by 52 north's WPS package, it is supposed to fully support GML2.1 > GML3.2 and also has many many processes provided as plugins leveraging libraries like GRASS, sextante etc.

I have installed the latest version, on a Windows Server 2012 R2, running Java 8 with Tomcat 8. Unfortunately the built in demos using GML geometries doesn't work. While trying to POST a processing request, for example unsing one of my GML 3.2 geometries I get the following error:

org.xml.sax.SAXException: Handler for gml:MultiSurface could not be found.

I am using the Open HTTP requester plugin from Firefox to submit this reqeust, sending the request as application/xml. This is the body of the request I am sending:

<Execute service="WPS" version="1.0.0" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:ns="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"xmlns:au="http://inspire.ec.europa.eu/schemas/au/4.0"xmlns:br="http://inspire.ec.europa.eu/schemas/br/4.0"xmlns:ps="http://inspire.ec.europa.eu/schemas/ps/4.0"xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0"xmlns:gco="http://www.isotc211.org/2005/gco"xmlns:gmd="http://www.isotc211.org/2005/gmd"xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml/3.2"xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink"xmlns:it.geosolutions="http://www.geo-solutions.it" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd http://inspire.ec.europa.eu/schemas/au/4.0 http://inspire.ec.europa.eu/schemas/au/4.0/AdministrativeUnits.xsd http://www.opengis.net/gml/3.2 http://inspire.biodiversity.ro:80/geoserver/schemas/gml/3.2.1/gml.xsd http://www.opengis.net/wfs/2.0 http://inspire.biodiversity.ro:80/geoserver/schemas/wfs/2.0/wfs.xsd">
 <ns:Identifier>org.n52.wps.server.algorithm.intersection.IntersectionAlgorithm</ns:Identifier>
  <DataInputs>
    <Input>
      <ns:Identifier>Polygon1</ns:Identifier>
      <Reference mimeType="text/xml; subtype=gml/3.2.1" xlink:href="http://inspire.biodiversity.ro/geoserver/ows?service=wfs&amp;version=2.0.0&amp;request=getfeature&amp;typename=au:AdministrativeUnit&amp;featureID=BC"/>
    </Input>
    <Input>
      <ns:Identifier>Polygon2</ns:Identifier>
      <Reference mimeType="text/xml; subtype=gml/3.2.1" xlink:href="http://inspire.biodiversity.ro/geoserver/ows?service=wfs&amp;version=2.0.0&amp;request=getfeature&amp;typename=au:AdministrativeUnit&amp;featureID=EPT"/>
    </Input>
  </DataInputs>
  <ResponseForm>
    <ResponseDocument>
      <Output mimeType="text/xml">
        <ns2:Identifier xmlns:ns1="http://www.opengis.net/ows/1.1" xmlns:ns="http://www.opengis.net/wps/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://www.opengis.net/ows/1.1">intersection_result</ns2:Identifier>
      </Output>
    </ResponseDocument>
  </ResponseForm>
</Execute>

Any ideas?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

BenjaminPross
Hi,

I will look into this.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

rususorinvick
Thanks Ben. I have also downloaded the OSGEO Live VM and I am also trying in paralel to create some requests there...maybe there is a problem with the Windows environment setup.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

rususorinvick
I also see that in the GeoTools package, the GML 3.2 Basic Parser, has incorrect deffinitions for the feature.xsd

By default it is http://schemas.opengis.net/gml/3.2.1/base/feature.xsd but this link is incorrect, it doesn't resolve. I believe this should be http://schemas.opengis.net/gml/3.2.1/feature.xsd, correct?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

BenjaminPross
Thats correct, we should fix that. I made some modifications to the GML32Parser and now at least it seems to parse the GML. I updated our demo WPS instance:

http://geoprocessing.demo.52north.org:8080/latest-wps

Feel free to play around with it. The GeoServer http://inspire.biodiversity.ro/geoserver seems to have an issue right now serving the features, so you might want to contact the admin first.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

rususorinvick
Hi Ben, the WPS finally works.
I was successfully managed to feed 2 GML 3.2 geometries into the Intersection Algorithm and get a correct geometrical output. Could you tell me what you modified on your demo environment so that I might try to replicate it on my machine? Or will you release a new/patched version of the WPS server for people to download to and use?

This is the query I ran on your demo site:http://geoprocessing.demo.52north.org:8080/latest-wps/test.html 

<Execute service="WPS" version="1.0.0"
xmlns="http://www.opengis.net/wps/1.0.0"
xmlns:ns="http://www.opengis.net/ows/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"
xmlns:au="http://inspire.ec.europa.eu/schemas/au/4.0"
xmlns:br="http://inspire.ec.europa.eu/schemas/br/4.0"
xmlns:ps="http://inspire.ec.europa.eu/schemas/ps/4.0"
xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:wps="http://www.opengis.net/wps/1.0.0"
xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:wcs="http://www.opengis.net/wcs/1.1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:it.geosolutions="http://www.geo-solutions.it"
xsi:schemaLocation="
http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd
http://inspire.ec.europa.eu/schemas/au/4.0 http://inspire.ec.europa.eu/schemas/au/4.0/AdministrativeUnits.xsd
http://www.opengis.net/gml/3.2
http://inspire.biodiversity.ro:80/geoserver/schemas/gml/3.2.1/gml.xsd
http://www.opengis.net/wfs/2.0
http://inspire.biodiversity.ro:80/geoserver/schemas/wfs/2.0/wfs.xsd"
>  <ns:Identifier>org.n52.wps.server.algorithm.intersection.IntersectionAlgorithm</ns:Identifier>
  <DataInputs>
    <Input>
      <ns:Identifier>Polygon1</ns:Identifier>
      <Reference mimeType="text/xml; subtype=gml/3.2.1" xlink:href="http://inspire.biodiversity.ro/geoserver/ows?service=wfs&amp;version=2.0.0&amp;request=getfeature&amp;typename=au:AdministrativeUnit&amp;featureID=D65"/>
    </Input>
    <Input>
      <ns:Identifier>Polygon2</ns:Identifier>
      <Reference mimeType="text/xml; subtype=gml/3.2.1" xlink:href="http://inspire.biodiversity.ro/geoserver/ows?service=wfs&amp;version=2.0.0&amp;request=getfeature&amp;typename=ps:ProtectedSite&amp;featureID=ROSCI0135"/>
    </Input>
  </DataInputs>
  <ResponseForm>
    <ResponseDocument>
      <Output mimeType="text/xml; subtype=gml/3.2.1">
        <ns2:Identifier xmlns:ns1="http://www.opengis.net/ows/1.1" xmlns:ns="http://www.opengis.net/wps/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://www.opengis.net/ows/1.1">intersection_result</ns2:Identifier>
      </Output>
    </ResponseDocument>
  </ResponseForm>
</Execute>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

rususorinvick
In reply to this post by BenjaminPross
I have also seen that the Intersection algorithm declares the GML output's geometry as EPSG:4326 (Lat/Long), instead of the declared EPSG:3035 from the two data endpoints. Is there a way to tell the process what the output geometry's SRS code is?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

BenjaminPross
If the modifications work for you, I will include them in the next patch release. We can do that very soon, let me just look into the SRS stuff you were describing. If needed in the meantime, I could also provide you with the modification directly.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

rususorinvick
Hi Ben,

That is very generous and I would galdly like to know the configurations necessary to make it work.
Regarding encoding the SRSNAME I think I found the reason for this: if the GML 3.2 doesn't provide the boundingBox, the process aparently falls back to the default 4326 Lat/Long.

If the boundingBox is provided, (I have since done this on the geoserver), the EPSG code is correctly recognized, however it is still encoded bad. Instead of srsName="http://www.opengis.net/gml/srs/epsg.xml#3035" GML3.2 requires EPSG codes to be encoded like srsName="urn:ogc:def:crs:EPSG::3035"

Also I am spreading the good news about this server to the INSPIRE forums, people need to know 52North WPS can use GML 3.2 (so very few WPS Servers manage to do this).

https://themes.jrc.ec.europa.eu/discussion/view/97342/good-news-wps-service-that-accepts-wfs20-gml32-data 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WPS with GML 3.2 data from WFS 2.0 services

BenjaminPross
Ok, you will need to replace the 52n-wps-io-geotools-3.5.0.jar in the WEB-INF/lib folder of your WPS with the following:

https://52north.org/delivery/support/52n-wps-io-geotools-3.5.1-SNAPSHOT.jar

Then you will have to add two properties to the GML32BasicParser in the config/wps_config_geotools.xml:

<Parser name="GML32BasicParser"
    className="org.n52.wps.io.datahandler.parser.GML32BasicParser" active="true">
    <Property name="setParserNonStrict" active="true">true</Property>
    <Property name="setBasicGMLConfiguration" active="true">true</Property>
    ...
</Parser>

Regarding the SRS encoding: I think this can be modified. I will have to experiment a bit.

Cheers,

Benjamin
Loading...