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?