[Geoserver-devel] WFS 2.0 Stored Query data store

Hi,

I’ve been contracted by the Finnish Meteorological Institute to write a cascaded WFS 2.0 data store for GeoServer. My background is deep in software development, working mainly on networked systems using Java. I have previous experience with GeoServer (a few bug fixes, a proprietary dispatcher implementation, server setup & maintenance) and I also have experience with WFS. Latter part comes from Spatineo, where I’ve implemented the backend for our WFS monitoring.

The actual use case we’re solving is visualizing data supplied by a separate WFS 2.0 server. The visualization will be done using GeoServer’s WMS facilities. We need 2.0 support because the backend WFS server offers the data as stored queries. This is where our efforts will be focused on: Stored Queries returning responses in Simple Features Profile.

One of the goals of this project is to create an implementation which has enough general appeal to be accepted into the official builds of GeoServer, or perhaps as one extension in the official collection.

I would love to get some feedback on this project. Especially regarding what requirements the GeoServer developer community has for this work to get accepted into official releases. Also any ideas on how to approach this task are gladly accepted.

I’ve identified the following places that I need to work on:

Geotools needs a WFS 2.0 module (https://github.com/geotools/geotools/tree/master/modules/unsupported/wfs)

GeoServer needs relevant configuration and possibly UI elements to set up cascading WFS 2.0 data stores and creating layers from those datasources.

To support parameters for the stored queries, the WMS dimensions need to be leveraged to pass on any dimension values to the WFS 2.0 data store.

I will initially be writing on this on top of 2.5.x, as that is the expected version the first production system will run.

Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Well this is very exciting to have someone look at making a WFS 2.0 client :slight_smile: And thanks for checking with the community to determine scope. We find the occasional project which gets as far as making a pull request, but did not leave enough budget for test coverage and documentation.

For guidelines for including your work in a GeoServer release you can check the developers guide about policies and procedures.

However in this case the work looks to be making a GeoTools WFS 2 DataStore, so you will want to review the GeoTools developers guide.

The guidelines for both projects are similar - IP check, test case coverage and user docs :slight_smile:

···

Jody Garnett

On Fri, Mar 14, 2014 at 9:49 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

I’ve been contracted by the Finnish Meteorological Institute to write a cascaded WFS 2.0 data store for GeoServer. My background is deep in software development, working mainly on networked systems using Java. I have previous experience with GeoServer (a few bug fixes, a proprietary dispatcher implementation, server setup & maintenance) and I also have experience with WFS. Latter part comes from Spatineo, where I’ve implemented the backend for our WFS monitoring.

The actual use case we’re solving is visualizing data supplied by a separate WFS 2.0 server. The visualization will be done using GeoServer’s WMS facilities. We need 2.0 support because the backend WFS server offers the data as stored queries. This is where our efforts will be focused on: Stored Queries returning responses in Simple Features Profile.

One of the goals of this project is to create an implementation which has enough general appeal to be accepted into the official builds of GeoServer, or perhaps as one extension in the official collection.

I would love to get some feedback on this project. Especially regarding what requirements the GeoServer developer community has for this work to get accepted into official releases. Also any ideas on how to approach this task are gladly accepted.

I’ve identified the following places that I need to work on:

Geotools needs a WFS 2.0 module (https://github.com/geotools/geotools/tree/master/modules/unsupported/wfs)

GeoServer needs relevant configuration and possibly UI elements to set up cascading WFS 2.0 data stores and creating layers from those datasources.

To support parameters for the stored queries, the WMS dimensions need to be leveraged to pass on any dimension values to the WFS 2.0 data store.

I will initially be writing on this on top of 2.5.x, as that is the expected version the first production system will run.

Sampo

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Fri, Mar 14, 2014 at 11:49 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi,

I've been contracted by the Finnish Meteorological Institute to write a
cascaded WFS 2.0 data store for GeoServer. My background is deep in
software development, working mainly on networked systems using Java. I
have previous experience with GeoServer (a few bug fixes, a proprietary
dispatcher implementation, server setup & maintenance) and I also have
experience with WFS. Latter part comes from Spatineo, where I've
implemented the backend for our WFS monitoring.

The actual use case we're solving is visualizing data supplied by a
separate WFS 2.0 server. The visualization will be done using GeoServer's
WMS facilities. We need 2.0 support because the backend WFS server offers
the data as stored queries. This is where our efforts will be focused on:
Stored Queries returning responses in Simple Features Profile.

Ok, so your focus will be strictly to write one store that, while using the
WFS 2.0 protocol, is not a general one, but one specifically targeted to
stored queries?

One of the goals of this project is to create an implementation which has
enough general appeal to be accepted into the official builds of GeoServer,
or perhaps as one extension in the official collection.

If the work extends the existing WFS store it would become part of the
GeoServer distribution automatically, but to go there, it would have to be
a generic WFS client, not one specific
to stored queries.
If it's a stored query specific one, it will probably be up to you to
become its long term maintainer in order to raise it to extension status
(which, indeed, requires a long term
maintainer, along with other requirements such as tests, docs, ip checks
and at least 3 users)

I would love to get some feedback on this project. Especially regarding
what requirements the GeoServer developer community has for this work to
get accepted into official releases. Also any ideas on how to approach this
task are gladly accepted.

I've identified the following places that I need to work on:

Geotools needs a WFS 2.0 module (
https://github.com/geotools/geotools/tree/master/modules/unsupported/wfs)

Yes, that module is a generic WFS clients, the WFS 1.0 portion does
read/write, the WFS 1.1 portion is read only.

GeoServer needs relevant configuration and possibly UI elements to set up
cascading WFS 2.0 data stores and creating layers from those datasources.

If the client is generic all that is needed are the connection parameters
in the factory, but if you need to setup the configuration
for the stored queries, indeed a custom panel will be required.

To support parameters for the stored queries, the WMS dimensions need to
be leveraged to pass on any dimension values to the WFS 2.0 data store.

Ah, those go down as filters... and I guess this might be a problem? With
stored queries you are pretty much stuck with whatever
is in the query template, cannot pass more filters down (and you need to
understand how the generic filter GeoServer will give you
is mapped in the stored query, which means, understanding the stored query
itself...). Any other filter will have to be run client side
(which is of course inefficient...)

I will initially be writing on this on top of 2.5.x, as that is the
expected version the first production system will run.

New features have to go to master first, so make sure your pull requests
target that branch, even if you're developing
against another one

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi Andrea & Jody,

Thanks for your comments. My next steps are to dive through all the relevant parts of the Geotools / GeoServer code base and figure out a more detailed plan for the work. At which point would you like to see a GSIP?

Regarding targeting only stored queries: Stored query support is vital for the use case at FMI, so that’s the minimum level we need to target. That means that I will work on the full WFS 2.0 client only after we’ve satisfied the demands for the use case at hand. But knowing that this is a key limiting factor to having this work included in mainline GeoServer is very important for us. Thanks for the heads up Andrea! We will definitely raise the priority of a more complete WFS 2.0 client support.

How complete the WFS 2.0 client would need to be to be “automatically” included? Is read-only sufficient? As we’re not doing anything related to transactional requests, fitting transactional client support would be stretching the budget, time frame and scope.

Sampo

···

On Fri, Mar 14, 2014 at 3:24 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Fri, Mar 14, 2014 at 11:49 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

I’ve been contracted by the Finnish Meteorological Institute to write a cascaded WFS 2.0 data store for GeoServer. My background is deep in software development, working mainly on networked systems using Java. I have previous experience with GeoServer (a few bug fixes, a proprietary dispatcher implementation, server setup & maintenance) and I also have experience with WFS. Latter part comes from Spatineo, where I’ve implemented the backend for our WFS monitoring.

The actual use case we’re solving is visualizing data supplied by a separate WFS 2.0 server. The visualization will be done using GeoServer’s WMS facilities. We need 2.0 support because the backend WFS server offers the data as stored queries. This is where our efforts will be focused on: Stored Queries returning responses in Simple Features Profile.

Ok, so your focus will be strictly to write one store that, while using the WFS 2.0 protocol, is not a general one, but one specifically targeted to stored queries?

One of the goals of this project is to create an implementation which has enough general appeal to be accepted into the official builds of GeoServer, or perhaps as one extension in the official collection.

If the work extends the existing WFS store it would become part of the GeoServer distribution automatically, but to go there, it would have to be a generic WFS client, not one specific
to stored queries.
If it’s a stored query specific one, it will probably be up to you to become its long term maintainer in order to raise it to extension status (which, indeed, requires a long term
maintainer, along with other requirements such as tests, docs, ip checks and at least 3 users)

I would love to get some feedback on this project. Especially regarding what requirements the GeoServer developer community has for this work to get accepted into official releases. Also any ideas on how to approach this task are gladly accepted.

I’ve identified the following places that I need to work on:

Geotools needs a WFS 2.0 module (https://github.com/geotools/geotools/tree/master/modules/unsupported/wfs)

Yes, that module is a generic WFS clients, the WFS 1.0 portion does read/write, the WFS 1.1 portion is read only.

GeoServer needs relevant configuration and possibly UI elements to set up cascading WFS 2.0 data stores and creating layers from those datasources.

If the client is generic all that is needed are the connection parameters in the factory, but if you need to setup the configuration
for the stored queries, indeed a custom panel will be required.

To support parameters for the stored queries, the WMS dimensions need to be leveraged to pass on any dimension values to the WFS 2.0 data store.

Ah, those go down as filters… and I guess this might be a problem? With stored queries you are pretty much stuck with whatever
is in the query template, cannot pass more filters down (and you need to understand how the generic filter GeoServer will give you
is mapped in the stored query, which means, understanding the stored query itself…). Any other filter will have to be run client side
(which is of course inefficient…)

I will initially be writing on this on top of 2.5.x, as that is the expected version the first production system will run.

New features have to go to master first, so make sure your pull requests target that branch, even if you’re developing
against another one

Cheers
Andrea

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Fri, Mar 14, 2014 at 3:28 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi Andrea & Jody,

Thanks for your comments. My next steps are to dive through all the
relevant parts of the Geotools / GeoServer code base and figure out a more
detailed plan for the work. At which point would you like to see a GSIP?

When you have a clear idea of what you'll be working on, so that the
difference between the
plan to be voted, and the code you're going to write, it's going to be
minimal (significant deviations
in the code would require the GSIP to be re-discussed and voted again).

Regarding targeting only stored queries: Stored query support is vital for
the use case at FMI, so that's the minimum level we need to target. That
means that I will work on the full WFS 2.0 client only after we've
satisfied the demands for the use case at hand. But knowing that this is a
key limiting factor to having this work included in mainline GeoServer is
very important for us. Thanks for the heads up Andrea! We will definitely
raise the priority of a more complete WFS 2.0 client support.

How complete the WFS 2.0 client would need to be to be "automatically"
included? Is read-only sufficient? As we're not doing anything related to
transactional requests, fitting transactional client support would be
stretching the budget, time frame and scope.

Given that WFS 1.1 client in the unsupported wfs module is ready only
already, a WFS 2.0 read only client would fit the bill imho,
not sure what other devs think.

Mind one detail, the existing WFS client has been in unsupported land for a
while, and we all know it needs a rewrite (an attempt
has been made, but it was aborted rather soon), but we lack the funding to
do that.
However, if any supporting company manages to get the funds for it, the
client will likely be rewritten from scratch.
I can't tell you if and when that will happen, but it's a possibility...
hopefully that does not happen while you're working
on the WFS 2.0 protocol support... what is your time frame?

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi,

So I guess the GSIP should be written after I’ve took my dive and fleshed out which parts this will attach to and what might need refactoring.

I will be working on this during the next two and a half months. The target for the working, but not necessarily the universally acceptable implementation, is June. I’ll write the GSIP around the end of this month.

Let’s hope the WFS client rewrite does not collide with this venture! That would be a shame. Can you point out the issues you’re having with the current implementation, i.e the reasons for the possible rewrite? So I would know what parts to avoid and what to not target in my GSIP (it wouldn’t make sense for me to refactor something that will be rewritten anyway).

Sampo

···

On Fri, Mar 14, 2014 at 4:39 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Fri, Mar 14, 2014 at 3:28 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi Andrea & Jody,

Thanks for your comments. My next steps are to dive through all the relevant parts of the Geotools / GeoServer code base and figure out a more detailed plan for the work. At which point would you like to see a GSIP?

When you have a clear idea of what you’ll be working on, so that the difference between the
plan to be voted, and the code you’re going to write, it’s going to be minimal (significant deviations
in the code would require the GSIP to be re-discussed and voted again).

Regarding targeting only stored queries: Stored query support is vital for the use case at FMI, so that’s the minimum level we need to target. That means that I will work on the full WFS 2.0 client only after we’ve satisfied the demands for the use case at hand. But knowing that this is a key limiting factor to having this work included in mainline GeoServer is very important for us. Thanks for the heads up Andrea! We will definitely raise the priority of a more complete WFS 2.0 client support.

How complete the WFS 2.0 client would need to be to be “automatically” included? Is read-only sufficient? As we’re not doing anything related to transactional requests, fitting transactional client support would be stretching the budget, time frame and scope.

Given that WFS 1.1 client in the unsupported wfs module is ready only already, a WFS 2.0 read only client would fit the bill imho,
not sure what other devs think.

Mind one detail, the existing WFS client has been in unsupported land for a while, and we all know it needs a rewrite (an attempt
has been made, but it was aborted rather soon), but we lack the funding to do that.
However, if any supporting company manages to get the funds for it, the client will likely be rewritten from scratch.
I can’t tell you if and when that will happen, but it’s a possibility… hopefully that does not happen while you’re working
on the WFS 2.0 protocol support… what is your time frame?

Cheers

Andrea

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Fri, Mar 14, 2014 at 3:46 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi,

So I guess the GSIP should be written after I've took my dive and fleshed
out which parts this will attach to and what might need refactoring.

I will be working on this during the next two and a half months. The
target for the working, but not necessarily the universally acceptable
implementation, is June. I'll write the GSIP around the end of this month.

Let's hope the WFS client rewrite does not collide with this venture! That
would be a shame. Can you point out the issues you're having with the
current implementation, i.e the reasons for the possible rewrite? So I
would know what parts to avoid and what to not target in my GSIP (it
wouldn't make sense for me to refactor something that will be rewritten
anyway).

Ah, that rewrite has been something we would like to do for years now, and
it probably won't happen for years to come,
but I have no control on it, it all depends on someone getting funding to
work on it, and you never know when that happens

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Fri, Mar 14, 2014 at 8:52 AM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

On Fri, Mar 14, 2014 at 3:46 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi,

So I guess the GSIP should be written after I've took my dive and fleshed
out which parts this will attach to and what might need refactoring.

I will be working on this during the next two and a half months. The
target for the working, but not necessarily the universally acceptable
implementation, is June. I'll write the GSIP around the end of this month.

Let's hope the WFS client rewrite does not collide with this venture!
That would be a shame. Can you point out the issues you're having with the
current implementation, i.e the reasons for the possible rewrite? So I
would know what parts to avoid and what to not target in my GSIP (it
wouldn't make sense for me to refactor something that will be rewritten
anyway).

Ah, that rewrite has been something we would like to do for years now, and
it probably won't happen for years to come,
but I have no control on it, it all depends on someone getting funding to
work on it, and you never know when that happens

Relevant to this discussion is some work we have secured to make some
modifications to the datastore. It is not a re-write, but basically it will
be to add transactions to the wfs 1.1 part of the datastore. ANd possibly
to implement wfs 2.0 support if we can get the client on board.

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
*Justin Deoliveira*
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive <https://twitter.com/j_deolive&gt;

Sampo,

have you considered the wfs-ng module? I believe that rather a lot of work has been done on this by Gabriel Roldán, some time ago. Perhaps some yet to be merged? I think this was intended to be the successor to the wfs module.

Also, what is the nature of the content model of the WFS service? Simple or complex feature? Quite a bit of work has also been done adding complex feature support to wfs-ng by Adam Brown, but it depends on unmerged wfs-ng changes and itself is as yet unmerged. This will be of great interest of you for complex features as it includes a lot of support for application schemas.

Kind regards,
Ben.

On 14/03/14 18:49, Sampo Savolainen wrote:

Hi,

I've been contracted by the Finnish Meteorological Institute to write a
cascaded WFS 2.0 data store for GeoServer. My background is deep in
software development, working mainly on networked systems using Java. I
have previous experience with GeoServer (a few bug fixes, a proprietary
dispatcher implementation, server setup & maintenance) and I also have
experience with WFS. Latter part comes from Spatineo, where I've
implemented the backend for our WFS monitoring.

The actual use case we're solving is visualizing data supplied by a
separate WFS 2.0 server. The visualization will be done using
GeoServer's WMS facilities. We need 2.0 support because the backend WFS
server offers the data as stored queries. This is where our efforts will
be focused on: Stored Queries returning responses in Simple Features
Profile.

One of the goals of this project is to create an implementation which
has enough general appeal to be accepted into the official builds of
GeoServer, or perhaps as one extension in the official collection.

I would love to get some feedback on this project. Especially regarding
what requirements the GeoServer developer community has for this work to
get accepted into official releases. Also any ideas on how to approach
this task are gladly accepted.

I've identified the following places that I need to work on:

Geotools needs a WFS 2.0 module
(https://github.com/geotools/geotools/tree/master/modules/unsupported/wfs)

GeoServer needs relevant configuration and possibly UI elements to set
up cascading WFS 2.0 data stores and creating layers from those datasources.

To support parameters for the stored queries, the WMS dimensions need to
be leveraged to pass on any dimension values to the WFS 2.0 data store.

I will initially be writing on this on top of 2.5.x, as that is the
expected version the first production system will run.

   Sampo

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com <mailto:sampo.savolainen@anonymised.com>
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com <http://www.spatineo.com>, twitter.com/#!/spatineo
<http://twitter.com/#!/spatineo&gt;
www.linkedin.com/company/spatineo-inc
<http://www.linkedin.com/company/spatineo-inc&gt;

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

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

On Mon, Mar 17, 2014 at 10:44 AM, Ben Caradoc-Davies <
Ben.Caradoc-Davies@anonymised.com> wrote:

Sampo,

have you considered the wfs-ng module? I believe that rather a lot of
work has been done on this by Gabriel Roldán, some time ago. Perhaps
some yet to be merged? I think this was intended to be the successor to
the wfs module.

I remember the plan, yet, I believe nothing actually working came out of it?
If Justin's plan is to keep on working on the existing wfs community module
that's a strong indicator wfs-ng is way off from being actually working...
Justin, any feedback on this?

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi,

It’s good that wfs-ng came up. I did notice it and was just going to ask you guys about it. A cursory glance at the git logs seems to indicate that “wfs” is still preferred over “wfs-ng”. I’d love to hear what Justin says about this though.

The possibility of having someone else work on WFS 2.0 is also very intriguing. What kind of time frame is being considered for this project? And how soon will you know whether WFS 2.0 will be included in it?

Sampo

···

On Mon, Mar 17, 2014 at 11:56 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Mon, Mar 17, 2014 at 10:44 AM, Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com> wrote:

Sampo,

have you considered the wfs-ng module? I believe that rather a lot of
work has been done on this by Gabriel Roldán, some time ago. Perhaps
some yet to be merged? I think this was intended to be the successor to
the wfs module.

I remember the plan, yet, I believe nothing actually working came out of it?
If Justin’s plan is to keep on working on the existing wfs community module
that’s a strong indicator wfs-ng is way off from being actually working…
Justin, any feedback on this?

Cheers

Andrea

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Fri, Mar 14, 2014 at 3:24 PM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

On Fri, Mar 14, 2014 at 11:49 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

To support parameters for the stored queries, the WMS dimensions need
to be leveraged to pass on any dimension values to the WFS 2.0 data store.

Ah, those go down as filters... and I guess this might be a problem? With
stored queries you are pretty much stuck with whatever
is in the query template, cannot pass more filters down (and you need to
understand how the generic filter GeoServer will give you
is mapped in the stored query, which means, understanding the stored query
itself...). Any other filter will have to be run client side
(which is of course inefficient...)

I'm thinking I could deal with mapping WMS dimensions to Stored Query
parameters like so:
- Only "and" filters are accepted (nested or flat)
- All filter operands must assert equivalence of a property to a literal
value, or a bounding box
- The equivalence filters would be mapped as stored query parameters
(property => parameter name, literal => parameter value)
- Bounding box is given in the format appropriate for the stored query in
question (in my case, it's given OGC BBOX KVP style to the stored query)

The first two steps are checked in the data store and the query is aborted
if it contains operands that are out of scope.

Do you think this would work? And are there corner cases this simple model
doesn't cover?

Sampo

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Mon, Mar 17, 2014 at 12:31 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

On Fri, Mar 14, 2014 at 3:24 PM, Andrea Aime <andrea.aime@anonymised.com
> wrote:

On Fri, Mar 14, 2014 at 11:49 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

To support parameters for the stored queries, the WMS dimensions need
to be leveraged to pass on any dimension values to the WFS 2.0 data store.

Ah, those go down as filters... and I guess this might be a problem? With
stored queries you are pretty much stuck with whatever
is in the query template, cannot pass more filters down (and you need to
understand how the generic filter GeoServer will give you
is mapped in the stored query, which means, understanding the stored
query itself...). Any other filter will have to be run client side
(which is of course inefficient...)

I'm thinking I could deal with mapping WMS dimensions to Stored Query
parameters like so:
- Only "and" filters are accepted (nested or flat)
- All filter operands must assert equivalence of a property to a literal
value, or a bounding box
- The equivalence filters would be mapped as stored query parameters
(property => parameter name, literal => parameter value)
- Bounding box is given in the format appropriate for the stored query in
question (in my case, it's given OGC BBOX KVP style to the stored query)

The first two steps are checked in the data store and the query is aborted
if it contains operands that are out of scope.

Do you think this would work? And are there corner cases this simple model
doesn't cover?

You are not writing a valid store if you decide which queries are
acceptable, and which are not, a valid store
must work with all possible incoming filters, if they are not giving you
the parameters you need, you'll have
to replace them with some reasonable defaults I guess.

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On Mon, Mar 17, 2014 at 1:35 PM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

On Mon, Mar 17, 2014 at 12:31 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

On Fri, Mar 14, 2014 at 3:24 PM, Andrea Aime <
andrea.aime@anonymised.com> wrote:

On Fri, Mar 14, 2014 at 11:49 AM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

To support parameters for the stored queries, the WMS dimensions need
to be leveraged to pass on any dimension values to the WFS 2.0 data store.

Ah, those go down as filters... and I guess this might be a problem?
With stored queries you are pretty much stuck with whatever
is in the query template, cannot pass more filters down (and you need to
understand how the generic filter GeoServer will give you
is mapped in the stored query, which means, understanding the stored
query itself...). Any other filter will have to be run client side
(which is of course inefficient...)

I'm thinking I could deal with mapping WMS dimensions to Stored Query
parameters like so:
- Only "and" filters are accepted (nested or flat)
- All filter operands must assert equivalence of a property to a literal
value, or a bounding box
- The equivalence filters would be mapped as stored query parameters
(property => parameter name, literal => parameter value)
- Bounding box is given in the format appropriate for the stored query
in question (in my case, it's given OGC BBOX KVP style to the stored query)

The first two steps are checked in the data store and the query is
aborted if it contains operands that are out of scope.

Do you think this would work? And are there corner cases this simple
model doesn't cover?

You are not writing a valid store if you decide which queries are
acceptable, and which are not, a valid store
must work with all possible incoming filters, if they are not giving you
the parameters you need, you'll have
to replace them with some reasonable defaults I guess.

Stored queries do not support OGC filters or anything as expressive.
Therefore there is no way to support any and all filters. Consider a OGC
filter which specifies a PropertyIsBetween operand and mapping that filter
to a query which only supports a single value for that parameter. Also note
that with stored queries, there is no fixed relationship with request
parameters and data in the output format. e.g. you could have a request
parameter YEAR_OF_BIRTH and the output data would include the percentage of
senior citizens in that age group. This means that you can't read a wider
data set from the data store and then just execute the filter within
GeoServer to come up with the correct response for the query.

There is no generic way of solving this, and the only direction I can
currently come up with requires stripping down what the data store allows
to do. Of course it's another question altogether how the strategy to cope
with unsupported operands. We can decide to be either strict or relaxed.

S.

--
Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

You know that filters do not only come out of the WMS GetMap right? Each datastore query is constructed from the WMS GetMap information combined with the WMS style. Many styles have multiple rules, each one of which has a Filter.

It is this combination that forms the individual queries that are sent to the datastore.

The JDBC DataStore implementation has a similar limitation (not every filter can be expressed in SQL). In this case the Filter is split into two: the part that can be sent to the database, and the part that (as Andrea indicated) must me done in locally in Java.

Not trying to discourage you, just let you know what you are up against. GetMap requires a fairly general purpose WFS Query due to styling.

···

Jody Garnett

On Mon, Mar 17, 2014 at 10:50 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Mon, Mar 17, 2014 at 1:35 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Stored queries do not support OGC filters or anything as expressive. Therefore there is no way to support any and all filters. Consider a OGC filter which specifies a PropertyIsBetween operand and mapping that filter to a query which only supports a single value for that parameter. Also note that with stored queries, there is no fixed relationship with request parameters and data in the output format. e.g. you could have a request parameter YEAR_OF_BIRTH and the output data would include the percentage of senior citizens in that age group. This means that you can’t read a wider data set from the data store and then just execute the filter within GeoServer to come up with the correct response for the query.

There is no generic way of solving this, and the only direction I can currently come up with requires stripping down what the data store allows to do. Of course it’s another question altogether how the strategy to cope with unsupported operands. We can decide to be either strict or relaxed.

S.

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Mon, Mar 17, 2014 at 12:31 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

You are not writing a valid store if you decide which queries are acceptable, and which are not, a valid store
must work with all possible incoming filters, if they are not giving you the parameters you need, you’ll have
to replace them with some reasonable defaults I guess.

On Fri, Mar 14, 2014 at 3:24 PM, Andrea Aime <andrea.aime@anonymised.com8…> wrote:

I’m thinking I could deal with mapping WMS dimensions to Stored Query parameters like so:

  • Only “and” filters are accepted (nested or flat)
  • All filter operands must assert equivalence of a property to a literal value, or a bounding box
  • The equivalence filters would be mapped as stored query parameters (property => parameter name, literal => parameter value)
  • Bounding box is given in the format appropriate for the stored query in question (in my case, it’s given OGC BBOX KVP style to the stored query)

The first two steps are checked in the data store and the query is aborted if it contains operands that are out of scope.

Do you think this would work? And are there corner cases this simple model doesn’t cover?

On Fri, Mar 14, 2014 at 11:49 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

To support parameters for the stored queries, the WMS dimensions need to be leveraged to pass on any dimension values to the WFS 2.0 data store.

Ah, those go down as filters… and I guess this might be a problem? With stored queries you are pretty much stuck with whatever
is in the query template, cannot pass more filters down (and you need to understand how the generic filter GeoServer will give you
is mapped in the stored query, which means, understanding the stored query itself…). Any other filter will have to be run client side
(which is of course inefficient…)

On Mon, Mar 17, 2014 at 12:57 PM, Jody Garnett <jody.garnett@anonymised.com>wrote:

You know that filters do not only come out of the WMS GetMap right? Each
datastore query is constructed from the WMS GetMap information combined
with the WMS style. Many styles have multiple rules, each one of which has
a Filter.

It is this combination that forms the individual queries that are sent to
the datastore.

The JDBC DataStore implementation has a similar limitation (not every
filter can be expressed in SQL). In this case the Filter is split into two:
the part that can be sent to the database, and the part that (as Andrea
indicated) must me done in locally in Java.

Not trying to discourage you, just let you know what you are up against.
GetMap requires a fairly general purpose WFS Query due to styling.

Yes correct. And the filter splitting is what is generally used to
transform a general filter into a AND of two parts, one that can be
"encoded"
in the native store abilities and one that is to be run locally in memory.
Stores are supposed to run whatever filter received the outside, they will
just to so at different speeds depending on what you can
evaluate efficiently (pre filtering) and what you have to evaluate feature
by feature once constructed (post-filter)

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi,

With the JDBC DataStore, there exists a direct connection between the query parameters and what comes out of the data store. In that case it is certainly possible (even easy) to do some of the filtering within GeoServer. However with stored queries, there is a relationship between the input parameters and the output properties, but that relationship is unknown. From a systems point of view, the stored query is a black box.

I’m beginning to suspect that the disconnect between input properties and output properties will cause issues in other places of GeoServer as well.

However, we could see the filter operands as filtering based on either input or output properties separately. Maybe the filter strategy could be something like:

  • Split the query into two: pre-filter and post-filter (like with JDBC)
  • Pre-filter will contain the operands that are mappable to stored query parameters (literal equivalency of input parameters, bbox)
  • Post-filter will contain operands targeted to properties which are not input parameters for the stored query.

It’s possible the operands applicable for the pre-filter are placed in the query tree in a way that a single pre-filter will not be able to satisfy the entire query. (FOO = ‘bar’ OR FOO = ‘zoo’) In this case, the original query would need to be split into separate pre and post-filters which would be executed separately. Finally, the results from all split queries would be combined and duplicates removed (identified by fid or another property configured for the stored query).

This still does not give us a 1:1 model with OGC queries though. Any other operands than literal equivalency targeted at the input parameters could cause unexpected behavior.

What do you think?

Sampo

···

On Mon, Mar 17, 2014 at 1:57 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

You know that filters do not only come out of the WMS GetMap right? Each datastore query is constructed from the WMS GetMap information combined with the WMS style. Many styles have multiple rules, each one of which has a Filter.

It is this combination that forms the individual queries that are sent to the datastore.

The JDBC DataStore implementation has a similar limitation (not every filter can be expressed in SQL). In this case the Filter is split into two: the part that can be sent to the database, and the part that (as Andrea indicated) must me done in locally in Java.

Not trying to discourage you, just let you know what you are up against. GetMap requires a fairly general purpose WFS Query due to styling.

Jody

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

Jody Garnett

On Mon, Mar 17, 2014 at 10:50 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Mon, Mar 17, 2014 at 1:35 PM, Andrea Aime <andrea.aime@anonymised.com8…> wrote:

Stored queries do not support OGC filters or anything as expressive. Therefore there is no way to support any and all filters. Consider a OGC filter which specifies a PropertyIsBetween operand and mapping that filter to a query which only supports a single value for that parameter. Also note that with stored queries, there is no fixed relationship with request parameters and data in the output format. e.g. you could have a request parameter YEAR_OF_BIRTH and the output data would include the percentage of senior citizens in that age group. This means that you can’t read a wider data set from the data store and then just execute the filter within GeoServer to come up with the correct response for the query.

There is no generic way of solving this, and the only direction I can currently come up with requires stripping down what the data store allows to do. Of course it’s another question altogether how the strategy to cope with unsupported operands. We can decide to be either strict or relaxed.

S.

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Mon, Mar 17, 2014 at 12:31 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

You are not writing a valid store if you decide which queries are acceptable, and which are not, a valid store
must work with all possible incoming filters, if they are not giving you the parameters you need, you’ll have
to replace them with some reasonable defaults I guess.

On Fri, Mar 14, 2014 at 3:24 PM, Andrea Aime <andrea.aime@anonymised.com8…> wrote:

I’m thinking I could deal with mapping WMS dimensions to Stored Query parameters like so:

  • Only “and” filters are accepted (nested or flat)
  • All filter operands must assert equivalence of a property to a literal value, or a bounding box
  • The equivalence filters would be mapped as stored query parameters (property => parameter name, literal => parameter value)
  • Bounding box is given in the format appropriate for the stored query in question (in my case, it’s given OGC BBOX KVP style to the stored query)

The first two steps are checked in the data store and the query is aborted if it contains operands that are out of scope.

Do you think this would work? And are there corner cases this simple model doesn’t cover?

On Fri, Mar 14, 2014 at 11:49 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

To support parameters for the stored queries, the WMS dimensions need to be leveraged to pass on any dimension values to the WFS 2.0 data store.

Ah, those go down as filters… and I guess this might be a problem? With stored queries you are pretty much stuck with whatever
is in the query template, cannot pass more filters down (and you need to understand how the generic filter GeoServer will give you
is mapped in the stored query, which means, understanding the stored query itself…). Any other filter will have to be run client side
(which is of course inefficient…)

On Mon, Mar 17, 2014 at 2:11 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi,

With the JDBC DataStore, there exists a direct connection between the
query parameters and what comes out of the data store. In that case it is
certainly possible (even easy) to do some of the filtering within
GeoServer. However with stored queries, there is a relationship between the
input parameters and the output properties, but that relationship is
unknown. From a systems point of view, the stored query is a black box.

I'm beginning to suspect that the disconnect between input properties and
output properties will cause issues in other places of GeoServer as well.

However, we could see the filter operands as filtering based on either
input or output properties separately. Maybe the filter strategy could be
something like:
- Split the query into two: pre-filter and post-filter (like with JDBC)
- Pre-filter will contain the operands that are mappable to stored query
parameters (literal equivalency of input parameters, bbox)
- Post-filter will contain operands targeted to properties which are not
input parameters for the stored query.

It's possible the operands applicable for the pre-filter are placed in the
query tree in a way that a single pre-filter will not be able to satisfy
the entire query. (FOO = 'bar' OR FOO = 'zoo') In this case, the original
query would need to be split into separate pre and post-filters which would
be executed separately. Finally, the results from all split queries would
be combined and duplicates removed (identified by fid or another property
configured for the stored query).

This still does not give us a 1:1 model with OGC queries though. Any other
operands than literal equivalency targeted at the input parameters could
cause unexpected behavior.

Right, I believe I understand it now, you are in a situation similar to
parametric sql views, the parameters
have nothing to do with the returned attributes, but filters only work
against returned attributes.
See here:
http://docs.geoserver.org/stable/en/user/data/database/sqlview.html

In that case you could use the vendor params for sql views as the 1:1
mapping for the WFS parameters.
And all the filter would have to be performed fully in memory.

Or, if you can have the administrator provide soft knowledge about how
certain filters can be turned into stored
query parameters, do that as well, but it may not be possible or trivial,
and might require some custom programming to do the mapping
(e.g., maybe a jython/groovy/beanshell script)

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi,

Yes. The SQL View case seems to be highly analogous to stored queries! Is there a reason for using viewparams=p1:v1;p2:v2;… instead of dimensions? Or is the reason simply that dimensions get mapped as filters? Are the viewparams advertised in any way in Capabilities documents, for example WMS?

Sampo

···

On Mon, Mar 17, 2014 at 3:22 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com
+358-407555649
Linnankoskenkatu 16 A 17, 00250 Helsinki, Finland
www.spatineo.com, twitter.com/#!/spatineo
www.linkedin.com/company/spatineo-inc

This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate, or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.

On Mon, Mar 17, 2014 at 2:11 PM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

With the JDBC DataStore, there exists a direct connection between the query parameters and what comes out of the data store. In that case it is certainly possible (even easy) to do some of the filtering within GeoServer. However with stored queries, there is a relationship between the input parameters and the output properties, but that relationship is unknown. From a systems point of view, the stored query is a black box.

I’m beginning to suspect that the disconnect between input properties and output properties will cause issues in other places of GeoServer as well.

However, we could see the filter operands as filtering based on either input or output properties separately. Maybe the filter strategy could be something like:

  • Split the query into two: pre-filter and post-filter (like with JDBC)
  • Pre-filter will contain the operands that are mappable to stored query parameters (literal equivalency of input parameters, bbox)
  • Post-filter will contain operands targeted to properties which are not input parameters for the stored query.

It’s possible the operands applicable for the pre-filter are placed in the query tree in a way that a single pre-filter will not be able to satisfy the entire query. (FOO = ‘bar’ OR FOO = ‘zoo’) In this case, the original query would need to be split into separate pre and post-filters which would be executed separately. Finally, the results from all split queries would be combined and duplicates removed (identified by fid or another property configured for the stored query).

This still does not give us a 1:1 model with OGC queries though. Any other operands than literal equivalency targeted at the input parameters could cause unexpected behavior.

Right, I believe I understand it now, you are in a situation similar to parametric sql views, the parameters
have nothing to do with the returned attributes, but filters only work against returned attributes.
See here:
http://docs.geoserver.org/stable/en/user/data/database/sqlview.html

In that case you could use the vendor params for sql views as the 1:1 mapping for the WFS parameters.
And all the filter would have to be performed fully in memory.

Or, if you can have the administrator provide soft knowledge about how certain filters can be turned into stored
query parameters, do that as well, but it may not be possible or trivial, and might require some custom programming to do the mapping
(e.g., maybe a jython/groovy/beanshell script)

Cheers

Andrea

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Mar 17, 2014 at 3:28 PM, Sampo Savolainen <
sampo.savolainen@anonymised.com> wrote:

Hi,

Yes. The SQL View case seems to be highly analogous to stored queries! Is
there a reason for using viewparams=p1:v1;p2:v2;.. instead of dimensions?

Parameters can be anything, not just dimensions. A wfs store based on
stored queries should be able to work against any stored query,
not just ones that assume the parameters are specific values of the
dimensions (which is basically assuming the parameter will
be a "time = %timeValue%" filter inside the stored query, which is just one
of the many things a parameter can do in a stored
query, especially an opaque one)

Or is the reason simply that dimensions get mapped as filters? Are the
viewparams advertised in any way in Capabilities documents, for example WMS?

Yes, dimensions are always attributes, so they get mapped as filters, for
vector data at least.
The viewparams are not declared in the WMS document. It's a vendor
extension, so no standard client would be able to use it
anyways, but yes, it would be good to declare them in the caps document

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------