From 7d3d936340b90727d3027d818db02edecd98d48c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 14 Apr 2022 09:23:47 +0100 Subject: [PATCH] remove changes --- etl/load_geometries.sh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/etl/load_geometries.sh b/etl/load_geometries.sh index 18cfca63..a2febe8b 100755 --- a/etl/load_geometries.sh +++ b/etl/load_geometries.sh @@ -12,21 +12,11 @@ mastermap_dir=$1 # source_id: , # geom: -echo "Creating temporary geometries table for input data..." -psql -c "CREATE TABLE IF NOT EXISTS release_geometries ( - geometry_id serial PRIMARY KEY, - source_id varchar(30), - geometry_geom geometry(GEOMETRY, 3857) -);" - echo "Copy geometries to db..." find $mastermap_dir -type f -name '*.3857.csv' \ -printf "$mastermap_dir/%f\n" | \ parallel \ -cat {} '|' psql -c "\"COPY release_geometries ( geometry_geom, source_id ) FROM stdin WITH CSV HEADER;\"" - -# Copy release_geometries into existing geometries table -psql -c "INSERT INTO geometries ( geometry_geom, source_id ) SELECT geometry_geom, source_id FROM release_geometries;" +cat {} '|' psql -c "\"COPY geometries ( geometry_geom, source_id ) FROM stdin WITH CSV HEADER;\"" # Delete any duplicated geometries (by TOID) echo "Delete duplicate geometries..."