3👍
I don’t know that this will fix your hole error necessarily, but I have had luck eliminating self-intersecting geoms by performing a 0-width buffer:
p = p.buffer(0)
0👍
The ST_MakeValid
function is unfortunately not using a geos function, but is a custom function in PostGIS’ own liblwgeom library.
I am not aware of any python bindings for liblwgeom, so if you want to call that function, you would have to do your own binding with ctypes. See this similar question for inspiration.
But if any method is good enough, I was also successful just using buffer(0)
, as suggested by in spatialbits’ answer.
Source:stackexchange.com