[Geoserver-devel] WFS 2.0 Stored Query data store

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

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?

Right. Indeed we are interested in working on the implementation that we

feel best about moving forward. If that is wfs-ng then we are cool with
working there. @Niels is the one doing the work so i will ask him what
version he has been doing initial testing with.

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

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

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

On Mon, Mar 17, 2014 at 8:57 AM, Justin Deoliveira <
jdeolive@anonymised.com> wrote:

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

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?

Right. Indeed we are interested in working on the implementation that we

feel best about moving forward. If that is wfs-ng then we are cool with
working there. @Niels is the one doing the work so i will ask him what
version he has been doing initial testing with.

One thing that would help is to figure out the functionality gap (if there
is one) between the two. Is the wfs-ng version on par with the existing
implementation in terms of wfs 1.0 and wfs 1.1 support? Does it have
transaction support? Will ask Niels to look into it but thought someone
else might know off hand.

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

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

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

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

On Mon, Mar 17, 2014 at 3:59 PM, Justin Deoliveira <
jdeolive@anonymised.com> wrote:

One thing that would help is to figure out the functionality gap (if there
is one) between the two. Is the wfs-ng version on par with the existing
implementation in terms of wfs 1.0 and wfs 1.1 support? Does it have
transaction support? Will ask Niels to look into it but thought someone
else might know off hand.

About that, Mauro and Davide spend quite some effort to make the existing
WFS client work against
MapSever and TinyOWS, with mock tests included, if wfs-ng it would be good
to have the tests ported
over to make sure we don't regress in those cases

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

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

Definitely. We might have some flexibility with the client to factor in overhead of porting tests to wfs-ng and getting it up to the same level as the old version… although I will need to get a better handle on what that will take. Perhaps @Gabriel can give us an idea of where the wfs-ng store is at and what the big differences are from the old code.

···

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

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Mon, Mar 17, 2014 at 3:59 PM, Justin Deoliveira <jdeolive@anonymised.com.3839…> wrote:

About that, Mauro and Davide spend quite some effort to make the existing WFS client work against
MapSever and TinyOWS, with mock tests included, if wfs-ng it would be good to have the tests ported
over to make sure we don’t regress in those cases

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


One thing that would help is to figure out the functionality gap (if there is one) between the two. Is the wfs-ng version on par with the existing implementation in terms of wfs 1.0 and wfs 1.1 support? Does it have transaction support? Will ask Niels to look into it but thought someone else might know off hand.

On 17/03/14 22:59, Justin Deoliveira wrote:

One thing that would help is to figure out the functionality gap (if
there is one) between the two. Is the wfs-ng version on par with the
existing implementation in terms of wfs 1.0 and wfs 1.1 support? Does it
have transaction support? Will ask Niels to look into it but thought
someone else might know off hand.

Justin,

one thing that came up again at yesterday's committee meeting is that there are several things that can be included in improvements to the GeoTools wfs module (and this should really be on the GeoTools list):

- WFS 2.0 support
- WFS-T support
- Complex feature support (Adam Brown's work)

Which of these are funded?

Some links:

Gabriels' wfs_ng branch:
https://github.com/groldan/geotools/commits/wfs_ng

Adam Brown's work based on this:
https://github.com/Adam-Brown/geotools/commits/wfs_ng
(there are other gml client lib branches that might be relevant)

Adam's proposal:
http://docs.codehaus.org/display/GEOTOOLS/ComplexFeature+Parsing+and+Building+Support
http://jira.codehaus.org/browse/GEOT-4147
Part of a long discussion:
http://osgeo-org.1560.x6.nabble.com/Re-API-Change-Proposal-ComplexFeature-Parsing-amp-Building-td4980443.html

Many of the complex feature support changes have now been completed and incorporated into gt-complex. AFAIK it is mainly the wfs-ng changes that are missing.

Kind regards,

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

And see also this comment which indicates that Adam also has stuff on his master:
http://jira.codehaus.org/browse/GEOT-4147?focusedCommentId=307326&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-307326

Niels is aware of some of it.

Kind regards,
Ben.

On 19/03/14 15:46, Ben Caradoc-Davies wrote:

On 17/03/14 22:59, Justin Deoliveira wrote:

One thing that would help is to figure out the functionality gap (if
there is one) between the two. Is the wfs-ng version on par with the
existing implementation in terms of wfs 1.0 and wfs 1.1 support? Does it
have transaction support? Will ask Niels to look into it but thought
someone else might know off hand.

Justin,

one thing that came up again at yesterday's committee meeting is that
there are several things that can be included in improvements to the
GeoTools wfs module (and this should really be on the GeoTools list):

- WFS 2.0 support
- WFS-T support
- Complex feature support (Adam Brown's work)

Which of these are funded?

Some links:

Gabriels' wfs_ng branch:
https://github.com/groldan/geotools/commits/wfs_ng

Adam Brown's work based on this:
https://github.com/Adam-Brown/geotools/commits/wfs_ng
(there are other gml client lib branches that might be relevant)

Adam's proposal:
http://docs.codehaus.org/display/GEOTOOLS/ComplexFeature+Parsing+and+Building+Support
http://jira.codehaus.org/browse/GEOT-4147
Part of a long discussion:
http://osgeo-org.1560.x6.nabble.com/Re-API-Change-Proposal-ComplexFeature-Parsing-amp-Building-td4980443.html

Many of the complex feature support changes have now been completed and
incorporated into gt-complex. AFAIK it is mainly the wfs-ng changes that
are missing.

Kind regards,

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

Hey Ben,

At the moment the client is interested mostly in WFS-T support. The old wfs
client gives us write support with 1.0 but not with 1.1. However I am
working with the client to figure out if we have the budget to do some more
general work including switching over to wfs-ng (if the community feels
that is the way to go) and adding support for WFS 2.0.

Niels is currently working on some estimates for these tasks and from those
we will figure out what we will be able to fit into the clients budget.
More to come soon.

So the question remains, do we feel better in the long term about wfs-ng?
Still waiting from Gabriel for an overview about what the technical
differences are.

-Justin

On Wed, Mar 19, 2014 at 1:46 AM, Ben Caradoc-Davies <
Ben.Caradoc-Davies@anonymised.com> wrote:

On 17/03/14 22:59, Justin Deoliveira wrote:

One thing that would help is to figure out the functionality gap (if
there is one) between the two. Is the wfs-ng version on par with the
existing implementation in terms of wfs 1.0 and wfs 1.1 support? Does it
have transaction support? Will ask Niels to look into it but thought
someone else might know off hand.

Justin,

one thing that came up again at yesterday's committee meeting is that
there are several things that can be included in improvements to the
GeoTools wfs module (and this should really be on the GeoTools list):

- WFS 2.0 support
- WFS-T support
- Complex feature support (Adam Brown's work)

Which of these are funded?

Some links:

Gabriels' wfs_ng branch:
https://github.com/groldan/geotools/commits/wfs_ng

Adam Brown's work based on this:
https://github.com/Adam-Brown/geotools/commits/wfs_ng
(there are other gml client lib branches that might be relevant)

Adam's proposal:
http://docs.codehaus.org/display/GEOTOOLS/ComplexFeature+Parsing+and+
Building+Support
http://jira.codehaus.org/browse/GEOT-4147
Part of a long discussion:
http://osgeo-org.1560.x6.nabble.com/Re-API-Change-Proposal-ComplexFeature-
Parsing-amp-Building-td4980443.html

Many of the complex feature support changes have now been completed and
incorporated into gt-complex. AFAIK it is mainly the wfs-ng changes that
are missing.

Kind regards,

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

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

Hey sorry for the late reply,

The motivations to start wfs-ng were several:

  • wfs uses two different xml “technologies” for wfs 1.0 and wfs 1.1. The one used for 1.0 is legacy (gt-xml) and for 1.1 it uses the geotools gt-xsd framework.
  • wfs also has two different DataStore implementations, for 1.0 based on the old AbstractDataStore, and for 1.1 being a pure interface implementation.
  • at the time of starting wfs-ng at least, it was difficult to create unit and integration tests without live servers, which is worse due to the fact that (all?) servers behave differently, and we have strategy objects to deal with each one’s oddities. Yet most tests needed to be online, and “reference” online servers tend to disappear or be unavailable.

So the idea behind wfs-ng was to have a wfs datastore implementation that could be more easily maintained and extended to newer protocol versions, with the following design goals:

  • there shall be one single WFSDataStore for all wfs versions, based on the new ContentDataStore “framework” the jdbc and other ones are based, given it’s the new “AbstractDataStore” which is practically deprecated.
  • All the xml I/O and parsing, and the differencies between versions, should be handled by the new gt-xsd framework, yet that should remain an implementation detail as far as the datastore is concerned
  • To keep building on top of existing code and enhance it instead of reinvent the wheel, the HTTP communication should be based on AbstractOpenWebService, on which also the wfs and aps clients are built.
  • Easy of testing is a must, minimizing or nullifying the need for actual online servers

So we ended up with:

ContentDataStore AbstractOpenWebService
^ ^

|

WFSContentDataStore → WFSClient → WFSStrategy

/

/
/ ________
AbstractWFSStrategy → | gt-xsd |

________|
StrictWFS_1_x_Strategy ___|

StrictWFS_2_0_Strategy ___|

Where WFSContentDataStore talks to the WFSClient in “OWS” terms like “issueRequest()”, “issueTransaction()”, “getRemoteTypeNames()”, etc; WFSClient asks the WFSStrategy to parse and encode requests and responses, but takes care of all the http communication and translation between DataStore objects and WFS protocol specific terms.

As for how good the wfs XX support is, its incomplete by all means. I think I got as far as using it for read only WFS 1.0 and 1.1 queries. The major blocker to get good 2.0 support at the time was that the gt-xsd bindings for 2.0 were too lacking. This is probably due to the fact that there are separate bindings for geoserver and geotools, and the geoserver ones received more attention as they were really needed there, but since there was no 2.0 client in geotools they were left incomplete.

As for transaction support, all the bits are in mostly in there. The one difficulty I found I think was a difference on how JDBC stores manage transactions (as ContentDataStore was originally written to support the jdbc-ng stores and hence was biased) and what I needed to do to replicate. jdbc ones hold transaction state at the jdbc Connection level so at commit() they’re just good to go, but I needed to hold uncommitted state in the client on a per transaction basis, yet I found that difficult to achieve with the per-featureType “ContentState” ContentDataStore uses. But I was also close to a solution when the work stalled. The ways to look at are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore’s “transaction states” would give me per-feature state diffs, forcing me issue one transaction element per feature for updates and deletes instead of batched as the wfs protocol supports, and I was trying to “merge” them into less WFS transaction elements.

That is to say, if you wanted to implement WFS 2 transaction support, all you’d need to do is implement StrictWFS_2_0_Strategy.createTransactionRequest(TransactionRequest request), where TransactionRequest is a module’s own type, and return the org.eclipse.emf.ecore.EObject that would then be encoded to xml by WFSRequest, which is part of the AbstractOpenWebService framework. As said, almost all in there already, but some 2.0 emf bits and lots of tests.

Hope that helps,
Gabriel

···

On Wed, Mar 19, 2014 at 11:34 AM, Justin Deoliveira <jdeolive@anonymised.com.3839…> wrote:

Gabriel Roldán

Software Developer | Boundless

groldan@anonymised.com

@gabrielroldan

Hey Ben,

At the moment the client is interested mostly in WFS-T support. The old wfs client gives us write support with 1.0 but not with 1.1. However I am working with the client to figure out if we have the budget to do some more general work including switching over to wfs-ng (if the community feels that is the way to go) and adding support for WFS 2.0.

Niels is currently working on some estimates for these tasks and from those we will figure out what we will be able to fit into the clients budget. More to come soon.

So the question remains, do we feel better in the long term about wfs-ng? Still waiting from Gabriel for an overview about what the technical differences are.

-Justin

On Wed, Mar 19, 2014 at 1:46 AM, Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com> wrote:

On 17/03/14 22:59, Justin Deoliveira wrote:

One thing that would help is to figure out the functionality gap (if
there is one) between the two. Is the wfs-ng version on par with the
existing implementation in terms of wfs 1.0 and wfs 1.1 support? Does it
have transaction support? Will ask Niels to look into it but thought
someone else might know off hand.

Justin,

one thing that came up again at yesterday’s committee meeting is that there are several things that can be included in improvements to the GeoTools wfs module (and this should really be on the GeoTools list):

  • WFS 2.0 support
  • WFS-T support
  • Complex feature support (Adam Brown’s work)

Which of these are funded?

Some links:

Gabriels’ wfs_ng branch:
https://github.com/groldan/geotools/commits/wfs_ng

Adam Brown’s work based on this:
https://github.com/Adam-Brown/geotools/commits/wfs_ng
(there are other gml client lib branches that might be relevant)

Adam’s proposal:
http://docs.codehaus.org/display/GEOTOOLS/ComplexFeature+Parsing+and+Building+Support
http://jira.codehaus.org/browse/GEOT-4147
Part of a long discussion:
http://osgeo-org.1560.x6.nabble.com/Re-API-Change-Proposal-ComplexFeature-Parsing-amp-Building-td4980443.html

Many of the complex feature support changes have now been completed and incorporated into gt-complex. AFAIK it is mainly the wfs-ng changes that are missing.

Kind regards,


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

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Wed, Mar 19, 2014 at 8:38 PM, Gabriel Roldan <groldan@anonymised.com>wrote:

Hey sorry for the late reply,

The motivations to start wfs-ng were several:
- wfs uses two different xml "technologies" for wfs 1.0 and wfs 1.1. The
one used for 1.0 is legacy (gt-xml) and for 1.1 it uses the geotools gt-xsd
framework.

Afaik 1.1 uses a custom hand written pull parser, but maybe it is just for
parsing XML?
Also, I believe it was supposed to read semi-complex features (pass me the
term, as in features a bit more complex than the flat ones we support
normally)?
I have vague memories that you tried gt-xsd streaming parsing, but found it
was not ready for production usage? Maybe I'm wrong

- wfs also has two different DataStore implementations, for 1.0 based on
the old AbstractDataStore, and for 1.1 being a pure interface
implementation.
- at the time of starting wfs-ng at least, it was difficult to create unit
and integration tests without live servers, which is worse due to the fact
that (all?) servers behave differently, and we have strategy objects to
deal with each one's oddities. Yet most tests needed to be online, and
"reference" online servers tend to disappear or be unavailable.

So the idea behind wfs-ng was to have a wfs datastore implementation that
could be more easily maintained and extended to newer protocol versions,
with the following design goals:

- there shall be one single WFSDataStore for all wfs versions, based on
the new ContentDataStore "framework" the jdbc and other ones are based,
given it's the new "AbstractDataStore" which is practically deprecated.
- All the xml I/O and parsing, and the differencies between versions,
should be handled by the new gt-xsd framework, yet that should remain an
implementation detail as far as the datastore is concerned
- To keep building on top of existing code and enhance it instead of
reinvent the wheel, the HTTP communication should be based
on AbstractOpenWebService, on which also the wfs and aps clients are built.
- Easy of testing is a must, minimizing or nullifying the need for actual
online servers

So we ended up with:

  ContentDataStore AbstractOpenWebService
        ^ ^
        | |
        |<extends> |<extends>
        | |
WFSContentDataStore --> WFSClient --> WFSStrategy
                                         /
                                        / <extends>
                                       / ________
                         AbstractWFSStrategy --> | gt-xsd |
                                        | |________|
              StrictWFS_1_x_Strategy ___|
              StrictWFS_2_0_Strategy ___| <extends>

Nice ASCII art! (and nice design, too)

Where WFSContentDataStore talks to the WFSClient in "OWS" terms like
"issueRequest()", "issueTransaction()", "getRemoteTypeNames()", etc;
WFSClient asks the WFSStrategy to parse and encode requests and responses,
but takes care of all the http communication and translation between
DataStore objects and WFS protocol specific terms.

As for how good the wfs XX support is, its incomplete by all means. I
think I got as far as using it for read only WFS 1.0 and 1.1 queries. The
major blocker to get good 2.0 support at the time was that the gt-xsd
bindings for 2.0 were too lacking. This is probably due to the fact that
there are separate bindings for geoserver and geotools, and the geoserver
ones received more attention as they were really needed there, but since
there was no 2.0 client in geotools they were left incomplete.

As for transaction support, all the bits are in mostly in there. The one
difficulty I found I think was a difference on how JDBC stores manage
transactions (as ContentDataStore was originally written to support the
jdbc-ng stores and hence was biased) and what I needed to do to replicate.
jdbc ones hold transaction state at the jdbc Connection level so at
commit() they're just good to go, but I needed to hold uncommitted state in
the client on a per transaction basis, yet I found that difficult to
achieve with the per-featureType "ContentState" ContentDataStore uses. But
I was also close to a solution when the work stalled. The ways to look at
are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore's "transaction
states" would give me per-feature state diffs, forcing me issue one
transaction element per feature for updates and deletes instead of batched
as the wfs protocol supports, and I was trying to "merge" them into less
WFS transaction elements.

That is to say, if you wanted to implement WFS 2 transaction support, all
you'd need to do is
implement StrictWFS_2_0_Strategy.createTransactionRequest(TransactionRequest
request), where TransactionRequest is a module's own type, and return the
org.eclipse.emf.ecore.EObject that would then be encoded to xml by
WFSRequest, which is part of the AbstractOpenWebService framework. As said,
almost all in there already, but some 2.0 emf bits and lots of tests.

One question, in terms of strategies, are the various
MapServer/TinyOWS/Cubewerx/addYourOwnVariantHere implemented in wfs-ng?

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,

thanks for the quick reply, comments inline.

···

On Wed, Mar 19, 2014 at 5:05 PM, Andrea Aime <andrea.aime@anonymised.com268…> wrote:

No you’re not wrong, my memory is. So, correction: the wfs 1.1 datastore uses custom hand written StAX code to parse GetFeature responses.

thanks!

There are 1.x strategies for CubeWerx, GeoServer_pre_2.0 (as in the geoserver version), Ionic, and MapServer. TinyOWS didn’t exist by then or I didn’t know about it.
No custom strategies for WFS 2.0 so far.

Cheers,
Gabriel

Gabriel Roldán

Software Developer | Boundless

groldan@anonymised.com

@gabrielroldan

On Wed, Mar 19, 2014 at 8:38 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hey sorry for the late reply,

The motivations to start wfs-ng were several:

  • wfs uses two different xml “technologies” for wfs 1.0 and wfs 1.1. The one used for 1.0 is legacy (gt-xml) and for 1.1 it uses the geotools gt-xsd framework.

Afaik 1.1 uses a custom hand written pull parser, but maybe it is just for parsing XML?
Also, I believe it was supposed to read semi-complex features (pass me the term, as in features a bit more complex than the flat ones we support normally)?
I have vague memories that you tried gt-xsd streaming parsing, but found it was not ready for production usage? Maybe I’m wrong

  • wfs also has two different DataStore implementations, for 1.0 based on the old AbstractDataStore, and for 1.1 being a pure interface implementation.
  • at the time of starting wfs-ng at least, it was difficult to create unit and integration tests without live servers, which is worse due to the fact that (all?) servers behave differently, and we have strategy objects to deal with each one’s oddities. Yet most tests needed to be online, and “reference” online servers tend to disappear or be unavailable.

So the idea behind wfs-ng was to have a wfs datastore implementation that could be more easily maintained and extended to newer protocol versions, with the following design goals:

  • there shall be one single WFSDataStore for all wfs versions, based on the new ContentDataStore “framework” the jdbc and other ones are based, given it’s the new “AbstractDataStore” which is practically deprecated.
  • All the xml I/O and parsing, and the differencies between versions, should be handled by the new gt-xsd framework, yet that should remain an implementation detail as far as the datastore is concerned
  • To keep building on top of existing code and enhance it instead of reinvent the wheel, the HTTP communication should be based on AbstractOpenWebService, on which also the wfs and aps clients are built.
  • Easy of testing is a must, minimizing or nullifying the need for actual online servers

So we ended up with:

ContentDataStore AbstractOpenWebService
^ ^
| |
| |
| |
WFSContentDataStore → WFSClient → WFSStrategy

/

/
/ ________
AbstractWFSStrategy → | gt-xsd |
| |________|
StrictWFS_1_x_Strategy ___|

StrictWFS_2_0_Strategy ___|

Nice ASCII art! (and nice design, too)

Where WFSContentDataStore talks to the WFSClient in “OWS” terms like “issueRequest()”, “issueTransaction()”, “getRemoteTypeNames()”, etc; WFSClient asks the WFSStrategy to parse and encode requests and responses, but takes care of all the http communication and translation between DataStore objects and WFS protocol specific terms.

As for how good the wfs XX support is, its incomplete by all means. I think I got as far as using it for read only WFS 1.0 and 1.1 queries. The major blocker to get good 2.0 support at the time was that the gt-xsd bindings for 2.0 were too lacking. This is probably due to the fact that there are separate bindings for geoserver and geotools, and the geoserver ones received more attention as they were really needed there, but since there was no 2.0 client in geotools they were left incomplete.

As for transaction support, all the bits are in mostly in there. The one difficulty I found I think was a difference on how JDBC stores manage transactions (as ContentDataStore was originally written to support the jdbc-ng stores and hence was biased) and what I needed to do to replicate. jdbc ones hold transaction state at the jdbc Connection level so at commit() they’re just good to go, but I needed to hold uncommitted state in the client on a per transaction basis, yet I found that difficult to achieve with the per-featureType “ContentState” ContentDataStore uses. But I was also close to a solution when the work stalled. The ways to look at are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore’s “transaction states” would give me per-feature state diffs, forcing me issue one transaction element per feature for updates and deletes instead of batched as the wfs protocol supports, and I was trying to “merge” them into less WFS transaction elements.

That is to say, if you wanted to implement WFS 2 transaction support, all you’d need to do is implement StrictWFS_2_0_Strategy.createTransactionRequest(TransactionRequest request), where TransactionRequest is a module’s own type, and return the org.eclipse.emf.ecore.EObject that would then be encoded to xml by WFSRequest, which is part of the AbstractOpenWebService framework. As said, almost all in there already, but some 2.0 emf bits and lots of tests.

One question, in terms of strategies, are the various MapServer/TinyOWS/Cubewerx/addYourOwnVariantHere implemented in wfs-ng?

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


Ok, so it looks wfs-ng is the way to go. I think we will probably have enough budget on this project to have Niels do the work that we need there and implement some general clean up in order to get the module to supported status. So in terms of things our client can fund we have:

  1. Implementing transactional support for WFS 1.0 and WFS 1.1

  2. Porting over tests from old module, in particular the ones to ensure we work nicely with MapServer and TinyOWS

  3. Push to supported status

  4. WFS 2.0 (with transaction) support

Depending on how much time 1-3 take we may have to drop (4) but I think we have a large enough chunk of hours to tackle all of it. But it sounds like Sampo might be able to help out with (4) anyways.

@Ben: Support for complex features would be on your dime :slight_smile:

So do folks feel that is an acceptable plan? If so how do people want to want to collaborate? Niels will start work immediately, not sure what everyone else’s timeline is.

···

On Wed, Mar 19, 2014 at 2:15 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hi Andrea,

thanks for the quick reply, comments inline.

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Wed, Mar 19, 2014 at 5:05 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

No you’re not wrong, my memory is. So, correction: the wfs 1.1 datastore uses custom hand written StAX code to parse GetFeature responses.

thanks!

There are 1.x strategies for CubeWerx, GeoServer_pre_2.0 (as in the geoserver version), Ionic, and MapServer. TinyOWS didn’t exist by then or I didn’t know about it.
No custom strategies for WFS 2.0 so far.

Cheers,
Gabriel

Gabriel Roldán

Software Developer | Boundless

groldan@anonymised.com

@gabrielroldan

On Wed, Mar 19, 2014 at 8:38 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hey sorry for the late reply,

The motivations to start wfs-ng were several:

  • wfs uses two different xml “technologies” for wfs 1.0 and wfs 1.1. The one used for 1.0 is legacy (gt-xml) and for 1.1 it uses the geotools gt-xsd framework.

Afaik 1.1 uses a custom hand written pull parser, but maybe it is just for parsing XML?
Also, I believe it was supposed to read semi-complex features (pass me the term, as in features a bit more complex than the flat ones we support normally)?
I have vague memories that you tried gt-xsd streaming parsing, but found it was not ready for production usage? Maybe I’m wrong

  • wfs also has two different DataStore implementations, for 1.0 based on the old AbstractDataStore, and for 1.1 being a pure interface implementation.
  • at the time of starting wfs-ng at least, it was difficult to create unit and integration tests without live servers, which is worse due to the fact that (all?) servers behave differently, and we have strategy objects to deal with each one’s oddities. Yet most tests needed to be online, and “reference” online servers tend to disappear or be unavailable.

So the idea behind wfs-ng was to have a wfs datastore implementation that could be more easily maintained and extended to newer protocol versions, with the following design goals:

  • there shall be one single WFSDataStore for all wfs versions, based on the new ContentDataStore “framework” the jdbc and other ones are based, given it’s the new “AbstractDataStore” which is practically deprecated.
  • All the xml I/O and parsing, and the differencies between versions, should be handled by the new gt-xsd framework, yet that should remain an implementation detail as far as the datastore is concerned
  • To keep building on top of existing code and enhance it instead of reinvent the wheel, the HTTP communication should be based on AbstractOpenWebService, on which also the wfs and aps clients are built.
  • Easy of testing is a must, minimizing or nullifying the need for actual online servers

So we ended up with:

ContentDataStore AbstractOpenWebService
^ ^
| |
| |
| |
WFSContentDataStore → WFSClient → WFSStrategy

/

/
/ ________
AbstractWFSStrategy → | gt-xsd |
| |________|
StrictWFS_1_x_Strategy ___|

StrictWFS_2_0_Strategy ___|

Nice ASCII art! (and nice design, too)

Where WFSContentDataStore talks to the WFSClient in “OWS” terms like “issueRequest()”, “issueTransaction()”, “getRemoteTypeNames()”, etc; WFSClient asks the WFSStrategy to parse and encode requests and responses, but takes care of all the http communication and translation between DataStore objects and WFS protocol specific terms.

As for how good the wfs XX support is, its incomplete by all means. I think I got as far as using it for read only WFS 1.0 and 1.1 queries. The major blocker to get good 2.0 support at the time was that the gt-xsd bindings for 2.0 were too lacking. This is probably due to the fact that there are separate bindings for geoserver and geotools, and the geoserver ones received more attention as they were really needed there, but since there was no 2.0 client in geotools they were left incomplete.

As for transaction support, all the bits are in mostly in there. The one difficulty I found I think was a difference on how JDBC stores manage transactions (as ContentDataStore was originally written to support the jdbc-ng stores and hence was biased) and what I needed to do to replicate. jdbc ones hold transaction state at the jdbc Connection level so at commit() they’re just good to go, but I needed to hold uncommitted state in the client on a per transaction basis, yet I found that difficult to achieve with the per-featureType “ContentState” ContentDataStore uses. But I was also close to a solution when the work stalled. The ways to look at are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore’s “transaction states” would give me per-feature state diffs, forcing me issue one transaction element per feature for updates and deletes instead of batched as the wfs protocol supports, and I was trying to “merge” them into less WFS transaction elements.

That is to say, if you wanted to implement WFS 2 transaction support, all you’d need to do is implement StrictWFS_2_0_Strategy.createTransactionRequest(TransactionRequest request), where TransactionRequest is a module’s own type, and return the org.eclipse.emf.ecore.EObject that would then be encoded to xml by WFSRequest, which is part of the AbstractOpenWebService framework. As said, almost all in there already, but some 2.0 emf bits and lots of tests.

One question, in terms of strategies, are the various MapServer/TinyOWS/Cubewerx/addYourOwnVariantHere implemented in wfs-ng?

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


Thanks, Justin. And thanks Gabriel for your detailed overview.

Justin, while complex support is unfunded at this time, I am happy with the selection of wfs-ng as the base for development as it keeps the complex-support door open as a future upgrade path.

Kind regards,
Ben.

On 20/03/14 07:02, Justin Deoliveira wrote:

Ok, so it looks wfs-ng is the way to go.

[...]

@Ben: Support for complex features would be on your dime :slight_smile:

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

On Thu, Mar 20, 2014 at 12:02 AM, Justin Deoliveira <
jdeolive@anonymised.com> wrote:

Ok, so it looks wfs-ng is the way to go. I think we will probably have
enough budget on this project to have Niels do the work that we need there
and implement some general clean up in order to get the module to supported
status. So in terms of things our client can fund we have:

1. Implementing transactional support for WFS 1.0 and WFS 1.1
2. Porting over tests from old module, in particular the ones to ensure we
work nicely with MapServer and TinyOWS
3. Push to supported status
4. WFS 2.0 (with transaction) support

Depending on how much time 1-3 take we may have to drop (4) but I think we
have a large enough chunk of hours to tackle all of it. But it sounds like
Sampo might be able to help out with (4) anyways.

@Ben: Support for complex features would be on your dime :slight_smile:

So do folks feel that is an acceptable plan? If so how do people want to
want to collaborate? Niels will start work immediately, not sure what
everyone else's timeline is.

Looking good to me! Not sure we have resources to help, but we'll keep an
eye for sure.

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,

Great to hear the WFS data store support is moving forward. It’s reassuring to know there are other clients pushing for improvements in this sector. However the timeframe of this work does worry me a bit. My client needs a working implementation by June. Looking at how much refactoring and retrofitting there is to do, it seems that getting all the puzzle pieces fitting together by then is not feasible. Or what do you think?

At the moment, the best route for my work seems to build only the stored query support on top of wfs-ng while keeping a keen eye on the parallel development Justin outlined earlier (the steps 1-4). Then merge the work once we’re all finished. The biggest danger in this approach is that we might end up with a WFS 2.0 implementation that only supports stored queries.

Just to be sure: Is it possible to run both wfs and wfs-ng data stores in GeoServer, or does the entire server have to go with either one?

Sampo

···

On Thu, Mar 20, 2014 at 1:02 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Ok, so it looks wfs-ng is the way to go. I think we will probably have enough budget on this project to have Niels do the work that we need there and implement some general clean up in order to get the module to supported status. So in terms of things our client can fund we have:

  1. Implementing transactional support for WFS 1.0 and WFS 1.1

  2. Porting over tests from old module, in particular the ones to ensure we work nicely with MapServer and TinyOWS

  3. Push to supported status

  4. WFS 2.0 (with transaction) support

Depending on how much time 1-3 take we may have to drop (4) but I think we have a large enough chunk of hours to tackle all of it. But it sounds like Sampo might be able to help out with (4) anyways.

@Ben: Support for complex features would be on your dime :slight_smile:

So do folks feel that is an acceptable plan? If so how do people want to want to collaborate? Niels will start work immediately, not sure what everyone else’s timeline is.

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 Wed, Mar 19, 2014 at 2:15 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hi Andrea,

thanks for the quick reply, comments inline.

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Wed, Mar 19, 2014 at 5:05 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

No you’re not wrong, my memory is. So, correction: the wfs 1.1 datastore uses custom hand written StAX code to parse GetFeature responses.

thanks!

There are 1.x strategies for CubeWerx, GeoServer_pre_2.0 (as in the geoserver version), Ionic, and MapServer. TinyOWS didn’t exist by then or I didn’t know about it.
No custom strategies for WFS 2.0 so far.

Cheers,
Gabriel

Gabriel Roldán

Software Developer | Boundless

groldan@anonymised.com

@gabrielroldan

On Wed, Mar 19, 2014 at 8:38 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hey sorry for the late reply,

The motivations to start wfs-ng were several:

  • wfs uses two different xml “technologies” for wfs 1.0 and wfs 1.1. The one used for 1.0 is legacy (gt-xml) and for 1.1 it uses the geotools gt-xsd framework.

Afaik 1.1 uses a custom hand written pull parser, but maybe it is just for parsing XML?
Also, I believe it was supposed to read semi-complex features (pass me the term, as in features a bit more complex than the flat ones we support normally)?
I have vague memories that you tried gt-xsd streaming parsing, but found it was not ready for production usage? Maybe I’m wrong

  • wfs also has two different DataStore implementations, for 1.0 based on the old AbstractDataStore, and for 1.1 being a pure interface implementation.
  • at the time of starting wfs-ng at least, it was difficult to create unit and integration tests without live servers, which is worse due to the fact that (all?) servers behave differently, and we have strategy objects to deal with each one’s oddities. Yet most tests needed to be online, and “reference” online servers tend to disappear or be unavailable.

So the idea behind wfs-ng was to have a wfs datastore implementation that could be more easily maintained and extended to newer protocol versions, with the following design goals:

  • there shall be one single WFSDataStore for all wfs versions, based on the new ContentDataStore “framework” the jdbc and other ones are based, given it’s the new “AbstractDataStore” which is practically deprecated.
  • All the xml I/O and parsing, and the differencies between versions, should be handled by the new gt-xsd framework, yet that should remain an implementation detail as far as the datastore is concerned
  • To keep building on top of existing code and enhance it instead of reinvent the wheel, the HTTP communication should be based on AbstractOpenWebService, on which also the wfs and aps clients are built.
  • Easy of testing is a must, minimizing or nullifying the need for actual online servers

So we ended up with:

ContentDataStore AbstractOpenWebService
^ ^
| |
| |
| |
WFSContentDataStore → WFSClient → WFSStrategy

/

/
/ ________
AbstractWFSStrategy → | gt-xsd |
| |________|
StrictWFS_1_x_Strategy ___|

StrictWFS_2_0_Strategy ___|

Nice ASCII art! (and nice design, too)

Where WFSContentDataStore talks to the WFSClient in “OWS” terms like “issueRequest()”, “issueTransaction()”, “getRemoteTypeNames()”, etc; WFSClient asks the WFSStrategy to parse and encode requests and responses, but takes care of all the http communication and translation between DataStore objects and WFS protocol specific terms.

As for how good the wfs XX support is, its incomplete by all means. I think I got as far as using it for read only WFS 1.0 and 1.1 queries. The major blocker to get good 2.0 support at the time was that the gt-xsd bindings for 2.0 were too lacking. This is probably due to the fact that there are separate bindings for geoserver and geotools, and the geoserver ones received more attention as they were really needed there, but since there was no 2.0 client in geotools they were left incomplete.

As for transaction support, all the bits are in mostly in there. The one difficulty I found I think was a difference on how JDBC stores manage transactions (as ContentDataStore was originally written to support the jdbc-ng stores and hence was biased) and what I needed to do to replicate. jdbc ones hold transaction state at the jdbc Connection level so at commit() they’re just good to go, but I needed to hold uncommitted state in the client on a per transaction basis, yet I found that difficult to achieve with the per-featureType “ContentState” ContentDataStore uses. But I was also close to a solution when the work stalled. The ways to look at are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore’s “transaction states” would give me per-feature state diffs, forcing me issue one transaction element per feature for updates and deletes instead of batched as the wfs protocol supports, and I was trying to “merge” them into less WFS transaction elements.

That is to say, if you wanted to implement WFS 2 transaction support, all you’d need to do is implement StrictWFS_2_0_Strategy.createTransactionRequest(TransactionRequest request), where TransactionRequest is a module’s own type, and return the org.eclipse.emf.ecore.EObject that would then be encoded to xml by WFSRequest, which is part of the AbstractOpenWebService framework. As said, almost all in there already, but some 2.0 emf bits and lots of tests.

One question, in terms of strategies, are the various MapServer/TinyOWS/Cubewerx/addYourOwnVariantHere implemented in wfs-ng?

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 Sampo,
not sure if you noticed, during the last PMC/PSC meeting we discussed a bit the design of a WFS 2.0 store using stored queries.

We discussed two possible approachies, a filter mapping based one, and a “view param” based one.

In the filter mapping based one, you have the administrator setup some mappings between the query parameters
and filters that might be incoming into the store. Basically, you have the admin tell you “if time=xyz” comes in,
the xyz is the value of param_time in the stored query.
For this to work there are a few restrictive conditions:

  • you have an attribute in your data that matches the time dimension
  • the parameter needs to express basically the same kind of filter

Another approach is to map the parameters just like view params in JDBC stores, that is, what we use
for parametric sql views.
Here you have no restrictions whatsoever, you can pass down whatever value you want, it can have
any meaning.
The issue is that you want one of the params to be exposed as a dimension. To do so, we’d need:

  • A way to list the possible values of the parameter, or have a new way to configure the dimensions
    that allows hand filling of the list of values (or hand fill a time range)
  • Make changes into GeoServer core to match a dimension value to a Hints.VIRTUAL_TABLE_PARAMETERS
    Query hint, so, basically a new kind of configuration that allows the binding between the two GUI and
    config wise, allows for a choice between binding with an exposed attribute (what we have today)
    and with a virtual table parameter. We’d also need to create some way for stores to generically advertise
    what the parameters are though, and what data type they are, something we miss today
    (maybe we can extend the QueryCapabilities object to suit the purpose).

Cheers
Andrea

···

On Thu, Mar 20, 2014 at 8:35 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

Great to hear the WFS data store support is moving forward. It’s reassuring to know there are other clients pushing for improvements in this sector. However the timeframe of this work does worry me a bit. My client needs a working implementation by June. Looking at how much refactoring and retrofitting there is to do, it seems that getting all the puzzle pieces fitting together by then is not feasible. Or what do you think?

At the moment, the best route for my work seems to build only the stored query support on top of wfs-ng while keeping a keen eye on the parallel development Justin outlined earlier (the steps 1-4). Then merge the work once we’re all finished. The biggest danger in this approach is that we might end up with a WFS 2.0 implementation that only supports stored queries.

Just to be sure: Is it possible to run both wfs and wfs-ng data stores in GeoServer, or does the entire server have to go with either one?

Sampo

==
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 Thu, Mar 20, 2014 at 1:02 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Ok, so it looks wfs-ng is the way to go. I think we will probably have enough budget on this project to have Niels do the work that we need there and implement some general clean up in order to get the module to supported status. So in terms of things our client can fund we have:

  1. Implementing transactional support for WFS 1.0 and WFS 1.1

  2. Porting over tests from old module, in particular the ones to ensure we work nicely with MapServer and TinyOWS

  3. Push to supported status

  4. WFS 2.0 (with transaction) support

Depending on how much time 1-3 take we may have to drop (4) but I think we have a large enough chunk of hours to tackle all of it. But it sounds like Sampo might be able to help out with (4) anyways.

@Ben: Support for complex features would be on your dime :slight_smile:

So do folks feel that is an acceptable plan? If so how do people want to want to collaborate? Niels will start work immediately, not sure what everyone else’s timeline is.

Sampo Savolainen
R&D Director, Spatineo Oy
sampo.savolainen@anonymised.com89…

+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 Wed, Mar 19, 2014 at 2:15 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hi Andrea,

thanks for the quick reply, comments inline.

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Wed, Mar 19, 2014 at 5:05 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

No you’re not wrong, my memory is. So, correction: the wfs 1.1 datastore uses custom hand written StAX code to parse GetFeature responses.

thanks!

There are 1.x strategies for CubeWerx, GeoServer_pre_2.0 (as in the geoserver version), Ionic, and MapServer. TinyOWS didn’t exist by then or I didn’t know about it.
No custom strategies for WFS 2.0 so far.

Cheers,
Gabriel

Gabriel Roldán

Software Developer | Boundless

groldan@anonymised.com

@gabrielroldan

On Wed, Mar 19, 2014 at 8:38 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hey sorry for the late reply,

The motivations to start wfs-ng were several:

  • wfs uses two different xml “technologies” for wfs 1.0 and wfs 1.1. The one used for 1.0 is legacy (gt-xml) and for 1.1 it uses the geotools gt-xsd framework.

Afaik 1.1 uses a custom hand written pull parser, but maybe it is just for parsing XML?
Also, I believe it was supposed to read semi-complex features (pass me the term, as in features a bit more complex than the flat ones we support normally)?
I have vague memories that you tried gt-xsd streaming parsing, but found it was not ready for production usage? Maybe I’m wrong

  • wfs also has two different DataStore implementations, for 1.0 based on the old AbstractDataStore, and for 1.1 being a pure interface implementation.
  • at the time of starting wfs-ng at least, it was difficult to create unit and integration tests without live servers, which is worse due to the fact that (all?) servers behave differently, and we have strategy objects to deal with each one’s oddities. Yet most tests needed to be online, and “reference” online servers tend to disappear or be unavailable.

So the idea behind wfs-ng was to have a wfs datastore implementation that could be more easily maintained and extended to newer protocol versions, with the following design goals:

  • there shall be one single WFSDataStore for all wfs versions, based on the new ContentDataStore “framework” the jdbc and other ones are based, given it’s the new “AbstractDataStore” which is practically deprecated.
  • All the xml I/O and parsing, and the differencies between versions, should be handled by the new gt-xsd framework, yet that should remain an implementation detail as far as the datastore is concerned
  • To keep building on top of existing code and enhance it instead of reinvent the wheel, the HTTP communication should be based on AbstractOpenWebService, on which also the wfs and aps clients are built.
  • Easy of testing is a must, minimizing or nullifying the need for actual online servers

So we ended up with:

ContentDataStore AbstractOpenWebService
^ ^
| |
| |
| |
WFSContentDataStore → WFSClient → WFSStrategy

/

/
/ ________
AbstractWFSStrategy → | gt-xsd |
| |________|
StrictWFS_1_x_Strategy ___|

StrictWFS_2_0_Strategy ___|

Nice ASCII art! (and nice design, too)

Where WFSContentDataStore talks to the WFSClient in “OWS” terms like “issueRequest()”, “issueTransaction()”, “getRemoteTypeNames()”, etc; WFSClient asks the WFSStrategy to parse and encode requests and responses, but takes care of all the http communication and translation between DataStore objects and WFS protocol specific terms.

As for how good the wfs XX support is, its incomplete by all means. I think I got as far as using it for read only WFS 1.0 and 1.1 queries. The major blocker to get good 2.0 support at the time was that the gt-xsd bindings for 2.0 were too lacking. This is probably due to the fact that there are separate bindings for geoserver and geotools, and the geoserver ones received more attention as they were really needed there, but since there was no 2.0 client in geotools they were left incomplete.

As for transaction support, all the bits are in mostly in there. The one difficulty I found I think was a difference on how JDBC stores manage transactions (as ContentDataStore was originally written to support the jdbc-ng stores and hence was biased) and what I needed to do to replicate. jdbc ones hold transaction state at the jdbc Connection level so at commit() they’re just good to go, but I needed to hold uncommitted state in the client on a per transaction basis, yet I found that difficult to achieve with the per-featureType “ContentState” ContentDataStore uses. But I was also close to a solution when the work stalled. The ways to look at are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore’s “transaction states” would give me per-feature state diffs, forcing me issue one transaction element per feature for updates and deletes instead of batched as the wfs protocol supports, and I was trying to “merge” them into less WFS transaction elements.

That is to say, if you wanted to implement WFS 2 transaction support, all you’d need to do is implement StrictWFS_2_0_Strategy.createTransactionRequest(TransactionRequest request), where TransactionRequest is a module’s own type, and return the org.eclipse.emf.ecore.EObject that would then be encoded to xml by WFSRequest, which is part of the AbstractOpenWebService framework. As said, almost all in there already, but some 2.0 emf bits and lots of tests.

One question, in terms of strategies, are the various MapServer/TinyOWS/Cubewerx/addYourOwnVariantHere implemented in wfs-ng?

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


Hey Sampo,

···

Our work in this area is going to be starting now but not really sure it will be ready to go for June… although I forecast good progress will be made. Although WFS 2.0 is going to be the last thing we get to chronologically.

What I suggest we do is both work on a branch for now to avoid stepping on each other in the short term.

-Justin

On Thu, Mar 20, 2014 at 1:35 AM, Sampo Savolainen <sampo.savolainen@anonymised.com> wrote:

Hi,

Great to hear the WFS data store support is moving forward. It’s reassuring to know there are other clients pushing for improvements in this sector. However the timeframe of this work does worry me a bit. My client needs a working implementation by June. Looking at how much refactoring and retrofitting there is to do, it seems that getting all the puzzle pieces fitting together by then is not feasible. Or what do you think?

At the moment, the best route for my work seems to build only the stored query support on top of wfs-ng while keeping a keen eye on the parallel development Justin outlined earlier (the steps 1-4). Then merge the work once we’re all finished. The biggest danger in this approach is that we might end up with a WFS 2.0 implementation that only supports stored queries.

Just to be sure: Is it possible to run both wfs and wfs-ng data stores in GeoServer, or does the entire server have to go with either one?

Sampo

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Thu, Mar 20, 2014 at 1:02 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Ok, so it looks wfs-ng is the way to go. I think we will probably have enough budget on this project to have Niels do the work that we need there and implement some general clean up in order to get the module to supported status. So in terms of things our client can fund we have:

  1. Implementing transactional support for WFS 1.0 and WFS 1.1

  2. Porting over tests from old module, in particular the ones to ensure we work nicely with MapServer and TinyOWS

  3. Push to supported status

  4. WFS 2.0 (with transaction) support

Depending on how much time 1-3 take we may have to drop (4) but I think we have a large enough chunk of hours to tackle all of it. But it sounds like Sampo might be able to help out with (4) anyways.

@Ben: Support for complex features would be on your dime :slight_smile:

So do folks feel that is an acceptable plan? If so how do people want to want to collaborate? Niels will start work immediately, not sure what everyone else’s timeline is.

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 Wed, Mar 19, 2014 at 2:15 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hi Andrea,

thanks for the quick reply, comments inline.

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

On Wed, Mar 19, 2014 at 5:05 PM, Andrea Aime <andrea.aime@anonymised.com…> wrote:

No you’re not wrong, my memory is. So, correction: the wfs 1.1 datastore uses custom hand written StAX code to parse GetFeature responses.

thanks!

There are 1.x strategies for CubeWerx, GeoServer_pre_2.0 (as in the geoserver version), Ionic, and MapServer. TinyOWS didn’t exist by then or I didn’t know about it.
No custom strategies for WFS 2.0 so far.

Cheers,
Gabriel

Gabriel Roldán

Software Developer | Boundless

groldan@anonymised.com

@gabrielroldan

On Wed, Mar 19, 2014 at 8:38 PM, Gabriel Roldan <groldan@anonymised.com> wrote:

Hey sorry for the late reply,

The motivations to start wfs-ng were several:

  • wfs uses two different xml “technologies” for wfs 1.0 and wfs 1.1. The one used for 1.0 is legacy (gt-xml) and for 1.1 it uses the geotools gt-xsd framework.

Afaik 1.1 uses a custom hand written pull parser, but maybe it is just for parsing XML?
Also, I believe it was supposed to read semi-complex features (pass me the term, as in features a bit more complex than the flat ones we support normally)?
I have vague memories that you tried gt-xsd streaming parsing, but found it was not ready for production usage? Maybe I’m wrong

  • wfs also has two different DataStore implementations, for 1.0 based on the old AbstractDataStore, and for 1.1 being a pure interface implementation.
  • at the time of starting wfs-ng at least, it was difficult to create unit and integration tests without live servers, which is worse due to the fact that (all?) servers behave differently, and we have strategy objects to deal with each one’s oddities. Yet most tests needed to be online, and “reference” online servers tend to disappear or be unavailable.

So the idea behind wfs-ng was to have a wfs datastore implementation that could be more easily maintained and extended to newer protocol versions, with the following design goals:

  • there shall be one single WFSDataStore for all wfs versions, based on the new ContentDataStore “framework” the jdbc and other ones are based, given it’s the new “AbstractDataStore” which is practically deprecated.
  • All the xml I/O and parsing, and the differencies between versions, should be handled by the new gt-xsd framework, yet that should remain an implementation detail as far as the datastore is concerned
  • To keep building on top of existing code and enhance it instead of reinvent the wheel, the HTTP communication should be based on AbstractOpenWebService, on which also the wfs and aps clients are built.
  • Easy of testing is a must, minimizing or nullifying the need for actual online servers

So we ended up with:

ContentDataStore AbstractOpenWebService
^ ^
| |
| |
| |
WFSContentDataStore → WFSClient → WFSStrategy

/

/
/ ________
AbstractWFSStrategy → | gt-xsd |
| |________|
StrictWFS_1_x_Strategy ___|

StrictWFS_2_0_Strategy ___|

Nice ASCII art! (and nice design, too)

Where WFSContentDataStore talks to the WFSClient in “OWS” terms like “issueRequest()”, “issueTransaction()”, “getRemoteTypeNames()”, etc; WFSClient asks the WFSStrategy to parse and encode requests and responses, but takes care of all the http communication and translation between DataStore objects and WFS protocol specific terms.

As for how good the wfs XX support is, its incomplete by all means. I think I got as far as using it for read only WFS 1.0 and 1.1 queries. The major blocker to get good 2.0 support at the time was that the gt-xsd bindings for 2.0 were too lacking. This is probably due to the fact that there are separate bindings for geoserver and geotools, and the geoserver ones received more attention as they were really needed there, but since there was no 2.0 client in geotools they were left incomplete.

As for transaction support, all the bits are in mostly in there. The one difficulty I found I think was a difference on how JDBC stores manage transactions (as ContentDataStore was originally written to support the jdbc-ng stores and hence was biased) and what I needed to do to replicate. jdbc ones hold transaction state at the jdbc Connection level so at commit() they’re just good to go, but I needed to hold uncommitted state in the client on a per transaction basis, yet I found that difficult to achieve with the per-featureType “ContentState” ContentDataStore uses. But I was also close to a solution when the work stalled. The ways to look at are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore’s “transaction states” would give me per-feature state diffs, forcing me issue one transaction element per feature for updates and deletes instead of batched as the wfs protocol supports, and I was trying to “merge” them into less WFS transaction elements.

That is to say, if you wanted to implement WFS 2 transaction support, all you’d need to do is implement StrictWFS_2_0_Strategy.createTransactionRequest(TransactionRequest request), where TransactionRequest is a module’s own type, and return the org.eclipse.emf.ecore.EObject that would then be encoded to xml by WFSRequest, which is part of the AbstractOpenWebService framework. As said, almost all in there already, but some 2.0 emf bits and lots of tests.

One question, in terms of strategies, are the various MapServer/TinyOWS/Cubewerx/addYourOwnVariantHere implemented in wfs-ng?

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


Hello Gabriel,

I have been working on enabling transactions in wfs-ng.

On 19/03/14 20:38, Gabriel Roldan wrote:

As for transaction support, all the bits are in mostly in there. The one difficulty I found I think was a difference on how JDBC stores manage transactions (as ContentDataStore was originally written to support the jdbc-ng stores and hence was biased) and what I needed to do to replicate. jdbc ones hold transaction state at the jdbc Connection level so at commit() they're just good to go, but I needed to hold uncommitted state in the client on a per transaction basis, yet I found that difficult to achieve with the per-featureType "ContentState" ContentDataStore uses. But I was also close to a solution when the work stalled. The ways to look at are the WFSLocalTransactionState and WFSRemoteTransactionState classes.
And IIRC the problem I was facing was that ContentDataStore's "transaction states" would give me per-feature state diffs, forcing me issue one transaction element per feature for updates and deletes instead of batched as the wfs protocol supports, and I was trying to "merge" them into less WFS transaction elements.

I have found that the code in wfs-ng that handles the transactions actually works quite well, but most issues to get it to work have to do with xsd encoding being incomplete (will get back to that).
However, I had to uncomment a lot of code that you put on "revisit" (as well as make some other minor changes). I wanted to ask to you why these were commented in the first place and if there are other issues I should be aware of.
Stuff like this:

   //remoteStateKeeper.watch(localTransactionState);

Look here for more examples:
https://github.com/NielsCharlier/geotools/commit/bcb2ceb372dcb6fd7b11eda14ac6c01c29ec310c

Does this make sense to you or am I missing some major issues? It seems to work to me.

So far I have been able to get INSERT and DELETE work (except for the fact that I get a weird IOException in the OWS module trying to write to a closed log at the end, still need to find out what that's about).

Like I said, I mostly have difficulties with the xsd stuff. I had to complete some of the parsing of the GetCapabilities document, because otherwise wfs-ng would think transactions are not supported because it reads incomplete info from capabilities document. I had a problem that the encoder was using the toString method of QName which gave a {namespace}name syntax and couldn't be put back to a proper property name by the wfs server.

But the biggest problem is in the encoding of the value of the UPDATE transaction.
Basically, this value can be *anything*. It doesn't have any xsd type. It can be a geometry encoded in GML, or just a string, or whatever.
Because it has no type, it does not have a binding and the encoder does not know to for example encode the geometry to GML code. I don't really know how to solve this problem
I can make a binding class with the property itself but then do what in the encode method? Call a new encoder ?
I don't know if anyone knows other examples of this kind of xsd situation and can give me any suggestions on how to solve this problem.

Regards
Niels

On Fri, Mar 28, 2014 at 12:02 PM, Niels Charlier <niels@anonymised.com> wrote:

But the biggest problem is in the encoding of the value of the UPDATE
transaction.
Basically, this value can be *anything*. It doesn't have any xsd type. It
can be a geometry encoded in GML, or just a string, or whatever.
Because it has no type, it does not have a binding and the encoder does
not know to for example encode the geometry to GML code. I don't really
know how to solve this problem
I can make a binding class with the property itself but then do what in
the encode method? Call a new encoder ?
I don't know if anyone knows other examples of this kind of xsd situation
and can give me any suggestions on how to solve this problem.

It's not really "anything", it's the property type of the property you just
specified to be updated.
Wondering if this can be solved by having a custom EncoderDelegate that
knows about the properties
type (which if I read the code correctly, might work by putting the
EncoderDelegate in place of the
values to be encoded in the UpdateType... but I may be way off)

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

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