Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to export a lot of data from a PostGIS database to a File Geodatabase.

The command I used to use was

ogr2ogr -progress -append -f "FileGDB" -gt 66536 -sql "SELECT * FROM line" C:\Temp\data.gdb  PG:"host=localhost user=postgres password=xxx dbname=xxx" -nln Line -nlt LINESTRING -a_srs "EPSG:4326" 

This took 34 minutes.

In the 1.9.2 release of GDAL which I am using OSGeo4W there is a new switch to bulk load data into a File Geodatabase. So I changed my code to be

ogr2ogr --config FGDB_BULK_LOAD YES -progress -append -f "FileGDB" -gt 66536 -sql "SELECT * FROM line" C:\Temp\data.gdb  PG:"host=localhost user=postgres password=xxx dbname=xxx" -nln Line -nlt LINESTRING -a_srs "EPSG:4326"

And this has no performance improvement at all.

I have run it several times with and without the other switches and still nothing seems to improve.

Has anyone got the Bulk Load working?

share|improve this question
add comment

1 Answer

I can see from the code that bulk load support has been in there since January 2012 which is many months before 1.9.2 was released. All bulk load does it to set the table to loadonly mode; this means the indexes are dropped, the bulk of the inserts happen, and then the indexes get rebuilt (when the table is taken out of the loadonly mode.

My guess is that your performance problem is not in the index generation but in either the serialization/deserialization of the rows as well as the data transfer between your database and your FileGDB.

How many rows are we talking about? Are there many rows with small geometries? Or small number of rows with monster geometries? Or both? What happens when you do the same export to say, shapefiles?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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