From 40927ddda3aa33407232e06824df3569eaab6033 Mon Sep 17 00:00:00 2001 From: namdre Date: Thu, 7 Feb 2019 15:59:29 +0100 Subject: [PATCH] now taking vClass into account when mapping. refs #2182 --- src/router/RORouteHandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/router/RORouteHandler.cpp b/src/router/RORouteHandler.cpp index d0ba9bf0f4a..8a49f2b2f61 100644 --- a/src/router/RORouteHandler.cpp +++ b/src/router/RORouteHandler.cpp @@ -716,6 +716,11 @@ RORouteHandler::parseGeoEdges(const PositionVector& positions, bool geo, WRITE_ERROR("Cannot convert geo-positions because the network has no geo-reference"); return; } + SUMOVehicleClass vClass = SVC_PASSENGER; + SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(myVehicleParameter->vtypeid); + if (type != nullptr) { + vClass = type->vehicleClass; + } for (Position pos : positions) { Position orig = pos; if (geo) { @@ -734,6 +739,9 @@ RORouteHandler::parseGeoEdges(const PositionVector& positions, bool geo, const ROLane* best = nullptr; for (const Named* o : lanes) { const ROLane* cand = static_cast(o); + if (!cand->allowsVehicleClass(vClass)) { + continue; + } double dist = cand->getShape().distance2D(pos); if (dist < minDist) { minDist = dist;