2

Try enforcing closed LineStrings by adding their ST_StartPoint to the end of the them: SELECT ST_MakePolygon( ST_MakeValid( ST_AddPoint( shape. ST_StartPoint( shape ) ) ) ) AS shape FROM asia_waterway_line WHERE waterway ='riverbank' ; If you want to make sure you are not duplicating points for when a LineString is already closed, run: SELECT ...


Only top voted, non community-wiki answers of a minimum length are eligible