[Geoserver-users] WFS 2.0 Joins

We are planning on upgrading from Geoserver 2.1 to 2.3 and are interested in the WFS 2.0 support. I've been trying to find docs on executing "standard joins" with Geoserver's implementation of WFS 2.0, but without luck.

Reading the WFS standard it seems there are two approaches to creating a join query using the POST and KVP methods. I've tried constructing requests using the OpenGeo geoserver site for testing:

POST data:

<?xml version="1.0"?>
<GetFeature
service="WFS"
version="2.0.0"
xmlns="http://www.opengis.net/wfs/2.0&quot;
xmlns:myns="http://www.someserver.com/myns&quot;
xmlns:fes="http://www.opengis.net/fes/2.0&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0.0/wfs.xsd&quot;&gt;
<wfs:Query typeNames="medford:libraries medford:schools">
<fes:Filter>
<fes:PropertyIsEqualTo>
<fes:ValueReference>medford:libraries/branchname</fes:ValueReference>
<fes:ValueReference>medford:schools/name</fes:ValueReference>
</fes:PropertyIsEqualTo>
</fes:Filter>
</wfs:Query>
</GetFeature>

wget -O- --post-file request.xml http://suite.opengeo.org/geoserver/wfs

returns:

<ows:ExceptionReport version="2.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://suite.opengeo.org/geoserver/schemas/ows/1.1.0/owsAll.xsd&quot;
  xmlns:ows="http://www.opengis.net/ows/1.1&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
  <ows:Exception exceptionCode="MissingParameterValue" locator="request">
    <ows:ExceptionText>Could not determine geoserver request from http request org.geoserver.monitor.MonitorServletRequest@anonymised.com</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

I'm not sure which parameter I'm missing. The HTTP post request looks correct...

Using KVP approach:

http://suite.opengeo.org/geoserver/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TypeNames=(medford:libraries,medford:schools)&FILTER=&lt;Filter&gt;&lt;PropertyIsEqualTo&gt;&lt;ValueReference&gt;medford:libraries/branchname&lt;/ValueReference&gt;&lt;ValueReference&gt;medford:schools/name&lt;/ValueReference&gt;&lt;/PropertyIsEqualTo&gt;&lt;/Filter&gt;

Only seems to return the medford:libraries featuretype members, rather than a tuple of the joined features..

If someone could help out I would be happy to contribute docs or testing to get this working.

Also because the WFS 2.0 client support is poor at the moment, it would be excellant if the KVP way of sending a request worked. Also using cql_filter approach would be the easiest for users.

Warm Regards,
Jeremy

This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@anonymised.com) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.

ping
________________________________________
From: Jeremy Palmer
Sent: Saturday, 17 August 2013 12:47 p.m.
To: geoserver-users@lists.sourceforge.net
Subject: WFS 2.0 Joins

We are planning on upgrading from Geoserver 2.1 to 2.3 and are interested in the WFS 2.0 support. I've been trying to find docs on executing "standard joins" with Geoserver's implementation of WFS 2.0, but without luck.

Reading the WFS standard it seems there are two approaches to creating a join query using the POST and KVP methods. I've tried constructing requests using the OpenGeo geoserver site for testing:

POST data:

<?xml version="1.0"?>
<GetFeature
service="WFS"
version="2.0.0"
xmlns="http://www.opengis.net/wfs/2.0&quot;
xmlns:myns="http://www.someserver.com/myns&quot;
xmlns:fes="http://www.opengis.net/fes/2.0&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0.0/wfs.xsd&quot;&gt;
<wfs:Query typeNames="medford:libraries medford:schools">
<fes:Filter>
<fes:PropertyIsEqualTo>
<fes:ValueReference>medford:libraries/branchname</fes:ValueReference>
<fes:ValueReference>medford:schools/name</fes:ValueReference>
</fes:PropertyIsEqualTo>
</fes:Filter>
</wfs:Query>
</GetFeature>

wget -O- --post-file request.xml http://suite.opengeo.org/geoserver/wfs

returns:

<ows:ExceptionReport version="2.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://suite.opengeo.org/geoserver/schemas/ows/1.1.0/owsAll.xsd&quot;
  xmlns:ows="http://www.opengis.net/ows/1.1&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
  <ows:Exception exceptionCode="MissingParameterValue" locator="request">
    <ows:ExceptionText>Could not determine geoserver request from http request org.geoserver.monitor.MonitorServletRequest@anonymised.com</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

I'm not sure which parameter I'm missing. The HTTP post request looks correct...

Using KVP approach:

http://suite.opengeo.org/geoserver/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TypeNames=(medford:libraries,medford:schools)&FILTER=&lt;Filter&gt;&lt;PropertyIsEqualTo&gt;&lt;ValueReference&gt;medford:libraries/branchname&lt;/ValueReference&gt;&lt;ValueReference&gt;medford:schools/name&lt;/ValueReference&gt;&lt;/PropertyIsEqualTo&gt;&lt;/Filter&gt;

Only seems to return the medford:libraries featuretype members, rather than a tuple of the joined features..

If someone could help out I would be happy to contribute docs or testing to get this working.

Also because the WFS 2.0 client support is poor at the moment, it would be excellant if the KVP way of sending a request worked. Also using cql_filter approach would be the easiest for users.

Warm Regards,
Jeremy

This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@anonymised.com) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.

Jeremy,

I can't get this to work either.

Justin, there is a unit test that covers this. I tried a request similar to the unit test against the latest master release configuration, using the demo page:

<?xml version="1.0"?>
<wfs:GetFeature
service="WFS"
version="2.0.0"
xmlns:wfs="http://www.opengis.net/wfs/2.0&quot;
xmlns:fes="http://www.opengis.net/fes/2.0&quot;
xmlns:topp="http://www.openplans.org/topp&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0.0/wfs.xsd&quot;&gt;
<wfs:Query typeNames="topp:tasmania_state_boundaries topp:tasmania_roads" aliases="a b">
<fes:Filter>
<fes:Intersects>
<fes:ValueReference>a/the_geom</fes:ValueReference>
<fes:ValueReference>b/the_geom</fes:ValueReference>
</fes:Intersects>
</fes:Filter>
</wfs:Query>
</wfs:GetFeature>

Only the state boundary feature is returned. No Tuple, as required by the spec. This functionality is tested by GetFeatureJoinTest, so I do not know what is wrong.

Kind regards,
Ben.

On 17/08/13 08:47, Jeremy Palmer wrote:

We are planning on upgrading from Geoserver 2.1 to 2.3 and are interested in the WFS 2.0 support. I've been trying to find docs on executing "standard joins" with Geoserver's implementation of WFS 2.0, but without luck.

Reading the WFS standard it seems there are two approaches to creating a join query using the POST and KVP methods. I've tried constructing requests using the OpenGeo geoserver site for testing:

POST data:

<?xml version="1.0"?>
<GetFeature
service="WFS"
version="2.0.0"
xmlns="http://www.opengis.net/wfs/2.0&quot;
xmlns:myns="http://www.someserver.com/myns&quot;
xmlns:fes="http://www.opengis.net/fes/2.0&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0.0/wfs.xsd&quot;&gt;
<wfs:Query typeNames="medford:libraries medford:schools">
<fes:Filter>
<fes:PropertyIsEqualTo>
<fes:ValueReference>medford:libraries/branchname</fes:ValueReference>
<fes:ValueReference>medford:schools/name</fes:ValueReference>
</fes:PropertyIsEqualTo>
</fes:Filter>
</wfs:Query>
</GetFeature>

wget -O- --post-file request.xml http://suite.opengeo.org/geoserver/wfs

returns:

<ows:ExceptionReport version="2.0.0"
   xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://suite.opengeo.org/geoserver/schemas/ows/1.1.0/owsAll.xsd&quot;
   xmlns:ows="http://www.opengis.net/ows/1.1&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   <ows:Exception exceptionCode="MissingParameterValue" locator="request">
     <ows:ExceptionText>Could not determine geoserver request from http request org.geoserver.monitor.MonitorServletRequest@anonymised.com</ows:ExceptionText>
   </ows:Exception>
</ows:ExceptionReport>

I'm not sure which parameter I'm missing. The HTTP post request looks correct...

Using KVP approach:

http://suite.opengeo.org/geoserver/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TypeNames=(medford:libraries,medford:schools)&FILTER=&lt;Filter&gt;&lt;PropertyIsEqualTo&gt;&lt;ValueReference&gt;medford:libraries/branchname&lt;/ValueReference&gt;&lt;ValueReference&gt;medford:schools/name&lt;/ValueReference&gt;&lt;/PropertyIsEqualTo&gt;&lt;/Filter&gt;

Only seems to return the medford:libraries featuretype members, rather than a tuple of the joined features..

If someone could help out I would be happy to contribute docs or testing to get this working.

Also because the WFS 2.0 client support is poor at the moment, it would be excellant if the KVP way of sending a request worked. Also using cql_filter approach would be the easiest for users.

Warm Regards,
Jeremy

This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@anonymised.com) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre