changeset 2170:3bfe48e32f20

Fixed de-duplication (primary geoserver id) for virt dist marks. The last attempt to fix this was bogus, as there is no "id" at the virt distance marks table...
author Sascha Wilde <wilde@intevation.de>
date Fri, 08 Feb 2019 16:20:26 +0100
parents f6380bbdb853
children 543b5d071a69
files client/src/components/ImportStretches.vue schema/gemma.sql
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/ImportStretches.vue	Fri Feb 08 15:43:33 2019 +0100
+++ b/client/src/components/ImportStretches.vue	Fri Feb 08 16:20:26 2019 +0100
@@ -492,7 +492,7 @@
       };
       const distanceMark = this.identifiedFeatures.filter(filterDistanceMarks);
       if (distanceMark.length > 0) {
-        const value = distanceMark[0].getProperties()["isrs_astext"];
+        const value = distanceMark[0].getProperties()["location"];
         this.startrhm = this.pipetteStart ? value : this.startrhm;
         this.endrhm = this.pipetteEnd ? value : this.endrhm;
         this.pipetteStart = false;
--- a/schema/gemma.sql	Fri Feb 08 15:43:33 2019 +0100
+++ b/schema/gemma.sql	Fri Feb 08 16:20:26 2019 +0100
@@ -329,7 +329,8 @@
     -- At least geoserver-2.13.2 does not serve type geography correctly
     -- and does not serve the location_code as isrs type
     CREATE VIEW distance_marks_geoserver AS
-        SELECT isrs_asText(location_code),
+        SELECT location_code,
+               isrs_asText(location_code) AS location,
                geom::Geometry(POINT, 4326),
                related_enc,
                (location_code).hectometre
@@ -621,7 +622,7 @@
 
 -- Configure primary keys for geoserver views
 INSERT INTO waterway.gt_pk_metadata VALUES
-  ('waterway', 'distance_marks_geoserver', 'id'),
+  ('waterway', 'distance_marks_geoserver', 'location_code'),
   ('waterway', 'bottlenecks_geoserver', 'id');
 
 --