[GIS] Geometry errors when importing data from ESRI file geodatabase to PostGIS

arcgis-desktopfile-geodatabasegeoserverogrpostgis

When I run the following command to import by data from an ESRI fgdb to postgis…

ogr2ogr -f "PostgreSQL" -a_srs "EPSG:28355" -t_srs "EPSG:3857" PG:"dbname=tp_test user=postgres port=54321 password=xxxxxxx host=localhost" -overwrite P:\2012\183_TownPlanning_Symbology\Working\QueryLayer\TP_Query_Final_28355.gdb

…I get…!

Warning 1: organizePolygons() received an unexpected geometry. Either
a polygon with interior rings, or a polygon with less than 4 points,
or a non-Polygon geometry. Return arguments as a collection. Warning
1: Geometry of polygon cannot be translated to Simple Geometry. All
poly gons will be contained in a multipolygon.

I have checked geometry in ESRI and it reports no errors. I am running multipart to singlepart to see if this resolves the issues but this is crashing arcmap 10.1 as is dissolve. It ran a sort without issues and you can open the dataset.

I successfully imported the dataset earlier but then had to run the ESRI Dice tool to split the large polygons to no more than 15,000 vertices so that it processes faster.
enter image description here

I am new to postgis.

Is there a way to correct the issues in the new gdb or to split the polygons in postgis itself?

Best Answer

If your data is already in PostGIS, try running:

select * from table where ST_NPoints(the_geom) < 4

This will return all rows that cause the warning, that is, it will help you track down data errors in PostGIS.