Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OGR GMLAS driver uses bbox instead of actual feature geometry #9367

Closed
pathmapper opened this issue Mar 1, 2024 · 2 comments
Closed

OGR GMLAS driver uses bbox instead of actual feature geometry #9367

pathmapper opened this issue Mar 1, 2024 · 2 comments

Comments

@pathmapper
Copy link
Contributor

pathmapper commented Mar 1, 2024

Looks like #7925 but for GMLAS.

Actual behavior

BBOXes are used as feature geometries:

image

Steps to reproduce the problem.

Add the following WFS to QGIS >= v3.36.0
https://geodienste.komm.one/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs

FeatureType: xplan:BP_Bereich

Operating system

Ubuntu 22.04.3 LTS

GDAL version and provenance

GDAL 3.9.0dev-d7aed6e0b0 self built, QGIS master

@rouault
Copy link
Member

rouault commented Mar 1, 2024

BBOXes are used as feature geometries:

I don't confirm that on GDAL side:

$ curl "https://geodienste.komm.one/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAME=xplan:BP_Bereich&COUNT=5" > out.gml
$ ogrinfo GMLAS:out.gml bp_bereich
INFO: Open of `GMLAS:out.gml'
      using driver `GMLAS' successful.

Layer name: bp_bereich
Geometry: Unknown (any)
Feature Count: 5
Layer SRS WKT:
(unknown)
Geometry Column = geltungsbereich
id: String (0.0) NOT NULL
description: String (0.0)
descriptionreference_href: String (0.0)
descriptionreference_title: String (0.0)
descriptionreference_nilreason: String (0.0)
identifier_codespace: String (0.0)
identifier: String (0.0)
nummer: Integer (0.0) NOT NULL
xplan_name: String (0.0)
bedeutung: String (0.0)
detailliertebedeutung: String (0.0)
erstellungsmassstab: Integer (0.0)
rasterbasis_owns: Integer(Boolean) (0.0) DEFAULT 'false'
rasterbasis_href: String (0.0)
rasterbasis_title: String (0.0)
rasterbasis_nilreason: String (0.0)
rasterbasis_pkid: String (0.0)
versionbaunvodatum: Date NOT NULL
versionbaunvotext: String (0.0) NOT NULL
versionbaugbdatum: Date
versionbaugbtext: String (0.0)
versionsonstrechtsgrundlagedatum: Date
versionsonstrechtsgrundlagetext: String (0.0)
gehoertzuplan_owns: Integer(Boolean) (0.0) DEFAULT 'false'
gehoertzuplan_href: String (0.0)
gehoertzuplan_title: String (0.0)
gehoertzuplan_nilreason: String (0.0)
gehoertzuplan_pkid: String (0.0)
OGRFeature(bp_bereich):1
  id (String) = GML_ef210da4-61e4-11ea-a968-005056b8384f
  nummer (Integer) = 0
  xplan_name (String) = Geissbühl
  detailliertebedeutung (String) = 01 urschrift 0
  rasterbasis_owns (Integer(Boolean)) = 0
  rasterbasis_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_ef2134b0-61e4-11ea-b0af-005056b8384f#GML_ef2134b0-61e4-11ea-b0af-005056b8384f
  versionbaunvodatum (Date) = 1968/11/26
  versionbaunvotext (String) = BauNVO 1968, in Kraft getreten am 01.01.1969
  gehoertzuplan_owns (Integer(Boolean)) = 0
  gehoertzuplan_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_ef210da3-61e4-11ea-966c-005056b8384f#GML_ef210da3-61e4-11ea-966c-005056b8384f

OGRFeature(bp_bereich):2
  id (String) = GML_1ac1d4e5-1846-11eb-b0df-005056b8384f
  nummer (Integer) = 0
  xplan_name (String) = Ortskern Nordhausen; 1. Änderung
  detailliertebedeutung (String) = 213  0
  rasterbasis_owns (Integer(Boolean)) = 0
  rasterbasis_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_1ac1fbf0-1846-11eb-8fc6-005056b8384f#GML_1ac1fbf0-1846-11eb-8fc6-005056b8384f
  versionbaunvodatum (Date) = 2017/11/21
  versionbaunvotext (String) = BauNVO 2017, in Kraft getreten am 13.05.2017
  gehoertzuplan_owns (Integer(Boolean)) = 0
  gehoertzuplan_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_1ac1d4e4-1846-11eb-a03f-005056b8384f#GML_1ac1d4e4-1846-11eb-a03f-005056b8384f

OGRFeature(bp_bereich):3
  id (String) = GML_d1a31453-e2f6-11eb-b4e6-005056b8384f
  nummer (Integer) = 0
  xplan_name (String) = Wohnen am Auerberg
  detailliertebedeutung (String) = 89 0 None
  rasterbasis_owns (Integer(Boolean)) = 0
  rasterbasis_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_d1a33b61-e2f6-11eb-9cc0-005056b8384f#GML_d1a33b61-e2f6-11eb-9cc0-005056b8384f
  versionbaunvodatum (Date) = 2017/11/21
  versionbaunvotext (String) = BauNVO 2017, in Kraft getreten am 13.05.2017
  gehoertzuplan_owns (Integer(Boolean)) = 0
  gehoertzuplan_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_d1a31452-e2f6-11eb-849f-005056b8384f#GML_d1a31452-e2f6-11eb-849f-005056b8384f

OGRFeature(bp_bereich):4
  id (String) = GML_ef0f8174-61e4-11ea-8c26-005056b8384f
  nummer (Integer) = 0
  xplan_name (String) = Geissbühl, 1. Änderung
  detailliertebedeutung (String) = 02 aenderung 0
  rasterbasis_owns (Integer(Boolean)) = 0
  rasterbasis_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_ef0fcf8f-61e4-11ea-85cc-005056b8384f#GML_ef0fcf8f-61e4-11ea-85cc-005056b8384f
  versionbaunvodatum (Date) = 1968/11/26
  versionbaunvotext (String) = BauNVO 1968, in Kraft getreten am 01.01.1969
  gehoertzuplan_owns (Integer(Boolean)) = 0
  gehoertzuplan_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_ef0f8173-61e4-11ea-a221-005056b8384f#GML_ef0f8173-61e4-11ea-a221-005056b8384f

OGRFeature(bp_bereich):5
  id (String) = GML_eefe6a74-61e4-11ea-aa1a-005056b8384f
  nummer (Integer) = 0
  xplan_name (String) = Geissbühl, 2. Änderung
  detailliertebedeutung (String) = 03 aenderung 0
  rasterbasis_owns (Integer(Boolean)) = 0
  rasterbasis_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_eefeb88f-61e4-11ea-be12-005056b8384f#GML_eefeb88f-61e4-11ea-be12-005056b8384f
  versionbaunvodatum (Date) = 1968/11/26
  versionbaunvotext (String) = BauNVO 1968, in Kraft getreten am 01.01.1969
  gehoertzuplan_owns (Integer(Boolean)) = 0
  gehoertzuplan_href (String) = https://geodienste.komm.one:443/ows/services/org.322.8409140a-b47b-4bd7-bd4a-805d3408f4ce_wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&STOREDQUERY_ID=urn:ogc:def:query:OGC-WFS::GetFeatureById&ID=GML_eefe6a73-61e4-11ea-8ea6-005056b8384f#GML_eefe6a73-61e4-11ea-8ea6-005056b8384f

The issue is more on QGIS side. When we issue the IsPoint, IsCurve, IsSurface, etc. requests, they all return numberMatched="106", and so the QGIS WFS provider doesn't know the geometry type, hence it fallbacks to downloading one feature to guess the geometry type for it, and the GML parser returns the bounding box as the geometry. As far as I can see this dates back to loooong time ago: qgis/QGIS@a98ed43#diff-97d80211f278f3347456e679476521d2794acfe1a8780233904a07a62a12079b . That said, I'd see it more as a feature as a bug: at least you get some geometry. Normally, if those features had a feature in the dedicated "geltungsbereich" geometry field, it should take precedence over the bounding box

@pathmapper
Copy link
Contributor Author

Thanks for investigating 👍

if those features had a feature in the dedicated "geltungsbereich" geometry field, it should take precedence over the bounding box

Agreed that it's a feature we might want to keep. The only thing is that a user may expect that these are the actual feature geometries.

Let's close this and if someone else raises it, it could be opened on QGIS side and discussed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants