Add direction-tag check to GetDirection
This commit is contained in:
parent
5b5aee91af
commit
13ccec9245
@ -20,9 +20,10 @@ public class Way(ulong id, Dictionary<string, string> tags, List<ulong> nodeIds)
|
|||||||
"-1" => WayDirection.Backwards,
|
"-1" => WayDirection.Backwards,
|
||||||
_ => WayDirection.Both
|
_ => WayDirection.Both
|
||||||
};
|
};
|
||||||
HighwayType[] impliedTypes = [HighwayType.motorway, HighwayType.motorway_link, HighwayType.primary, HighwayType.primary_link];
|
bool direction = !Tags.TryGetValue("direction", out string? directionStr) || directionStr == "forwards";
|
||||||
|
HighwayType[] impliedTypes = [HighwayType.motorway, HighwayType.motorway_link, HighwayType.primary_link];
|
||||||
if (impliedTypes.Contains(GetHighwayType()))
|
if (impliedTypes.Contains(GetHighwayType()))
|
||||||
return WayDirection.Forwards;
|
return direction ? WayDirection.Forwards : WayDirection.Backwards;
|
||||||
return WayDirection.Both;
|
return WayDirection.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user