Feature request #16418
Geometry validity inconsistency between tools
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | - | ||
Category: | Geometry | ||
Pull Request or Patch supplied: | No | Resolution: | |
Easy fix?: | No | Copied to github as #: | 24327 |
Description
The Topology Validation tool and Check Validity algorithm return different results for self-touching polygons which define a (false) hole.
The difference is happening because Check Validity uses QgsGeometryValidator which calls GEOSisValidDetail_r with the GEOS GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE flag.
This kind of geometries are invalid for OGC, but tey're ok for others (e.g. for Esri). I think QGIS ahouls adhere to OGC strict rules to be consistent with other OGC compliant sw like Spatialite, PostGIS, etc.
The following polygon is an example where Topology Validator, Spatialite and PostGIS agree to be invalid, while it's ok for QgsGeometryValidator:
POLYGON ((200 400, 400 400, 400 200, 300 200, 350 250, 250 250, 300 200, 200 200, 200 400))
QgsGeometryValidator should not set the flag by default and leave it as an option to relax validation.
Associated revisions
[needs-docs][processing] Add option to check validity alg to ignore self-intersection
causing rings errors
By default the algorithm now uses the strict OGC definition of polygon validity, where
a polygon is marked as invalid if a self-intersecting ring causes an interior hole.
If the "Ignore ring self intersections" option is checked, then this rule will be
ignored and a more lenient validity check will be performed.
[needs-docs][processing] Add option to check validity alg to ignore self-intersection
causing rings errors
By default the algorithm now uses the strict OGC definition of polygon validity, where
a polygon is marked as invalid if a self-intersecting ring causes an interior hole.
If the "Ignore ring self intersections" option is checked, then this rule will be
ignored and a more lenient validity check will be performed.
(cherry picked from commit 49742c302afb97e6272ce8b6b3a806014cdbdb5b)
[needs-docs][processing] Add option to check validity alg to ignore self-intersection
causing rings errors
By default the algorithm now uses the strict OGC definition of polygon validity, where
a polygon is marked as invalid if a self-intersecting ring causes an interior hole.
If the "Ignore ring self intersections" option is checked, then this rule will be
ignored and a more lenient validity check will be performed.
(cherry picked from commit 49742c302afb97e6272ce8b6b3a806014cdbdb5b)
(cherry picked from commit 66cd7e93024f432a9ebd98258dee74ac49834d1f)
History
#1 Updated by Giovanni Manghi over 7 years ago
- Easy fix? set to No
#2 Updated by Nyall Dawson over 5 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|4e04d02293637923e065afba3f3b962249a9ca78.