I want import data from my GDB to PostGIS. It works fine on some datasets (all records -data- is imported or nothing is imported) from a gdb but just doesn't import others. I can't find any documentation on why from sites like http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet

So I have ogr2ogr -f "PostgreSQL" -a_srs "EPSG:4283" PG:"dbname=tp_test user=postgres port=54321 password=XXXXXXXXXXX host=localhost" d:/scratch/arcgis/scratch.gdb

It only seems to report errors but if it works then you just get the command line again. When I check the postgis database, some of the datasets from the gdb are imported and others aren't. They are all in the same EPSG.

Any ideas?

This is part of a larger script/tool that I have already written to read my mxd's, export and georeference the data to a single format, save the style layer, convert it to SLD and ideally the next step is to save it to a postGIS database. This can then be used in Geoserver with the correct ESRI symbology. See Converting ArcGIS style (symbology) to font for MapInfo/OpenGeo?

  • ogr2ogr has a -skipfailures option. You can also try Repair Geometry from within ArcGIS before running ogr2ogr.
    – klewis
    Commented Jul 19, 2012 at 17:57
  • the issue is not that it reports failures but that it just "seems" to run and some datasets aren't imported into the dataset. I can't output them as shp and then import into postgis as the dataset is to large for the shp format. So is there a way for ogr2ogr to output it's process so that we can see where the issue is?
    – GeorgeC
    Commented Jul 23, 2012 at 1:16
  • @GeorgeC Did You find a solution/explanation? It seems I am stuck at the same point: Some imports work and others fail silently. Jan
    – user9401
    Commented Aug 8, 2012 at 15:43
  • @Jan sorry no luck yet. please post any solutions you work out.
    – GeorgeC
    Commented Aug 8, 2012 at 23:03
  • 1
    @GeorgeC the skipped datasets must have something in common with each other. Are they attribute tables without shape data? Are they all Polygon datasets? ..can you possibly share the one of them with us so we can experiment? Off the cuff, you might try adding -nlt "geometry" to the end of your command (it allows multi geoms and single geoms to be stored in the same table), but if it's skipping entire datasets I'm not certain that will help.
    – elrobis
    Commented Sep 20, 2012 at 14:18

1 Answer 1


Could you check if the records that weren't imported all have valid data? This sounds similar to the behavior exhibited by QGIS at this thread. In that thread, QGIS stops importing once it encounters a record with invalid data. As QGIS uses GDAL/OGR too, I'm guessing it's exhibiting similar behavior here. Granted, this is a file geodatabase while the one in the other thread is a personal geodatabase. GDAL's reaction looks eerily similar though. It's worth investigating.

  • No records were imported. The issues is that some datasets aren't imported and thus don't exist in the postgis at all.
    – GeorgeC
    Commented Sep 20, 2012 at 9:54
  • 1
    Is there anything common to the datasets that weren't imported?
    – R.K.
    Commented Sep 20, 2012 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.