If the DataStores behind the GeoServer WFS are abstracting SQL DBs (in the same
schema) I would use an SQL View [1] otherwise I would probably tackle this with
a WPS process. If you are looking to render the feature collection you could
tie the WPS process to WMS using SLD/Rendering-Transformations [2].
[1] http://docs.geoserver.org/stable/en/user/data/database/sqlview.html
[2]
http://docs.geoserver.org/stable/en/user/styling/sld-extensions/rendering-transform.html
Tom Kunicki
Software Engineer | Boundless
[email protected]
917-460-7212
@boundless
On Nov 19, 2013, at 12:34 PM, Jeffrey Wood <[email protected]> wrote:
> Hi,
>
> I am working on a WFS request where we want results like an outer join, that
> is, we want to get all features from one table even if they do not have a
> match in the other.
> Doing this with Ben Burns (also of Geocent) for one of our projects.
> I can see that outer joins are not supported currently, so I am working to
> investigate how we can achieve "outer join like" results without an outer
> join.
>
> Ideas:
> a. use an Or filter (credit to Ben for this idea) where the first filter will
> get the 'inner join' tuples and the second filter will get the 'outer only'
> tuples.
> Started investigating this, and currently not able to do a WFS join with an
> Or filter. (details below)
> Is it feasible for me to try to add the Or filter to WFS join and see if I
> can get it to succeed?
> Has the Or filter been tried before and it was not able to be implemented?
>
> b. Possibly create a View with an outer join within it and then have
> GeoServer reference the View instead.
> I have not investigated this yet, I think it may have been considered already
> though and may not be possible in our situation.
>
> c. Are there other existing ideas to get "outer join like" results without an
> outer join?
>
> Any background info from GeoServer developers would be appreciated.
>
> Thank you for your time!
> Jeff
>
> ====== begin - details on the Or filter attempt ======
>
> Here is an example i tried that fails with an Or and succeeds when I replace
> the Or with And:
>
> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0"
> xmlns:fes="http://www.opengis.net/fes/2.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> service="WFS" version="2.0.0"
> xsi:schemaLocation="http://www.opengis.net/wfs/2.0
> http://schemas.opengis.net/wfs/2.0/wfs.xsd">
> <wfs:Query typeNames="geotoolsOnlineTests:ftjoin geotoolsOnlineTests:ft1"
> aliases="ftjoin ft1">
> <fes:Filter>
> <fes:Or>
> <fes:PropertyIsEqualTo>
> <fes:ValueReference>ftjoin/name</fes:ValueReference>
> <fes:ValueReference>ft1/stringProperty</fes:ValueReference>
> </fes:PropertyIsEqualTo>
> <fes:PropertyIsEqualTo>
> <fes:ValueReference>ft1/id</fes:ValueReference>
> <fes:ValueReference>ft1/id</fes:ValueReference>
> </fes:PropertyIsEqualTo>
> </fes:Or>
> </fes:Filter>
> </wfs:Query>
> </wfs:GetFeature>
>
> I see that the wfs/GetFeature.java class disallows the Or filter, and also
> the Not filter, for joins.
> From wfs/GetFeature.java class, line 161:
> //we only support simple filters, and any of them And'ed together.
> joinFilterCapabilities.addType(And.class);
>
> ===== end - details on the Or filter attempt =====
>
> Other tidbits:
> I did some looking around on GeoServer and GeoTools mail archives for
> background info re: joins and I saw this user report of not being able to use
> the Or filter:
> http://osgeo-org.1560.x6.nabble.com/WFS-2-0-join-OR-problem-td5019289.html
>
> The relevant specs that describe only inner joins:
> OpenGIS Web Feature Service 2.0 Interface Standard section 7.9.2.5.3.1 Join
> queries
> OpenGIS Filter Encoding 2.0 Encoding Standard, section 6.3.3.1.5 Join queries
>
>
>
> Thank you,
>
> Jeffrey Wood
> Software Engineer
> Geocent
>
> Email: [email protected]
> Ph (BR): 225-214-4346
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk_______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel