8

I am able to successfully run ogr2ogr to add S57 data to PostgresDB. The version I use is GDAL 1.7.0b2, FWTools 2.4.7 and release date 2010/01/19

I upgraded my version to GDAL 1.9.1 and release date 2012/05/16. When I run ogr2ogr on the same files, I get an error as follows

ERROR 1: Layer dsid already exists, CreateLayer failed.
Use the layer creation option OVERWRITE=YES to replace it.
ERROR 1: Terminating translation prematurely after failed
translation of layer DSID (use -skipfailures to skip errors)

Why would this happen when all things being equal? Is the latest version buggy?

2
  • Neither -overwrite not -lco OVERWRITE=YES nor --config OVERWRITE yes works! Sigh!
    – user57024
    Aug 20, 2015 at 17:21
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. Aug 20, 2015 at 18:35

1 Answer 1

9

It would appear that GDAL 1.9.1 (note that 1.9.2 is out now) does not allow creating on top of an existing layer. Perhaps the older version was more permissive.

Why not just try adding -lco OVERWRITE=YES to your ogr2ogr command if you don't mind replacing your existing tables in Postgres?

1
  • Thanks Frank. That seem to work without errors (but lots of warnings though). My database needs to get refreshed periodically based on S57 updates, so a complete overwrite is not a concern. Oct 29, 2012 at 15:18

Your Answer

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

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