Thanks for the answers! I took a look at the documentation for cross-layer filtering, and it seems to do exactly what I want, so I'll try that for now 
Yes, the IntersectionFeatureCollection supports a mode where the entire geometry of one or other input is emitted as the result of the process. This is done by specifying parameter "intersectionMode" as either FIRST or SECOND. However, I think this will only produce the desired effect if the filter input has only a single feature in it (since the IntersectionFeatureCollection process is essentially producing the cross-product of both inputs, but filtered by whether they actually intersect).
This is somewhat cheesy and definitely non-standard, but perhaps cross-layer filtering could be used inside the WFS query to retrieve the desired filter feature?
http://docs.geoserver.org/stable/en/user/extensions/querylayer/index.html
To deal with this kind of problem cleanly what's needed is a SpatialFilter (or SpatialQuery) process which takes inputs of a source feature collection and a filter feature collection and outputs all source features which have a given spatial relationship to one or more of the filter features. For this problem the filter input feature would be provided by chaining either the Query process or a WFS query.
(It's tempting to extend the Query process itself to provide spatial filtering - and then we might as well throw in the Transform process functionality as well - and then what the heck, let's just write a SQL process and be done with it 8^)
On Fri, Dec 14, 2012 at 6:20 AM, Andrea Aime <andrea.aime@anonymised.com <mailto:andrea.aime@anonymised.com>> wrote:
On Fri, Dec 14, 2012 at 2:38 PM, Laure-Hélène Bruneton
<bruneton@anonymised.com <mailto:bruneton@anonymised.com>> wrote:
Hi all!
As I'm currently working with WPS, I'd like to know if it's
possible to
nest a WPS request inside a WFS GetFeature.
For instance, I want to collect the geometries of the layer
SECTION that
are not disjoint with a user defined geometry, I send this:
<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.opengis.net/wps/1.0.0"
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"
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"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ows:Identifier>gs:CollectGeometries</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>features</ows:Identifier>
<wps:Reference mimeType="text/xml;
subtype=wfs-collection/1.0"
xlink:href="http://geoserver/wfs" method="POST">
<wps:Body>
<wfs:GetFeature service="WFS" version="1.0.0"
outputFormat="GML2">
<wfs:Query typeName="SECTION">
<ogc:Filter>
<ogc:Not>
<ogc:Disjoint>
<ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:MultiPolygon xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"><gml:polygonMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>449798\.9199976616
6753837.949997303 449852.1799976621 6753837.029997302
449852.28999766207
6753827.339997302 449797.21999766154 6753827.669997303
449797.33999766153 6753837.979997302 449798.9199976616
6753837.949997303</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:polygonMember></gml:MultiPolygon>
</ogc:Disjoint>
</ogc:Not>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
</wps:Body>
</wps:Reference>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:RawDataOutput mimeType="text/xml; subtype=gml/3.1.1">
<ows:Identifier>result</ows:Identifier>
</wps:RawDataOutput>
</wps:ResponseForm>
</wps:Execute>
Now if I don't have the user defined geometry (here
gml:MultiPolygon),
is it to possible to replace it with a WPS or WFS query?
Not directly, WFS requests do not support retrieving some of the
filter data from external services.
There is a Query process, but the problem here is building the
filter dynamically... theoretically
that could be done by yet another process, a FilterTemplateProcess
maybe that
takes the definition of a filter with holes, and has other
parameters that are used to
fill those holes...
For this particular problem also have a look at the
IntersectionFeatureCollection,
it's slow but it might close enough to satisfy your needs (I kind
of remember it
having a mode where the geometries are not really intersected,
just tested
for intersection, but I may be wrong)
Cheers
Andrea
-- ==
Our support, Your Success! Visit http://opensdi.geo-solutions.it
for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313 <tel:%2B39%200584%20962313>
fax: +39 0584 1660272 <tel:%2B39%200584%201660272>
mob: +39 339 8844549 <tel:%2B39%20%C2%A0339%208844549>
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add
services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
<mailto:Geoserver-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Martin Davis
OpenGeo - http://opengeo.org/>
Expert service straight from the developers.
Aucun virus trouvé dans ce message.
Analyse effectuée par AVG - www.avg.fr <http://www.avg.fr>
Version: 2013.0.2805 / Base de données virale: 2637/5965 - Date: 16/12/2012