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

QGIS Server WFS 1.1.0 GetFeature response - properties with xsi:nil="true" #45243

Closed
2 tasks done
pathmapper opened this issue Sep 24, 2021 · 5 comments
Closed
2 tasks done
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@pathmapper
Copy link
Contributor

What is the bug or the crash?

First of all, it's not sure if this is a bug.

@pblottiere asked in #45138 (comment) to create an issue about this topic and assign it to him.

This has been posted on the dev-list before:

Hi,

for a property with NULL value, QGIS Server WFS 1.1.0 includes this property with xsi:nil="true" in the response XML.

I noticed this, because other WFS server software is omitting these properties with NULL values.

Having a dataset with lots of features and properties with NULL values, the data size of the XML response document increases significantly (loading and processing times !) with these xsi:nil="true" properties compared to omitting and not including them in the XML response.

After digging a lot trough OGC specs, mailing lists, and gh issues I still didn’t find an answer to the questions

a) if QGIS Server is complying to the WFS 1.1.0 spec doing so
and
b) why QGIS Server is doing this?

According to [1] omitting the properties “is by design, as it's a WFS specification“. Unfortunately the mentioned link to a thread on an OGC mailing list isn‘t working anymore (nabble.com shut down).

Would be great if someone can give an insight.

Cheers,
Bjoern

[1] https://stackoverflow.com/a/25507256

Steps to reproduce the issue

Serve any data with QGIS Server WFS 1.1.0 containing NULL value for a property/attribute:

test_project_and_data.zip

grafik

https://geo.kreis-viersen.de/ows/test-null-values?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&TYPENAME=test_layer&SRSNAME=EPSG:4326

grafik

Versions

QGIS Server 3.20.3 / master

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

Serving xsi:nil="true" in GetFeature has been introduced in 71e0116.

@pathmapper pathmapper added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 24, 2021
@pblottiere pblottiere self-assigned this Sep 24, 2021
@pblottiere
Copy link
Member

I took a look on the WFS 1.x specification but I didn't find anything about properties with NULL values (I probably missed it :/).

However, @aaime addressed this particular point in this thread https://geoserver-users.narkive.com/jQu7ahV7/why-the-wfs-does-not-return-the-null-value-field 13 years ago:


It should also be noted that this behavior is mandated by the WFS spec specification. GML and WFS explicitly avoid the use of "xs:nil" which would allow for the inclusion of elements with null values.


So I'm going to prepare a PR for fixing that in QGIS Server.

@aaime
Copy link
Contributor

aaime commented Oct 10, 2022

13 years is a long time, I don't remember. Googling for the topic I've found this page on the topic, which states "The nil="true" pattern was introduced in GML v3.2" ... GML 3.2 is used in WFS 2.0. So I've looked at the GML 3.1 specification, and found no mention of using nil.
I don't remember what was going on back then, and I might just have been wrong... you might want to double check with Clemens Portele and Peter Vretanos.

@pathmapper
Copy link
Contributor Author

Thanks @pblottiere, @aaime

"The nil="true" pattern was introduced in GML v3.2" ... GML 3.2 is used in WFS 2.0. So I've looked at the GML 3.1 specification, and found no mention of using nil.

This sounds like nil shouldn't be used with GML < 3.2.

Currently QGIS Server advertises that it returns GML 3.1.1 and includes elements with xsi:nil="true":

https://geo.kreis-viersen.de/ows/test-null-values?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&TYPENAME=test_layer&SRSNAME=EPSG:4326

grafik

@pblottiere
Copy link
Member

@aaime thanks a lot for your input here! And I know that 13 years is a long time, but for now your post is the only valuable input I found on the subject :/.

"The nil="true" pattern was introduced in GML v3.2" ... GML 3.2 is used in WFS 2.0. So I've looked at the GML 3.1 specification, and found no mention of using nil.

This sounds like nil shouldn't be used with GML < 3.2.

Currently QGIS Server advertises that it returns GML 3.1.1 and includes elements with xsi:nil="true":

@pathmapper I agree, especially that WFS 2.0 is not supported by QGIS Server...

@pblottiere
Copy link
Member

Fixed with #51453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants