1

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.

ogr2ogr -skipfailures -lco OVERWRITE=yes --config PG_USE_COPY YES -gt 50000 -lco LAUNDER=NO -f "PostgreSQL" PG:"host=xxxx user=xxxx dbname=xxxx password=xxxx" "buildingpart.gml" -sql "select * from buildingpart where OGR_GEOMETRY = 'MULTIPOLYGON'" -nln test.buildingpart_multipolygon_selection

ogr2ogr -skipfailures -lco OVERWRITE=yes --config PG_USE_COPY YES -gt 50000 -lco LAUNDER=NO -f "PostgreSQL" PG:"host=xxxx user=xxxx dbname=xxxx password=xxxx" "buildingpart.gml" -sql "select * from buildingpart where OGR_GEOMETRY = 'POINT'" -nln test.buildingpart_point_selection

Unfortunately without result.

Is anyone familiar with this problem of multiple geometry in GML. And is there a solution?

<?xml version="1.0" encoding="UTF-8"?>
<CityModel xmlns:gml="http://www.opengis.net/gml"
                xmlns:imgeo="http://www.geostandaarden.nl/imgeo/2.1"
                xmlns:lu="http://www.opengis.net/citygml/landuse/2.0"
                xmlns:tra="http://www.opengis.net/citygml/transportation/2.0"
                xmlns:tun="http://www.opengis.net/citygml/tunnel/2.0"
                xmlns:veg="http://www.opengis.net/citygml/vegetation/2.0"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns:wat="http://www.opengis.net/citygml/waterbody/2.0"
                xmlns:bri="http://www.opengis.net/citygml/bridge/2.0"
                xmlns:bui="http://www.opengis.net/citygml/building/2.0"
                xmlns:cif="http://www.opengis.net/citygml/cityfurniture/2.0"
                xmlns="http://www.opengis.net/citygml/2.0"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:schemaLocation="http://www.geostandaarden.nl/imgeo/2.1 http://schemas.geonovum.nl/imgeo/2.1/imgeo-2.1.1.xsd"><cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B4843EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2014-01-21</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e18660393856e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000015950</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="6">178913.520 525128.784 178907.630 525127.150 178909.736 525119.688 178915.401 525121.259 178915.554 525121.301 178913.520 525128.784</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak><imgeo:nummeraanduidingreeks><imgeo:Nummeraanduidingreeks><imgeo:nummeraanduidingreeks><imgeo:Label><imgeo:tekst>16</imgeo:tekst><imgeo:positie><imgeo:Labelpositie><imgeo:plaatsingspunt><gml:Point srsName="urn:ogc:def:crs:EPSG::28992"><gml:pos>178911.348 525126.313</gml:pos></gml:Point></imgeo:plaatsingspunt><imgeo:hoek>-15.5</imgeo:hoek></imgeo:Labelpositie></imgeo:positie></imgeo:Label></imgeo:nummeraanduidingreeks><imgeo:identificatieBAGVBOLaagsteHuisnummer>0171010000018912</imgeo:identificatieBAGVBOLaagsteHuisnummer></imgeo:Nummeraanduidingreeks></imgeo:nummeraanduidingreeks></BuildingPart></cityObjectMember><cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B4943EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2014-01-21</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e18660393c36e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000031928</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="5">179008.703 525138.457 179009.717 525134.804 179011.853 525135.398 179010.835 525139.051 179008.703 525138.457</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak></BuildingPart></cityObjectMember><cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B4A43EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2014-01-21</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e18660393c96e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000031915</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="5">179015.484 525077.419 179016.323 525074.452 179021.459 525075.865 179020.641 525078.838 179015.484 525077.419</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak></BuildingPart></cityObjectMember>

                <cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B4B43EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2014-01-21</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e18660393da6e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000031742</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="5">178987.139 525126.996 178982.103 525125.598 178982.976 525122.550 178987.987 525123.941 178987.139 525126.996</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak></BuildingPart></cityObjectMember>

                <cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B4C43EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2014-01-21</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e18660393a76e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000015791</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="5">178993.057 525086.392 178986.903 525084.692 178988.800 525077.657 178994.951 525079.357 178993.057 525086.392</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak><imgeo:nummeraanduidingreeks><imgeo:Nummeraanduidingreeks><imgeo:nummeraanduidingreeks><imgeo:Label><imgeo:tekst>34</imgeo:tekst><imgeo:positie><imgeo:Labelpositie><imgeo:plaatsingspunt><gml:Point srsName="urn:ogc:def:crs:EPSG::28992"><gml:pos>178990.230 525083.743</gml:pos></gml:Point></imgeo:plaatsingspunt><imgeo:hoek>-15.5</imgeo:hoek></imgeo:Labelpositie></imgeo:positie></imgeo:Label></imgeo:nummeraanduidingreeks><imgeo:identificatieBAGVBOLaagsteHuisnummer>0171010000011904</imgeo:identificatieBAGVBOLaagsteHuisnummer></imgeo:Nummeraanduidingreeks></imgeo:nummeraanduidingreeks></BuildingPart></cityObjectMember>

                <cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B5EB3EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2013-11-06</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e18660394ff6e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000011384</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="11">180142.660 524667.117 180142.150 524670.110 180135.483 524668.977 180135.516 524668.781 180135.901 524668.847 180136.976 524662.535 180143.262 524663.576 180146.328 524663.980 180145.954 524666.155 180145.700 524667.645 180142.660 524667.117</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak><imgeo:nummeraanduidingreeks><imgeo:Nummeraanduidingreeks><imgeo:nummeraanduidingreeks><imgeo:Label><imgeo:tekst>13</imgeo:tekst><imgeo:positie><imgeo:Labelpositie><imgeo:plaatsingspunt><gml:Point srsName="urn:ogc:def:crs:EPSG::28992"><gml:pos>180139.027 524665.918</gml:pos></gml:Point></imgeo:plaatsingspunt><imgeo:hoek>80.3</imgeo:hoek></imgeo:Labelpositie></imgeo:positie></imgeo:Label></imgeo:nummeraanduidingreeks><imgeo:identificatieBAGVBOLaagsteHuisnummer>0171010000011411</imgeo:identificatieBAGVBOLaagsteHuisnummer></imgeo:Nummeraanduidingreeks></imgeo:nummeraanduidingreeks></BuildingPart></cityObjectMember><cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B5FB3EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2014-01-27</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e18660395576e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000021150</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="9">179916.313 526704.152 179919.782 526694.301 179925.317 526696.305 179924.508 526698.558 179927.449 526699.615 179925.085 526706.196 179922.181 526705.153 179921.829 526706.133 179916.313 526704.152</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak><imgeo:nummeraanduidingreeks><imgeo:Nummeraanduidingreeks><imgeo:nummeraanduidingreeks><imgeo:Label><imgeo:tekst>13</imgeo:tekst><imgeo:positie><imgeo:Labelpositie><imgeo:plaatsingspunt><gml:Point srsName="urn:ogc:def:crs:EPSG::28992"><gml:pos>179921.453 526697.720</gml:pos></gml:Point></imgeo:plaatsingspunt><imgeo:hoek>-20</imgeo:hoek></imgeo:Labelpositie></imgeo:positie></imgeo:Label></imgeo:nummeraanduidingreeks><imgeo:identificatieBAGVBOLaagsteHuisnummer>0171010000014019</imgeo:identificatieBAGVBOLaagsteHuisnummer></imgeo:Nummeraanduidingreeks></imgeo:nummeraanduidingreeks></BuildingPart></cityObjectMember><cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B60B3EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2013-11-27</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e186603951f6e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000013543</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="7">180027.753 524894.546 180023.108 524894.059 180018.526 524893.578 180019.863 524881.265 180028.706 524882.207 180029.007 524882.239 180027.753 524894.546</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak><imgeo:nummeraanduidingreeks><imgeo:Nummeraanduidingreeks><imgeo:nummeraanduidingreeks><imgeo:Label><imgeo:tekst>18-18B</imgeo:tekst><imgeo:positie><imgeo:Labelpositie><imgeo:plaatsingspunt><gml:Point srsName="urn:ogc:def:crs:EPSG::28992"><gml:pos>180020.480 524890.935</gml:pos></gml:Point></imgeo:plaatsingspunt><imgeo:hoek>-6.1</imgeo:hoek></imgeo:Labelpositie></imgeo:positie></imgeo:Label></imgeo:nummeraanduidingreeks><imgeo:identificatieBAGVBOLaagsteHuisnummer>0171010000032655</imgeo:identificatieBAGVBOLaagsteHuisnummer><imgeo:identificatieBAGVBOHoogsteHuisnummer>0171010000015372</imgeo:identificatieBAGVBOHoogsteHuisnummer></imgeo:Nummeraanduidingreeks></imgeo:nummeraanduidingreeks></BuildingPart></cityObjectMember><cityObjectMember><BuildingPart xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="A23E12F79B61B3EE4E0531F0B5B0AB389"><creationDate xmlns="http://www.opengis.net/citygml/2.0">2013-12-12</creationDate><imgeo:identificatie><imgeo:NEN3610ID><imgeo:namespace>NL.IMGeo</imgeo:namespace><imgeo:lokaalID>G0171.0e186603952f6e9ce0540012799ed965</imgeo:lokaalID></imgeo:NEN3610ID></imgeo:identificatie><imgeo:relatieveHoogteligging>0</imgeo:relatieveHoogteligging><imgeo:LV-publicatiedatum>2015-11-06T00:58:34.000</imgeo:LV-publicatiedatum><imgeo:inOnderzoek>false</imgeo:inOnderzoek><imgeo:tijdstipRegistratie>2015-07-08T13:18:24.000</imgeo:tijdstipRegistratie><imgeo:bgt-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#Status">bestaand</imgeo:bgt-status><imgeo:plus-status codeSpace="http://www.geostandaarden.nl/imgeo/def/2.1#VoidReasonValue">geenWaarde</imgeo:plus-status><imgeo:bronhouder>G0171</imgeo:bronhouder><imgeo:identificatieBAGPND>0171100000015634</imgeo:identificatieBAGPND><imgeo:geometrie2dGrondvlak><gml:MultiSurface srsName="urn:ogc:def:crs:EPSG::28992"><gml:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList srsDimension="2" count="14">179606.841 525097.033 179603.783 525096.248 179603.875 525095.890 179601.035 525095.160 179599.656 525100.531 179593.206 525098.875 179594.471 525093.948 179593.670 525093.743 179594.189 525091.719 179604.265 525094.312 179604.694 525092.615 179604.795 525092.224 179607.855 525093.009 179606.841 525097.033</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></imgeo:geometrie2dGrondvlak><imgeo:nummeraanduidingreeks><imgeo:Nummeraanduidingreeks><imgeo:nummeraanduidingreeks><imgeo:Label><imgeo:tekst>24</imgeo:tekst><imgeo:positie><imgeo:Labelpositie><imgeo:plaatsingspunt><gml:Point srsName="urn:ogc:def:crs:EPSG::28992"><gml:pos>179596.864 525096.289</gml:pos></gml:Point></imgeo:plaatsingspunt><imgeo:hoek>75.6</imgeo:hoek></imgeo:Labelpositie></imgeo:positie></imgeo:Label></imgeo:nummeraanduidingreeks><imgeo:identificatieBAGVBOLaagsteHuisnummer>0171010000015907</imgeo:identificatieBAGVBOLaagsteHuisnummer></imgeo:Nummeraanduidingreeks></imgeo:nummeraanduidingreeks></BuildingPart></cityObjectMember></CityModel>
  • Which GDAL version do you have (ogrinfo --version)? Could you share a complete but small sample of data? – user30184 Dec 10 '15 at 10:29
  • I am using GDAL 1.11.3, released 2015/09/16. At the bottom of the post I have shared a small sample of the data. – Stefan Dec 10 '15 at 10:32
  • Your ogr2ogr commands in a way work for me with GDAL trunk version (2.1). However, only 6 points and 3 multipolygons are found. I believe that GDAL reports the last geometry that is identifies gdal.org/drv_gml.html. It might be possible to edit the .gfs file so that two geometries are found but unfortunately I do not know how. – user30184 Dec 10 '15 at 12:03
  • I have been looking at the .GFS-file as well, but I do not know how I can edit this in a way that both geometries are taken. Does someone know this? – Stefan Dec 16 '15 at 9:34
  • GDAL developers should know and they follow gdal-dev mailing list. – user30184 Dec 16 '15 at 10:29
2

I have asked the question on the GDAL-dev mailing list and got an answer and this worked for me. Here it is:

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 ... ]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.