On 05/11/15 00:30, Andrea Aime wrote: > So you are talking about complex features? If that's the case, most likely > not, we have the code to encode complex features, but not to parse them.
Matteo, there is support in GeoTools for complex feature parsing in gt-wfs-ng, the new generation WFS client: https://github.com/geotools/geotools/wiki/complexfeature-parsing-and-building-support This implementation is intended to do just what you want: consume complex feature services and create Java GeoAPI objects that conform to the information model. I found it to be a bit broken and in need of work. Depending on your information model, it may or may not work for you as is or with a small amount of work. Historical notes: https://github.com/geotools/geotools/pull/841 https://osgeo-org.atlassian.net/browse/GEOT-4147 I have never used wfs-ng, but there are some nice examples of parsing complex features in this unit test: https://github.com/geotools/geotools/blob/master/modules/unsupported/wfs-ng/src/test/java/org/geotools/data/wfs/internal/parsers/XmlComplexFeatureParserTest.java I tried to get it to work with a real GeoSciML 2 Borehole but ran into problems that suggest the implementation is incomplete: https://github.com/bencaradocdavies/geotools/commit/9e8d9c22d1f3ddfd0b180f7f53dae17457be9786 https://github.com/bencaradocdavies/geotools/commits/complex-feature-wfs-client-example Here is my bug report: [GEOT-5246] Complex feature WFS client fails to parse nested features https://osgeo-org.atlassian.net/browse/GEOT-5246 See also the off-list discussion below. Kind regards, Ben. -------- Forwarded Message -------- Subject: Re: Complex feature parsing and building in 14.0 Date: Fri, 9 Oct 2015 16:56:41 +1300 From: Ben Caradoc-Davies <[email protected]> To: Jody Garnett <[email protected]> Jody, tl;dr: no complex feature WFS client announcement for 14.0 as it is b0rked I just spent most of today trying to get a complex feature WFS client example working against real services, unfortunately without success. In addition to some defects such as incorrect handling of maxFeatures, there appears to be something wrong with the parsing of some nested features. Some other complex properties appear to work, but the feature builder chokes when unparsed properties required by the schema are absent. I suspect that this may be a bit of work to fix. This is an ambitious piece of work, and perhaps 80-90% there, but not yet done. [GEOT-5246] Complex feature WFS client fails to parse nested features https://osgeo-org.atlassian.net/browse/GEOT-5246 I think we will have to ignore this new feature for any 14.0 release announcement as it is not yet ready for real work. Kind regards, Ben. ------ [...] ------ -- Ben Caradoc-Davies <[email protected]> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
