[Lada-commits] [PATCH 1 of 3] Avoid having to handle missing shapes

Wald Commits scm-commit at wald.intevation.org
Fri Dec 16 16:25:45 CET 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1481901517 -3600
# Node ID f094aca05cf205f69f9f2b8138e595f93f19ba8e
# Parent  3f7c22b0b8889d5815c75532fef6116a996c977d
Avoid having to handle missing shapes.

diff -r 3f7c22b0b888 -r f094aca05cf2 db_schema/stammdaten_fill_verwaltungsgrenze.sql
--- 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;
diff -r 3f7c22b0b888 -r f094aca05cf2 db_schema/stammdaten_schema.sql
--- 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);
 


More information about the Lada-commits mailing list