changeset 1249:f094aca05cf2

Avoid having to handle missing shapes.
author Tom Gottfried <tom@intevation.de>
date Fri, 16 Dec 2016 16:18:37 +0100
parents 3f7c22b0b888
children 75692dc7077f
files db_schema/stammdaten_fill_verwaltungsgrenze.sql db_schema/stammdaten_schema.sql
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/db_schema/stammdaten_fill_verwaltungsgrenze.sql	Fri Dec 16 14:00:16 2016 +0100
+++ b/db_schema/stammdaten_fill_verwaltungsgrenze.sql	Fri Dec 16 16:18:37 2016 +0100
@@ -1,7 +1,7 @@
-insert into stammdaten.verwaltungsgrenze(gem_id, shape)
-SELECT 
+INSERT INTO stammdaten.verwaltungsgrenze(gem_id, shape)
+SELECT
   verwaltungseinheit.id,
   gem_utm.geom
-FROM 
+FROM
   stammdaten.verwaltungseinheit
-left join geo.gem_utm on verwaltungseinheit.id = gem_utm.ags;
+JOIN geo.gem_utm ON verwaltungseinheit.id = gem_utm.ags;
--- a/db_schema/stammdaten_schema.sql	Fri Dec 16 14:00:16 2016 +0100
+++ b/db_schema/stammdaten_schema.sql	Fri Dec 16 16:18:37 2016 +0100
@@ -167,7 +167,7 @@
 CREATE TABLE verwaltungsgrenze (
     id serial PRIMARY KEY,
     gem_id character varying(8) NOT NULL REFERENCES verwaltungseinheit,
-    shape public.geometry(MultiPolygon, 4326)
+    shape public.geometry(MultiPolygon, 4326) NOT NULL
 );
 CREATE INDEX verwaltungsgrenze_sp_idx ON verwaltungsgrenze USING gist (shape);
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)