prepair—pronounce ‘pee-repair’ as in ‘polygon repair’—permits us to easily repair ‘broken’ GIS polygons according to the international standards ISO19107 (Geographic information—Spatial schema) and OGC Simple Feature. Given one input polygon (or a MultiPolygon), it automatically repairs it and returns back a valid polygon (actually a MultiPolygon since the input can represent more than one polygon, think of a ‘bowtie’ for instance).
It is an open-source project released under the GPL licence. We offer here a simplified version: only the WKT of a polygon (or MultiPolygon) can be given as input, and it is repaired with an extension of the odd-even algorithm to handle GIS polygons containing inner rings and degeneracies. Also, only rather small WKT are supported.
Most of the details of the implementation are available in this scientific article:
If you encounter a bug, please report it on the issue page.