Skip to content

Commit

Permalink
fix #14650
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 3, 2024
1 parent 1011da0 commit 8bbbdc1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/netimport/NIImporter_OpenStreetMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
const SVCPermissions defaultPermissions = tc.getEdgeTypePermissions(type);
const SVCPermissions extra = myImportBikeAccess ? e->myExtraAllowed : (e->myExtraAllowed & ~SVC_BICYCLE);
const SVCPermissions extraDis = myImportBikeAccess ? e->myExtraDisallowed : (e->myExtraDisallowed & ~SVC_BICYCLE);
SVCPermissions permissions = (defaultPermissions | extra) & ~extraDis;
// extra permissions are more specific than extra prohibitions
SVCPermissions permissions = (defaultPermissions & ~extraDis) | extra;
if (defaultPermissions == SVC_SHIP) {
// extra permission apply to the ships operating on the route rather than the waterway
permissions = defaultPermissions;
Expand Down Expand Up @@ -1243,6 +1244,8 @@ NIImporter_OpenStreetMap::EdgesHandler::myStartElement(int element, const SUMOSA
&& key != "railway:bidirectional"
&& key != "railway:track_ref"
&& key != "usage"
&& key != "access"
&& key != "emergency"
&& key != "service"
&& key != "electrified"
&& key != "segregated"
Expand Down Expand Up @@ -1416,6 +1419,18 @@ NIImporter_OpenStreetMap::EdgesHandler::myStartElement(int element, const SUMOSA
} catch (const BoolFormatException&) {
myCurrentEdge->myExtraAllowed |= SVC_BUS;
}
} else if (key == "emergency") {
try {
if (StringUtils::toBool(value)) {
myCurrentEdge->myExtraAllowed |= SVC_AUTHORITY | SVC_EMERGENCY;
}
} catch (const BoolFormatException&) {
myCurrentEdge->myExtraAllowed |= SVC_AUTHORITY | SVC_EMERGENCY;
}
} else if (key == "access") {
if (value == "no") {
myCurrentEdge->myExtraDisallowed |= ~(SVC_PUBLIC_CLASSES | SVC_EMERGENCY | SVC_AUTHORITY);
}
} else if (StringUtils::startsWith(key, "width:lanes")) {
try {
const std::vector<std::string> values = StringTokenizer(value, "|").getVector();
Expand Down

0 comments on commit 8bbbdc1

Please sign in to comment.