Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isochrone (travel time) - long term upgrade #63

Open
NealHumphrey opened this issue Jul 31, 2016 · 4 comments
Open

Isochrone (travel time) - long term upgrade #63

NealHumphrey opened this issue Jul 31, 2016 · 4 comments

Comments

@NealHumphrey
Copy link
Collaborator

Phase 2 (or 3) of this project could use actual streets/directions/travel time to create the buffers rather than crow-fly distances. Creating issue now to have a place to save reference info.

Several working examples:
https://wiki.openstreetmap.org/wiki/Isochrone
http://www.opentripplanner.org/

@alulsh
Copy link
Member

alulsh commented Aug 11, 2016

This would be a great question for Nelle from WABA! Not sure if WABA wants to visualize 1 mile as the crow flies or 1 mile in terms of actual biking distance when routed.

Either way, this could also make for an interesting comparison visualization - 1 mile as the crow flies vs. 1 mile in actual biking distance.

@alulsh
Copy link
Member

alulsh commented Sep 2, 2016

@NellePierson - now that you are on GitHub, what do you think of this issue?

@WABA-Comms
Copy link
Collaborator

All about this. I'm pretty confident when it comes to biking, but I'll never be able to travel as the crow flies. So yes, if it's possible, if there's human power behind this upgrade, I'm all about making our representation of access more accurate. Thanks for raising this, @NealHumphrey!

@NealHumphrey
Copy link
Collaborator Author

The opentripplanner is made in Java, but it looks like it would be pretty good for doing this as a one-time analysis and it shouldn't be very hard to learn. You can just download the executable and run it from the command line: http://opentripplanner.readthedocs.io/en/latest/Basic-Usage/

For using Mapbox directly, the duration matrix of the distance API looks like the best bet. Unfortunately it only returns travel time (although you can do it for a biking-optimized route!), so there would need to be an assumption to back calculate approximate distance. The option that provides distance is the Directions API, but it only works for 2 points at a time instead of a matrix of 100, and has some rate limits.

This is definitely not an optimized procedure for this. But, it would get the job done and isn't too hard to code. At a minimum, it can provide a starting point for thinking about a better optimized method.

The lanes:

'Destination' points:

  • For each starting point, calculate the 1-mile crow-flies buffer using buffer
  • Calculate its bounding box
  • Turn the bounding box into a point grid

Travel time (distance)

  • Send the point grid and and the individual point to the duration matrix
  • Repeat for all the exploded points (watch out for the rate limits on the Mapbox API - will have to add a sleeper function)
  • Save only the shortest travel time for each 'destination' point
  • Make isolines out of the points

That'll give you all the buffers you need for travel times under 1 mile, since the calculation would produce travel times for everything less as well - and you'll only ever need to do it once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants