Repairing invalid geometries
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32
- Forks
- 8
- Avg merge
- 13m
- Merged PRs (30d)
- 1
Description
It's fairly common to find geometries with topology errors.
A GEOS TopologyException is thrown due to the polygon rings overlapping and various other common errors.
It's possible to leverage GEOS or RTTOPO to attempt to repair these geometries.
The challenge will be ensuring that the correct libraries are available and that spatialite is compiled correctly to enable them.
The functionality is exposed in SQL via commands such as SanitizeGeometry() and MakeValid().
I'm not 100% confident that this will be easy to achieve on MacOS, although I've got it working on Linux before, so it might end up being a docker-only thing.
This would be super-useful for some sources (such as OSM) where the internal data-model is not handled by a spatial database which enforces topological validity, or for datasets which are format-shifted and incur errors during that conversion.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by inspecting the build and dependency configuration for spatialite, GEOS, and RTTOPO, then trace how SQL functions are exposed. Define support across Linux and macOS, and verify that invalid geometries can be repaired through the proposed SanitizeGeometry() or MakeValid() commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100