Is there an option in OGR2OGR to repair geometry when importing data to PostGIS?

by Pil Kwon   Last Updated December 07, 2017 10:22 AM

this is related to one of my questions here Invalid Geometry in PostGIS but Valid in FGDB

If I could, I want to repair geometry while I am importing my data to PostGIS. So I wrote this code below on OSgeo4W Shell

ogr2ogr -overwrite -progress -f "PostgreSQL" PG:"host=localhost port=5432 dbname=test user=test password=test" D:\FGDB_Edit\OCEAN.gdb -lco GEOMETRY_NAME=shape -t_srs EPSG:3857 -nln ocean_repair -dialect sqlite -sql "select ST_MakeValid(Shape) as geometry, * from ocean_boundary"

and it gives me this error enter image description here

have you experienced this before? and have any solutions?

Related Questions

Convert esriGeometryPolyline to GeoJSON

Updated September 28, 2018 10:22 AM

ogr2ogr CAD file to postgres

Updated June 12, 2017 13:22 PM

Loading GML data into Postgres - No geom!

Updated March 31, 2017 14:22 PM