Is there a method in shapely or a similar library that is exactly equivalent to postGIS method st_makevalid? As it stands, using .buffer(0) as recommended here is not enough. Are there any pure python implementations of this function? As it stands, I can access the postgis functions directly by binding from ctypes, but this is a cumbersome solution as I must compile and install from source. A better solution would be very welcome.
Asked
Active
Viewed 1,121 times
3
-
Can you explain why is `.buffer(0)` not sufficient. What is the limitation you find to it in your problem? – Eskapp Jun 20 '19 at 18:24
-
It will remove repeated points but not loops – sakurashinken Jun 20 '19 at 21:48
-
Shapely Polygons do not support loops as far as I know (if by loops you mean self-intersecting polygons). Did you check MultiPolygon in shapely? With this, you could have the loops represented as separate polygons and then do whichever processing you need. Each polygon in the MultiPolygon is valid. A graphical example would help a lot to understand your question. – Eskapp Jun 21 '19 at 12:30