ST_ClipByBox2D raises an exception with unclosed polygon rings input
|Reported by:||strk||Owned by:||pramsey|
By contract ST_ClipByBox2D should never raise an exception. It does when fed polygons with unclosed rings. The problem is that the function is implemented in GEOS so the input geometry must be "convertible" even if not topologically valid.
I think the quickest way to fix this would be to add an optional parameter in the postgis-to-geos converter to allow automatically "fixing enough for geos to be happy" those geometries. There's code for that in the ST_MakeValid code path…