changeset 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 81b0f1cf2d41
children 5cc4042cf07c
files schema/gemma.sql schema/version.sql
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
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
     --
--- a/schema/version.sql	Wed Oct 02 16:27:07 2019 +0200
+++ b/schema/version.sql	Wed Oct 02 16:43:34 2019 +0200
@@ -1,1 +1,1 @@
-INSERT INTO gemma_schema_version(version) VALUES (1203);
+INSERT INTO gemma_schema_version(version) VALUES (1204);