optionally repair broken/invalid geometries#138
Merged
missinglink merged 1 commit intomasterfrom Nov 12, 2025
Merged
Conversation
Member
Author
|
These operations are quite noisy since RTTOPO outputs warnings for broken geometries. There are in fact a lot of errors in the WOF data, mostly winding errors and intersection errors such as these: GEOS warning: Ring Self-intersection at or near point 5.0343859999999996 52.344605999999999
GEOS warning: Ring Self-intersection at or near point 5.0540279999999997 52.541148
GEOS warning: Ring Self-intersection at or near point 5.0240309999999999 52.600085
GEOS warning: Ring Self-intersection at or near point 3.7195610000000001 51.527552999999997
GEOS warning: Self-intersection at or near point 4.4982452727272646 51.906334999999999
GEOS warning: Self-intersection at or near point -75.491668000000004 -14.928178000000001 |
Member
Author
|
Running repair operation on WOF data yields some interesting cases such as this feature which is converted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new import flag which runs either
MakeValidorGeosMakeValidto repair broken/invalid geometries.The feature can be enabled using a flag on the command-line when importing data such as:
spatial import --tweak_module_geometry_repair=2 sourceSupported values are
0=none, 1=MakeValid, 2=GeosMakeValidI would like to experiment a bit more with this feature before considering enabling it by default, for very broken geometries it will potentially do things like convert polygons to linestrings, which may or may not be desirable.
ref: https://www.gaia-gis.it/gaia-sins/spatialite-sql-5.1.0.html#MakeValid