Closed pathmapper closed 2 years ago
This happens because GDAL (OGR) doesn't know the geometry type until it encounters the first feature with a geometry (which is the second one in your sample file), so it discards the first feature.
If you invert the second and the first features it works as expected:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.deegree.org/xplanung/1/0 https://xplanservicesq.rz.krzn.de/xplansyn-wfs/services/xplansynwfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=DescribeFeatureType&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&TYPENAME=xplan:FP_BebauungsFlaeche&NAMESPACES=xmlns(xplan,http%3A%2F%2Fwww.deegree.org%2Fxplanung%2F1%2F0)" xmlns:wfs="http://www.opengis.net/wfs/2.0" timeStamp="2022-09-14T13:24:46Z" xmlns:gml="http://www.opengis.net/gml/3.2" numberMatched="unknown" numberReturned="0">
<!--NOTE: numberReturned attribute should be 'unknown' as well, but this would not validate against the current version of the WFS 2.0 schema (change upcoming). See change request (CR 144): https://portal.opengeospatial.org/files?artifact_id=43925.-->
<wfs:member>
<xplan:FP_BebauungsFlaeche xmlns:xplan="http://www.deegree.org/xplanung/1/0" gml:id="XPLAN_FP_BEBAUUNGSFLAECHE_7892f214-7554-4d52-aa7f-4b250b4d4f6e">
<xplan:gmlId>XPLAN_FP_BEBAUUNGSFLAECHE_7892f214-7554-4d52-aa7f-4b250b4d4f6e</xplan:gmlId>
<xplan:position>
<!--Inlined geometry 'XPLAN_FP_BEBAUUNGSFLAECHE_7892f214-7554-4d52-aa7f-4b250b4d4f6e_XPLAN_POSITION'-->
<gml:Polygon gml:id="XPLAN_FP_BEBAUUNGSFLAECHE_7892f214-7554-4d52-aa7f-4b250b4d4f6e_XPLAN_POSITION" srsName="EPSG:25832">
<gml:exterior>
<gml:LinearRing>
<gml:posList>326475.876 5694450.665 326475.781 5694451.124 326466.788 5694449.251 326453.960 5694446.550 326441.796 5694443.989 326435.627 5694442.688 326435.491 5694442.659 326439.354 5694418.982 326442.578 5694399.220 326443.390 5694394.229 326444.556 5694387.072 326445.041 5694384.094 326445.784 5694379.530 326447.328 5694370.048 326455.720 5694368.206 326456.679 5694367.996 326462.137 5694366.902 326474.932 5694365.391 326478.853 5694365.261 326483.570 5694365.104 326490.525 5694366.056 326496.581 5694367.483 326500.266 5694368.352 326508.953 5694370.866 326530.543 5694377.115 326532.331 5694378.060 326533.563 5694379.563 326534.191 5694381.520 326534.061 5694384.019 326525.438 5694419.593 326483.968 5694411.814 326475.876 5694450.665</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</xplan:position>
</xplan:FP_BebauungsFlaeche>
</wfs:member>
<wfs:member>
<xplan:FP_BebauungsFlaeche xmlns:xplan="http://www.deegree.org/xplanung/1/0" gml:id="XPLAN_FP_BEBAUUNGSFLAECHE_cc4f50a8-a2e7-4c5c-bc5d-c5b82d5079b0">
<xplan:gmlId>XPLAN_FP_BEBAUUNGSFLAECHE_cc4f50a8-a2e7-4c5c-bc5d-c5b82d5079b0</xplan:gmlId>
</xplan:FP_BebauungsFlaeche>
</wfs:member>
</wfs:FeatureCollection>
@rouault do you have a clue about a possible fix?
What is the bug or the crash?
GML import is missing one feature without geometry.
There are 1759 features in total, but one feature without geometry is not shown for the import dialog:
Steps to reproduce the issue
Drag'n'drop the following GML into QGIS: xplansynwfs-4.zip
The following feature is missing (the first one in the document):
Versions
Active Python plugins sagaprovider | 2.12.99 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99 db_manager | 0.1.20
Supported QGIS version
New profile
Additional context
No response