changeset 3308:1128b29aed8b

Merged sections-backend into default.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 17 May 2019 11:31:30 +0200
parents bf5ab7a069e2 (current diff) b90b17d0b5a9 (diff)
children 80037790032d
files
diffstat 4 files changed, 22 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/sec.go	Fri May 17 11:24:06 2019 +0200
+++ b/pkg/imports/sec.go	Fri May 17 11:31:30 2019 +0200
@@ -101,7 +101,7 @@
   SELECT ISRSrange_axis((SELECT r FROM r), $16::double precision) AS axs)
 INSERT INTO waterway.sections (
   name,
-  stretch,
+  section,
   area,
   objnam,
   nobjnam,
@@ -121,7 +121,7 @@
 RETURNING id`
 )
 
-// StageDone moves the imported stretch out of the staging area.
+// StageDone moves the imported section out of the staging area.
 func (secJobCreator) StageDone(
 	ctx context.Context,
 	tx *sql.Tx,
@@ -134,10 +134,10 @@
 	return err
 }
 
-// CleanUp of a stretch import is a NOP.
+// CleanUp of a section import is a NOP.
 func (*Section) CleanUp() error { return nil }
 
-// Do executes the actual stretch import.
+// Do executes the actual section import.
 func (sec *Section) Do(
 	ctx context.Context,
 	importID int64,
--- a/schema/demo-data/published_services.sql	Fri May 17 11:24:06 2019 +0200
+++ b/schema/demo-data/published_services.sql	Fri May 17 11:31:30 2019 +0200
@@ -12,6 +12,7 @@
 --  * Tom Gottfried <tom@intevation.de>
 
 INSERT INTO sys_admin.published_services (name) VALUES
+    ('waterway.sections_geoserver'),
     ('waterway.stretches_geoserver'),
     ('waterway.fairway_dimensions'),
     ('waterway.gauges_geoserver'),
--- a/schema/gemma.sql	Fri May 17 11:24:06 2019 +0200
+++ b/schema/gemma.sql	Fri May 17 11:31:30 2019 +0200
@@ -424,7 +424,7 @@
     CREATE TABLE sections (
         id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
         name varchar NOT NULL,
-        stretch isrsrange NOT NULL,
+        section isrsrange NOT NULL,
         area geography(MULTIPOLYGON, 4326) NOT NULL
             CHECK(ST_IsValid(CAST(area AS geometry))),
         objnam varchar NOT NULL,
@@ -616,7 +616,8 @@
   ('waterway', 'distance_marks_geoserver', 'location_code'),
   ('waterway', 'distance_marks_ashore_geoserver', 'id'),
   ('waterway', 'bottlenecks_geoserver', 'id'),
-  ('waterway', 'stretches_geoserver', 'id');
+  ('waterway', 'stretches_geoserver', 'id'),
+  ('waterway', 'sections_geoserver', 'id');
 
 --
 -- Import queue and respective logging
--- a/schema/geoserver_views.sql	Fri May 17 11:24:06 2019 +0200
+++ b/schema/geoserver_views.sql	Fri May 17 11:31:30 2019 +0200
@@ -100,6 +100,20 @@
         staging_done
     FROM waterway.stretches;
 
+CREATE OR REPLACE VIEW waterway.sections_geoserver AS
+    SELECT
+        id,
+        name,
+        (section).lower::varchar as lower,
+        (section).upper::varchar as upper,
+        area::Geometry(MULTIPOLYGON, 4326),
+        objnam,
+        nobjnam,
+        date_info,
+        source_organization,
+        staging_done
+    FROM waterway.sections;
+
 CREATE OR REPLACE VIEW waterway.sounding_results_contour_lines_geoserver AS
     SELECT bottleneck_id,
         date_info,