This issue tracker is for proposing new examples or specific changes to existing examples. Please ask "how-to" questions on https://stackoverflow.com/ instead. If you're having trouble with OSMnx, please open an issue at the OSMnx repo: https://github.com/gboeing/osmnx/issues
Before you proceed, please read the contributing guidelines in this repo's CONTRIBUTING.md.
Any issues opened here will be automatically closed unless they propose new examples or specific changes to existing examples.
PRs welcome for new examples!
According to the guidelines above, I think this issue proposes specific changes to existing examples.
# add an edge attribute for time in minutes required to traverse each edge
meters_per_minute = travel_speed * 1000 / 60 # km per hour to m per minute
for _, _, _, data in G.edges(data=True, keys=True):
data["time"] = data["length"] / meters_per_minute
the cell is not assigning the attribute time to the edges in G.
Then, ego_graph is not taking into account time:
for trip_time, color in zip(sorted(trip_times, reverse=True), iso_colors):
subgraph = nx.ego_graph(G, center_node, radius=trip_time, distance="time")
for node in subgraph.nodes():
node_colors[node] = color
Actually, ego_graph should fail, but it doesn't raise an error.
Consider changing the for-loop cell with the following:
# add an edge attribute for time in minutes required to traverse each edge
meters_per_minute = travel_speed * 1000 / 60 # km per hour to m per minute
time_attr = {(x, y , z): data["length"] / meters_per_minute
for x, y, z, data in G.edges(data=True, keys=True)}
nx.set_edge_attributes(G, time_attr, name="time")
This issue tracker is for proposing new examples or specific changes to existing examples. Please ask "how-to" questions on https://stackoverflow.com/ instead. If you're having trouble with OSMnx, please open an issue at the OSMnx repo: https://github.com/gboeing/osmnx/issues
Before you proceed, please read the contributing guidelines in this repo's CONTRIBUTING.md.
Any issues opened here will be automatically closed unless they propose new examples or specific changes to existing examples.
PRs welcome for new examples!
According to the guidelines above, I think this issue proposes specific changes to existing examples.
Regarding 13-isolines-isochrones.ipynb, the following cell:
the cell is not assigning the attribute
time
to the edges inG
.Then,
ego_graph
is not taking into accounttime
:Actually,
ego_graph
should fail, but it doesn't raise an error.Consider changing the for-loop cell with the following: