Skip to content

Commit 0ec8db3

Browse files
committed
Minor change
1 parent 000b01d commit 0ec8db3

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/dsm/sources/RoadNetwork.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ namespace dsm {
810810
"Invalid coordinates ({}, {}) for edge {}->{}", lon, lat, srcId, dstId));
811811
}
812812
// Note: The original code stored as (lat, lon) based on your comment.
813-
coords.emplace_back(std::stod(lon), std::stod(lat));
813+
coords.emplace_back(dLon, dLat);
814814
}
815815
} else {
816816
coords.emplace_back(m_nodes.at(srcId)->coords().value());
@@ -853,8 +853,18 @@ namespace dsm {
853853
// targetId is the remaining part
854854
std::getline(pairStream, strTargetId);
855855

856-
auto const sourceId{m_nodeMapping.at(strSourceId)};
857-
auto const targetId{m_nodeMapping.at(strTargetId)};
856+
Id sourceId{0}, targetId{0};
857+
try {
858+
sourceId = m_nodeMapping.at(strSourceId);
859+
targetId = m_nodeMapping.at(strTargetId);
860+
} catch (const std::out_of_range& e) {
861+
Logger::warning(
862+
std::format("Invalid forbidden turn {}->{} for street {}. Skipping.",
863+
strSourceId,
864+
strTargetId,
865+
streetId));
866+
continue;
867+
}
858868

859869
auto const forbiddenStreetId{sourceId * nNodes + targetId};
860870
pStreet->addForbiddenTurn(forbiddenStreetId);

0 commit comments

Comments
 (0)