[gdal-dev] Fwd: Converting multi-geometry GML with ogr2ogr not working

Even Rouault even.rouault at spatialys.com
Wed Dec 16 08:31:33 PST 2015

Le mercredi 16 décembre 2015 12:05:23, Stefan van der Hoorn a écrit :
> All
> I am having difficulties with GML loading in PostGIS with ogr2ogr.
> It is a GML of buildingparts containing both polygons and (label)-points.
> In this example (below) I have a selection of 9 objects. The number of
> polygons is 9 and there are 6 point-objects. So there are 6 object with
> both polygon and point geometry.


By default when parsing a GML file without a side .xsd file (or if it cannot 
understand the .xsd file), the GML driver will only report the "last" geometry
element in a feature (should perhaps be improved, but that's another story).

You can manually workaround that by explictly define in the .gfs file that
OGR produces the first time it reads a GML file the following, which will define
explictly where to find geometries.


<!-- beginning of additions -->
<!-- end of additions -->
[... unmodified rest of file ... ]

This is documented in the "Syntax of .gfs file by example" section of http://gdal.org/drv_gml.html


Spatialys - Geospatial professional services

More information about the gdal-dev mailing list