We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf21015 commit 098ca00Copy full SHA for 098ca00
themes/external/download-and-import.sh
@@ -61,13 +61,14 @@ import() {
61
local file="$3"
62
local inlayer="$4"
63
64
- ogr2ogr -f PostgreSQL "PG:dbname=$db" -overwrite -nln "$layer" \
+ ogr2ogr -f PostgreSQL "PG:dbname=$db" -overwrite -nln "${layer}_new" \
65
-lco GEOMETRY_NAME=geom \
66
-lco FID=id \
67
-sql 'select "_ogr_geometry_" from '"$inlayer" \
68
"/vsizip/$file.zip/$file"
69
70
- psql --quiet -d "$DB" -c "ANALYZE $layer;"
+ psql --quiet -d "$DB" -c "ANALYZE ${layer}_new;"
71
+ psql --quiet -d "$DB" -c "BEGIN; DROP TABLE IF EXISTS $layer; ALTER TABLE ${layer}_new RENAME TO $layer; COMMIT;"
72
}
73
74
import_dataset() {
0 commit comments