changeset 690:f595b3455d75

Schema: Add view for waterway axis * Use view to help geoserver serve WFS 1.1.0. Also change client to ask for the new name instead of the original table.
author Bernhard Reiter <bernhard@intevation.de>
date Thu, 20 Sep 2018 14:15:32 +0200
parents 89b497d0ee0f
children d643ff60f607
files client/src/map/Maplayer.vue schema/gemma.sql
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/map/Maplayer.vue	Thu Sep 20 12:45:00 2018 +0200
+++ b/client/src/map/Maplayer.vue	Thu Sep 20 14:15:32 2018 +0200
@@ -205,7 +205,7 @@
       srsName: "EPSG:3857",
       featureNS: "gemma",
       featurePrefix: "gemma",
-      featureTypes: ["distance_marks"],
+      featureTypes: ["distance_marks_geoserver"],
       outputFormat: "application/json"
     });
 
--- a/schema/gemma.sql	Thu Sep 20 12:45:00 2018 +0200
+++ b/schema/gemma.sql	Thu Sep 20 14:15:32 2018 +0200
@@ -280,6 +280,17 @@
         position_code char(2) NOT NULL REFERENCES position_codes
     )
 
+    -- A table to help geoserver serve the distance marks as WFS 1.1.0.
+    -- At least geoserver-2.13.2 does not serve type geography correctly
+    -- and does not serve the location_code as isrs type
+    CREATE VIEW waterway.distance_marks_geoserver AS
+        SELECT location_code::VARCHAR,
+               geom::Geometry(POINT, 4326),
+               distance_mark_function,
+               position_code,
+               (location_code).hectometre
+            FROM waterway.distance_marks;
+
     CREATE TABLE sections_stretches (
         id varchar PRIMARY KEY,
         is_section boolean NOT NULL, -- maps 'function' from interface