-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Stop considering Rectangle(0,0,0,0) null - while Rectangle(1,1,1,1) is not null #54646
Conversation
8b19439
to
a60739f
Compare
Difference spotted is again an Empty vs. Null difference, in tests/src/core/testqgslabelingengine.cpp:947 : (testRegisterFeatureUnprojectible) [1ms] vl2->extent(): Null vl2->extent() prints as Empty in master branch, as Null in the branch associated with this PR Honestly I don't know what the correct answer should be, as vl2 is a QgsVectorLayer started empty. An EMPTY Rectangle is defined as being a rectangle with no area (a point, at this moment, which I'd also extend to a line). But an empty layer cannot have a point information in it. I start wondering if we really need the distinction between EMPTY and NULL, for a rectangle. |
Ok the Null vs. Empty is a non-issue as it's just an improved distinction output in the branch associated with this PR. Master would never print Null, always Empty, even for Null rectangles. |
Next issue is with a WMS test of QGIS server that expects a GetFeatureInfoResponse having this bounding box:
We're now outputting the -inf,+inf bounding box instead. The question is: what is expected as a BoundingBox for a response with an empty bounding box ? The file in question is https://github.com/qgis/QGIS/blob/master/tests/testdata/qgis_server/get_postgres_types_json_list.txt @elpaso should we just omit the BoundingBox tag when the box is null ? What is the reference spec ? |
I've filed PR #54858 to address the null BoundingBox in WMS output |
76a8ee9
to
0ff14a1
Compare
I don't understand the "testExtent" test from tests/src/python/providertestbase.py:
How is assigning the "reference" local variable expected to affects self.source.extent() ? |
baf8156
to
87b7dad
Compare
This was suggested by Benoit in qgis#54646 (comment) It may make it easier to spot missing isNull() checks by callers.
Expose these methods: - referenceExtent() - referenceSubsetString3Extent()
Construct a proper null rectangle by default. Make sure a Null rectangle is always also considered Empty. Print Null rectangle as Null, still print details of Empty rectangles. Update expected QgsRectangle::toString output on Null rectangle Includes unit tests Closes qgisGH-45563
Nyall since this is now working, and has the default QgsRectangle constructor construct a null rectangle, should I re-move the ::createNull() in this PR ? I'd lean toward yes :) |
Woohoo! Nice work @strk! |
This was suggested by Benoit in qgis#54646 (comment)
This was suggested by Benoit in qgis#54646 (comment)
According to the WFS 1.1.0 specs "The <WGS84BoundingBox> element is used to indicate the edges of an enclosing rectangle in decimal degrees of latitude and longitude in WGS84" but the expected behavior is not specified when the data are empty. Up to QGIS 3.32, QGIS server returned: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>0 0</ows:LowerCorner> <ows:UpperCorner>0 0</ows:UpperCorner> ``` However, as a side effect of a change in `QGSRectangle` (see: qgis#54646), QGIS server now returns since the 3.34 version: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>inf inf</ows:LowerCorner> <ows:UpperCorner>-inf -inf</ows:UpperCorner> ``` This changes restores the QGIS 3.32 behavior.
According to the WFS 1.1.0 specs "The <WGS84BoundingBox> element is used to indicate the edges of an enclosing rectangle in decimal degrees of latitude and longitude in WGS84" but the expected behavior is not specified when the data are empty. Up to QGIS 3.32, QGIS server returned: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>0 0</ows:LowerCorner> <ows:UpperCorner>0 0</ows:UpperCorner> ``` However, as a side effect of a change in `QGSRectangle` (see: qgis#54646), QGIS server now returns since the 3.34 version: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>inf inf</ows:LowerCorner> <ows:UpperCorner>-inf -inf</ows:UpperCorner> ``` This changes restores the QGIS 3.32 behavior.
According to the WFS 1.1.0 specs "The <WGS84BoundingBox> element is used to indicate the edges of an enclosing rectangle in decimal degrees of latitude and longitude in WGS84" but the expected behavior is not specified when the data are empty. Up to QGIS 3.32, QGIS server returned: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>0 0</ows:LowerCorner> <ows:UpperCorner>0 0</ows:UpperCorner> ``` However, as a side effect of a change in `QGSRectangle` (see: #54646), QGIS server now returns since the 3.34 version: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>inf inf</ows:LowerCorner> <ows:UpperCorner>-inf -inf</ows:UpperCorner> ``` This changes restores the QGIS 3.32 behavior.
According to the WFS 1.1.0 specs "The <WGS84BoundingBox> element is used to indicate the edges of an enclosing rectangle in decimal degrees of latitude and longitude in WGS84" but the expected behavior is not specified when the data are empty. Up to QGIS 3.32, QGIS server returned: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>0 0</ows:LowerCorner> <ows:UpperCorner>0 0</ows:UpperCorner> ``` However, as a side effect of a change in `QGSRectangle` (see: #54646), QGIS server now returns since the 3.34 version: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>inf inf</ows:LowerCorner> <ows:UpperCorner>-inf -inf</ows:UpperCorner> ``` This changes restores the QGIS 3.32 behavior.
According to the WFS 1.1.0 specs "The <WGS84BoundingBox> element is used to indicate the edges of an enclosing rectangle in decimal degrees of latitude and longitude in WGS84" but the expected behavior is not specified when the data are empty. Up to QGIS 3.32, QGIS server returned: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>0 0</ows:LowerCorner> <ows:UpperCorner>0 0</ows:UpperCorner> ``` However, as a side effect of a change in `QGSRectangle` (see: #54646), QGIS server now returns since the 3.34 version: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>inf inf</ows:LowerCorner> <ows:UpperCorner>-inf -inf</ows:UpperCorner> ``` This changes restores the QGIS 3.32 behavior.
According to the WFS 1.1.0 specs "The <WGS84BoundingBox> element is used to indicate the edges of an enclosing rectangle in decimal degrees of latitude and longitude in WGS84" but the expected behavior is not specified when the data are empty. Up to QGIS 3.32, QGIS server returned: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>0 0</ows:LowerCorner> <ows:UpperCorner>0 0</ows:UpperCorner> ``` However, as a side effect of a change in `QGSRectangle` (see: #54646), QGIS server now returns since the 3.34 version: ``` <ows:WGS84BoundingBox dimensions="2"> <ows:LowerCorner>inf inf</ows:LowerCorner> <ows:UpperCorner>-inf -inf</ows:UpperCorner> ``` This changes restores the QGIS 3.32 behavior.
This was suggested by Benoit in qgis#54646 (comment)
Superceeds GH-53323
Aims at closing GH-45563