diff schema/gemma.sql @ 4561:f7b57136c800 iso-areas

Added table to to store iso areas of sounding results.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 02 Oct 2019 16:43:34 +0200
parents 7128741faeb9
children 26e9846ed69f
line wrap: on
line diff
--- a/schema/gemma.sql	Wed Oct 02 16:27:07 2019 +0200
+++ b/schema/gemma.sql	Wed Oct 02 16:43:34 2019 +0200
@@ -699,6 +699,16 @@
             -- CHECK(ST_IsSimple(CAST(lines AS geometry))),
         PRIMARY KEY (sounding_result_id, height)
     )
+
+    CREATE TABLE sounding_results_iso_areas (
+        sounding_result_id int NOT NULL REFERENCES sounding_results
+            ON DELETE CASCADE,
+        height numeric NOT NULL,
+        areas geography(MULTIPOLYGON, 4326) NOT NULL,
+        -- TODO: generate valid simple features and add constraint:
+            -- CHECK(ST_IsSimple(CAST(areas AS geometry))),
+        PRIMARY KEY (sounding_result_id, height)
+    )
     --
     -- Fairway availability
     --