From 5c1ad4579fe104bd1a425a88ab7ac6fa48f750b1 Mon Sep 17 00:00:00 2001 From: Patrick Brosi Date: Wed, 6 Sep 2023 12:13:46 +0200 Subject: [PATCH] Compute costs based on collapsed edge geometry length, not on distance between adjacent nodes, fixing a regression introduced last year. Fixes #47 --- src/pfaedle/osm/OsmBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pfaedle/osm/OsmBuilder.cpp b/src/pfaedle/osm/OsmBuilder.cpp index 2c6d728..c110143 100644 --- a/src/pfaedle/osm/OsmBuilder.cpp +++ b/src/pfaedle/osm/OsmBuilder.cpp @@ -1119,7 +1119,7 @@ void OsmBuilder::writeGeoms(Graph* g, const OsmReadOpts& opts) { e->pl().addPoint(*e->getTo()->pl().getGeom()); } - e->pl().setCost(costToInt(dist(e->getFrom(), e->getTo()) / + e->pl().setCost(costToInt(e->pl().getLength() / opts.levelDefSpeed[e->pl().lvl()])); } }