From 5b168726d2eb88730cd0bf713a99a91815abec87 Mon Sep 17 00:00:00 2001 From: burrscurr <23213508+burrscurr@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:09:20 +0200 Subject: [PATCH] make sure points are created with trace CRS Before this change, the end/start points of trajectory segments to be joined were re-interpreted as coordinates in XY_CRS. This is wrong if the underlying trace (and map) is not in XY_CRS. --- mappymatch/matchers/lcss/lcss.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mappymatch/matchers/lcss/lcss.py b/mappymatch/matchers/lcss/lcss.py index 8f45f76..24cc0b3 100644 --- a/mappymatch/matchers/lcss/lcss.py +++ b/mappymatch/matchers/lcss/lcss.py @@ -20,7 +20,6 @@ MatchResult, Trace, ) -from mappymatch.utils.crs import XY_CRS log = logging.getLogger(__name__) @@ -74,12 +73,12 @@ def _join_segment(a: TrajectorySegment, b: TrajectorySegment): o = Coordinate( coordinate_id=None, geom=Point(end_road.geom.coords[-1]), - crs=XY_CRS, + crs=new_traces.crs, ) d = Coordinate( coordinate_id=None, geom=Point(start_road.geom.coords[0]), - crs=XY_CRS, + crs=new_traces.crs, ) path = self.road_map.shortest_path(o, d) new_path = a.path + path + b.path