[gdal-dev] featureCollection within a featureCollection
Even Rouault
even.rouault at spatialys.com
Mon Aug 31 02:00:42 PDT 2020
Wendell,
> I'm having trouble parsing some GML via Python/ogr and would like some
> advice.
>
> The GML has as the top level a FeatureCollection which has 3
> featureMembers. However, each of those featureMembers contains a
> FeatureCollection within it containing any number of featureMembers.
>
> While parsing, each of the featureMembers has a dict of elements, and
> the values of that featureMembers' keys is a list of the values of each
> of the "sub-featureMember"s attributes. That's good so far, but I'm not
> able to retrieve the geometry for the sub-featureMembers.
>
> How do I use Python ogr to parse a FeatureCollection within a
> FeatureCollection? Does a ResetReading() somehow reset something so
> that the inner members get processed correctly?
This is a so called "complex features" model. The GML driver cannot handle that natively. If
this GML file has its associated XML schemas, I'd suggest you use the GMLAS driver instead:
https://gdal.org/drivers/vector/gmlas.html
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200831/63bb56cf/attachment-0001.html>
More information about the gdal-dev
mailing list