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'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:
OVERWRITE=YES
GEOMETRY_NAME=wgsgeom
FID=id
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
add comment

1 Answer 1

up vote 2 down vote accepted

This bug was fixed in r25643.

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.