diff schema/gemma.sql @ 5009:e8b2dc771f9e

Store axis as MultiLinestring MultiLinestrings could already be imported but we stored them as multiple Linestrings with identical attributes and even stored Linestrings with self-intersections as multiple single Linestrings with identical attributes. Avoid both by storing as MultiLinestring. In passing, removed unnecessary processing steps in the INSERT statemet for the sys_admin case and ensured that attempts to convert to valid simple features are made after transformation, which might lead to invalid features. Since isrsrange_axis() relies on single Linestrings for linear referencing, add an extra ST_Dump().
author Tom Gottfried <tom@intevation.de>
date Wed, 11 Mar 2020 17:11:23 +0100
parents f697a398eff4
children cf25b23e3eec
line wrap: on
line diff
--- a/schema/gemma.sql	Wed Mar 11 15:54:37 2020 +0100
+++ b/schema/gemma.sql	Wed Mar 11 17:11:23 2020 +0100
@@ -620,7 +620,7 @@
 
     CREATE TABLE waterway_axis (
         id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
-        wtwaxs geography(LINESTRING, 4326) NOT NULL
+        wtwaxs geography(MULTILINESTRING, 4326) NOT NULL
             CHECK(ST_IsSimple(CAST(wtwaxs AS geometry))),
         -- TODO: Do we need to check data set quality (DRC 2.1.6)?
         objnam varchar NOT NULL,