changeset 5154:a33f1d51d1b7

Changed FD coordinate calculation from polygon to multipolygon.
author Raimund Renkert <raimund@renkert.org>
date Wed, 01 Apr 2020 15:48:07 +0200
parents adf7b9f1273b
children 20f338cb4d48
files client/src/lib/geo.js
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/lib/geo.js	Wed Apr 01 15:18:12 2020 +0200
+++ b/client/src/lib/geo.js	Wed Apr 01 15:48:07 2020 +0200
@@ -23,7 +23,7 @@
 import {
   lineString as turfLineString,
   point as turfPoint,
-  polygon as turfPolygon
+  multiPolygon as turfMultiPolygon
 } from "@turf/helpers";
 
 import Feature from "ol/Feature";
@@ -189,7 +189,7 @@
   // uses turfjs distance() function
   let fairwayCoordinates = [];
   var line = turfLineString(profileLine.getCoordinates());
-  var polygon = turfPolygon(fairwayGeometry.getCoordinates());
+  var polygon = turfMultiPolygon(fairwayGeometry.getCoordinates());
   var intersects = lineIntersect(line, polygon);
 
   let opts = { units: "meters" };