I have the following postgis query:
select st_pointonsurface(geometry), geometry, other, important, columns
from my_polygons;
After ~2.5m results there's a record where the function fails.
ERROR: GEOSPoint OnSurface: TopologyException:
Input geom 1 is invalid: Self-intersection at or near
point -9083598.0378282126 3646413.3039207752 at -9083598.0378282126 3646413.3039207752
Looking at the geometry, I can see why this fails. It's a bad polygon.
I would like to either
- ignore the row (filter it from the result set); or
- ignore the column (convert it to
nulland return the other columns).
How can I get either of these outcomes?