OVERWRITE=YES does not delete PostGIS table
Pirmin Kalberer
sp_ml at SOURCEPOLE.COM
Wed Jan 18 13:47:56 EST 2006
I couldn't get a bugzilla login, so I post this here:
OVERWRITE=YES does not delete PostGIS table
------------------------------------------------------------
$ogr2ogr -f PostgreSQL PG:dbname=warmerda world_adm0.shp -lco OVERWRITE=YES -nlt MULTIPOLYGON
FAILED: Layer world_adm0 already exists, and -append not specified.
Consider using -append, or predeleting the layer.
ERROR 1: Terminating translation prematurely after failed
translation of layer world_adm0
After dropping the table:
$ogr2ogr -f PostgreSQL PG:dbname=warmerda world_adm0.shp -lco OVERWRITE=YES -nlt MULTIPOLYGON
$ogrinfo PG:dbname=warmerda -ro -so world_adm0 | grep -e "Layer name" -e "Feature Count"
Layer name: world_adm0
Feature Count: 209
In combination with with -append:
$ogr2ogr -f PostgreSQL PG:dbname=warmerda world_adm0.shp -append -lco OVERWRITE=YES -nlt MULTIPOLYGON
$ogrinfo PG:dbname=warmerda -ro -so world_adm0 | grep -e "Layer name" -e "Feature Count"
Layer name: world_adm0
Feature Count: 418
ogr2ogr documentation:
-append is working without -update, but the documentation of ogr2ogr says:
"Example appending to an existing layer (both flags need to be used):
% ogr2ogr -update -append -f PostgreSQL PG:dbname=warmerda abc.tab"
Versions:
ogr2ogr from CVS (18.1.06)
PostGIS:
PostgreSQL 8.0.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
POSTGIS="1.0.4" GEOS="1.0.0" USE_STATS DBPROC="0.3.0" RELPROC="0.3.0"
--
Pirmin Kalberer
Sourcepole - Linux & Open Source Solutions
http://www.sourcepole.com
More information about the mapserver-dev
mailing list