comparison db_schema/setup-db.sh @ 1076:4ce4bd48c260

Avoid repeating potentially lengthy download of shapefiles.
author Tom Gottfried <tom@intevation.de>
date Fri, 30 Sep 2016 18:32:48 +0200
parents 299f4ba86090
children 1d1c50b7a23b
comparison
equal deleted inserted replaced
1075:b5314ea024c6 1076:4ce4bd48c260
79 psql $DB_CONNECT_STRING -d $DB_NAME -f $DIR/lada_data.sql 79 psql $DB_CONNECT_STRING -d $DB_NAME -f $DIR/lada_data.sql
80 80
81 echo create user $ROLE_NAME 81 echo create user $ROLE_NAME
82 psql $DB_CONNECT_STRING -d $DB_NAME --command "CREATE SCHEMA geo AUTHORIZATION $ROLE_NAME" 82 psql $DB_CONNECT_STRING -d $DB_NAME --command "CREATE SCHEMA geo AUTHORIZATION $ROLE_NAME"
83 83
84 TS="0101" 84 TS="0101"
85 cd /tmp 85 cd /tmp
86 curl -O http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip && \ 86 if [ ! -f vg250_${TS}.utm32s.shape.ebenen.zip ]; then
87 curl -O \
88 http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip
89 fi
87 unzip vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*" 90 unzip vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*"
88 cd vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/ 91 cd vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/
89 shp2pgsql VG250_GEM geo.gem_utm | psql $DB_CONNECT_STRING -d $DB_NAME 92 shp2pgsql VG250_GEM geo.gem_utm | psql $DB_CONNECT_STRING -d $DB_NAME
90 cd /tmp 93 cd /tmp
91 rm -rf vg250_${TS}.utm32s.shape.ebenen* 94 rm -rf vg250_${TS}.utm32s.shape.ebenen
92 fi 95 fi
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)