-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Qgspolyhedralsurface fix is valid #59057
base: master
Are you sure you want to change the base?
Conversation
When validating a line, `QgsGeometryValidator` checks in particular that there are no duplicate nodes by calling `QgsGeometry::duplicateNodes`. However, this method does not handle the 3D component of a line by default. This issue is fixed by activating the `useZValues` flag is the line is 3D.
GEOS isValid is not able to properly handle 3D polygons.. With @lbartoletti, we found this solution to use QGIS geometry validator instead. However, It seems wrong to create a |
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
`QgsPolyhedralSurface::isValid` checks that all its polygon are valid with GEOS. However, GEOS is not able to properly handle 3D polygons because it drops the Z component. For example, "Polygon Z((0 0 0,0 0 7,0 5 7,0 5 0,0 0 0))" is wrongly considered as an invalid polygon because it contains duplicate nodes when the Z component is dropped. This issue is fixed by calling QGIS internal geometry validator which is able to handle 3D polygons. Fixes: 721b045
ed9e761
to
e3d25a7
Compare
Can we take a step back and look at the use case here? What are you using isValid for? Because the most common use of this function is testing whether a geometry is safe to use BY GEOS, eg for an intersection test. So I'm concerned about hacking this and reporting true in cases where this will break that common use case. Maybe we need extra flags for the function to specify whether we are working in a 2.5d model or 3d model.... |
You're right. I should have explained it in the first place. At the moment, some processing algorithms from this plugin fail because At this point, I think it would be easier to just always return |
@ptitjano ok, thanks for the info! Here's how this should be handled:
Some other things to note:
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
@ptitjano what's the status here? This looks stale to me. Can we close? |
I'm still working on it. |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
Description
QgsPolyhedralSurface::isValid
checks that all its polygon are validwith GEOS. However, GEOS is not able to properly handle 3D polygons
because it drops the Z component.
For example, "Polygon Z((0 0 0,0 0 7,0 5 7,0 5 0,0 0 0))" is
wrongly considered as an invalid polygon because it contains duplicate
nodes when the Z component is dropped.
This issue is fixed by calling QGIS internal geometry validator which
is able to handle 3D polygons.
Fixes: 721b045