Skip to content

Commit

Permalink
Typo fix for computing travel time and distance for two routes that m…
Browse files Browse the repository at this point in the history
…inimize travel distance vs. travel time
  • Loading branch information
zhongyinggan committed Apr 2, 2024
1 parent bb870c2 commit af8a73b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions notebooks/02-routing-speed-time.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@
"source": [
"# compare the two routes\n",
"route1_length = int(sum(ox.utils_graph.route_to_gdf(G, route1, \"length\")[\"length\"]))\n",
"route2_length = int(sum(ox.utils_graph.route_to_gdf(G, route2, \"length\")[\"length\"]))\n",
"route1_time = int(sum(ox.utils_graph.route_to_gdf(G, route1, \"travel_time\")[\"travel_time\"]))\n",
"route2_length = int(sum(ox.utils_graph.route_to_gdf(G, route2, \"travel_time\")[\"length\"]))\n",
"route1_time = int(sum(ox.utils_graph.route_to_gdf(G, route1, \"length\")[\"travel_time\"]))\n",
"route2_time = int(sum(ox.utils_graph.route_to_gdf(G, route2, \"travel_time\")[\"travel_time\"]))\n",
"print(\"Route 1 is\", route1_length, \"meters and takes\", route1_time, \"seconds.\")\n",
"print(\"Route 2 is\", route2_length, \"meters and takes\", route2_time, \"seconds.\")"
Expand Down Expand Up @@ -381,9 +381,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -395,7 +395,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.8.17"
}
},
"nbformat": 4,
Expand Down

0 comments on commit af8a73b

Please sign in to comment.