Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create contours from geotiff raster with gdal_contour. My output format is Postgresql and I would like to ovewrite the existing table.

When I do:
gdal_contour -a 1 -f PostgreSQL -i 50 -nln new_isolines dem.tif "PG:host=localhost port=5432 dbname=mybase user=postgres password=postgres"
I get:
ERROR 1: Layer new_isolines already exists, CreateLayer failed. Use the layer creation option OVERWRITE=YES to replace it.

But when I do:
gdal_contour -a 1 -f PostgreSQL -lco OVERWRITE=YES -i 50 -nln new_isolines dem.tif "PG:host=localhost port=5432 dbname=mybase user=postgres password=postgres"
I get a wrong usage message.

I know I can do it with ALTER/DROP table in my db prior to contouring with gdal, but that's unconvenient, because I want to set some more layer creation options:
So how do I set theese options in gdal_contour utility?

share|improve this question
I think you cannot have both -lco and -nln is the same command. – Micha Feb 6 '13 at 13:57
Maybe so, but removing -nln doesn't let me put -lco – nextstopsun Feb 6 '13 at 14:18
Did you put the -loc param multiple times for each of the options? – Micha Feb 7 '13 at 19:19
Sure, doesn't work anyway. – nextstopsun Feb 8 '13 at 17:32
up vote 2 down vote accepted

This bug was fixed in r25643.

share|improve this answer

Your Answer


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.