Skip to content

Commit

Permalink
now taking vClass into account when mapping. refs #2182
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 7, 2019
1 parent 85e6a65 commit 40927dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/router/RORouteHandler.cpp
Expand Up @@ -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) {
Expand All @@ -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<const ROLane*>(o);
if (!cand->allowsVehicleClass(vClass)) {
continue;
}
double dist = cand->getShape().distance2D(pos);
if (dist < minDist) {
minDist = dist;
Expand Down

0 comments on commit 40927dd

Please sign in to comment.