7

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?

4
  • I think you cannot have both -lco and -nln is the same command.
    – Micha
    Commented Feb 6, 2013 at 13:57
  • Maybe so, but removing -nln doesn't let me put -lco Commented Feb 6, 2013 at 14:18
  • Did you put the -loc param multiple times for each of the options?
    – Micha
    Commented Feb 7, 2013 at 19:19
  • Sure, doesn't work anyway. Commented Feb 8, 2013 at 17:32

1 Answer 1

4

This bug was fixed in r25643.

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.