Mercurial > lada > lada-server
changeset 1056:299f4ba86090
extend docker envireoment to load geographical data of german comunities
author | Michael Stanko <mstanko@bfs.de> |
---|---|
date | Wed, 28 Sep 2016 09:06:18 +0200 |
parents | 37952c111f71 |
children | 6d26e94b643e |
files | db_schema/Dockerfile db_schema/setup-db.sh db_schema/stammdaten_schema.sql |
diffstat | 3 files changed, 13 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/db_schema/Dockerfile Wed Sep 28 08:48:04 2016 +0200 +++ b/db_schema/Dockerfile Wed Sep 28 09:06:18 2016 +0200 @@ -25,7 +25,7 @@ # Install packages # RUN apt-get update && \ - apt-get install -y postgresql-9.4-postgis-2.1 postgis + apt-get install -y postgresql-9.4-postgis-2.1 postgis curl unzip # # Use user postgres to run the next commands
--- a/db_schema/setup-db.sh Wed Sep 28 08:48:04 2016 +0200 +++ b/db_schema/setup-db.sh Wed Sep 28 09:06:18 2016 +0200 @@ -77,4 +77,16 @@ echo import lada test data psql $DB_CONNECT_STRING -d $DB_NAME -f $DIR/lada_data.sql + + echo create user $ROLE_NAME + psql $DB_CONNECT_STRING -d $DB_NAME --command "CREATE SCHEMA geo AUTHORIZATION $ROLE_NAME" + + TS="0101" + cd /tmp + curl -O http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip && \ + unzip vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*" + cd vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/ + shp2pgsql VG250_GEM geo.gem_utm | psql $DB_CONNECT_STRING -d $DB_NAME + cd /tmp + rm -rf vg250_${TS}.utm32s.shape.ebenen* fi
--- a/db_schema/stammdaten_schema.sql Wed Sep 28 08:48:04 2016 +0200 +++ b/db_schema/stammdaten_schema.sql Wed Sep 28 09:06:18 2016 +0200 @@ -231,37 +231,6 @@ ALTER SEQUENCE datensatz_erzeuger_id_seq OWNED BY datensatz_erzeuger.id; - -CREATE SEQUENCE de_vg_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -CREATE TABLE de_vg ( - id integer PRIMARY KEY DEFAULT nextval('de_vg_id_seq'::regclass), - use double precision, - rs character varying(12), - gf double precision, - rau_rs character varying(12), - gen character varying(50), - des character varying(75), - isn double precision, - bemerk character varying(75), - nambild character varying(16), - ags character varying(12), - rs_alt character varying(20), - wirksamkei date, - debkg_id character varying(16), - length numeric, - shape_area numeric, - geom public.geometry(MultiPolygon,4326) -); - -ALTER SEQUENCE de_vg_id_seq OWNED BY de_vg.id; - - CREATE TABLE deskriptor_umwelt ( id integer PRIMARY KEY, s00 integer NOT NULL, @@ -809,9 +778,6 @@ ADD CONSTRAINT umwelt_umwelt_bereich_key UNIQUE (umwelt_bereich); -CREATE INDEX de_vg_geom_gist ON de_vg USING gist (geom); - - CREATE INDEX fts_stauts_kooin10001 ON staat USING btree (kda_id);