changeset 2336:dbf28b27b74e

client: Skip fairway polygons that are not crossed by the cross-cut-line.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 19 Feb 2019 17:00:32 +0100
parents 2873f2b77e40
children 0f3b0937e7c1
files client/src/lib/geo.js
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/lib/geo.js	Tue Feb 19 16:58:21 2019 +0100
+++ b/client/src/lib/geo.js	Tue Feb 19 17:00:32 2019 +0100
@@ -207,7 +207,7 @@
   ) {
     startPoint = line.geometry.coordinates[0];
     endPoint = line.geometry.coordinates[1];
-  } else {
+  } else if (lineSplit(line, polygon).features.length > 0) {
     let split = lineSplit(line, polygon);
     for (let feature of split.features) {
       if (booleanContains(polygon, feature)) {
@@ -215,6 +215,8 @@
         endPoint = feature.geometry.coordinates[1];
       }
     }
+  } else {
+    return [];
   }
 
   let opts = { units: "kilometers" };