changeset 717:bb0788567609

Merge output of ST_3DIntersection into a single linestring Multiple linestrings were returned where contiguous lines had to be expected. The end result is still a multi-linestring and contains multiple contiguous linestrings in case the survey area is intersected multiple times.
author Tom Gottfried <tom@intevation.de>
date Fri, 21 Sep 2018 15:53:17 +0200
parents 22159077b564
children d1b60ad2f50d ca82698349b7
files pkg/controllers/cross.go
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/cross.go	Fri Sep 21 14:48:32 2018 +0200
+++ b/pkg/controllers/cross.go	Fri Sep 21 15:53:17 2018 +0200
@@ -11,13 +11,13 @@
 
 const crossSQL = `
 WITH line AS (
-SELECT ST_3DIntersection(
+SELECT ST_LineMerge(ST_Union(ST_3DIntersection(
   ST_Translate(
     ST_Extrude(
       ST_GeomFromWKB($1, 4326),
     0, 0, 1000),
    0, 0, -500),
-   geom) AS geom
+   geom))) AS geom
 FROM waterway.meshes m JOIN waterway.sounding_results sr ON m.sounding_result_id = sr.id
 WHERE ST_Intersects(geom, ST_GeomFromWKB($1, 4326)) AND
   sr.bottleneck_id = $2 AND sr.date_info = $3