jeancochrane / mellow-bike-map

🚲 Web app and routing API for finding safe, chill bike routes. Like Google Maps if it took you through cozy side streets.
https://mellowbikemap.com
MIT License
13 stars 5 forks source link

Show approximate route time on search #27

Closed jeancochrane closed 3 years ago

jeancochrane commented 4 years ago

User testing suggestion: since pgr_djikstra() returns the total cost of a given route, we should be able to return an approximate time for a given route by assuming a certain speed (this blog post suggests 11-18 mph) and multiplying it by the cost.

The one snag is that in order to prioritize mellow streets we cheat by reducing the cost in the query:

https://github.com/jeancochrane/mellow-bike-map/blob/6846b7f51272d9aaa09f34d1000b305e37d08876/app/mbm/views.py#L103-L116

So in order to get the true cost we'll need to either figure out how to adjust the pgr_djisktra() query to return the unaltered cost, or run an additional query after we get the route to confirm its true cost.