[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.
Stefan,
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.
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>BuildingPart</Name>
<ElementPath>BuildingPart</ElementPath>
<SRSName>urn:ogc:def:crs:EPSG::28992</SRSName>
<!-- beginning of additions -->
<GeomPropertyDefn>
<Name>geometrie2dGrondvlak</Name>
<ElementPath>geometrie2dGrondvlak</ElementPath>
<Type>MultiPolygon</Type>
</GeomPropertyDefn>
<GeomPropertyDefn>
<Name>plaatsingspunt</Name>
<ElementPath>nummeraanduidingreeks|Nummeraanduidingreeks|nummeraanduidingreeks|Label|positie|Labelpositie|plaatsingspunt</ElementPath>
<Type>Point</Type>
</GeomPropertyDefn>
<!-- 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
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list