Skip to content

Commit

Permalink
feat(topology): improve default speed fetch with OSMNetwork (#82)
Browse files Browse the repository at this point in the history
For arcs tagged with highway=*_link, try using the speed of the raw highway type (without "_link").
For instance, if an arc is tagged highway=primary_link and "primary_link" is not specified in speeds, try using "primary" key.
  • Loading branch information
leo-desbureaux-tellae authored Oct 19, 2023
1 parent fd25ede commit ab64eb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions starling_sim/basemodel/topology/osm_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def add_time_and_length(self, u, v, d):
# differentiate speeds among the link types
if d["highway"] in self.speeds:
speed = self.speeds[d["highway"]]["speed"]
elif d["highway"].endswith("_link") and d["highway"][:-5] in self.speeds:
speed = self.speeds[d["highway"][:-5]]["speed"]
else:
speed = self.speeds["other"]["speed"]

Expand Down

0 comments on commit ab64eb8

Please sign in to comment.