"Hey /g/ here's a great programming exercise for you to try..."
Okay no bullshit, I need a computer to solve a real-life problem for me. If you know how to do it or know of a site or program which already does it, please help.
>Input: an origin street address (US)
>Output: a destination street address
>Criterion: the route between origin and destination is the shortest/fastest by road for the traveler to enter a new time zone
>>59782463
"Fastest" meaning shortest distance or shortest travel time (regarding speed limits, avg traffic, etc...)
Draw the lines that section off the time zones
Djikstra using that each line as a set of nodes
Get the shortest one, you win.
To speed it up, use some trig to draw a line to the point on that line closest to you (aka directly across horizontally, in most cases); use that as your starting path. Of course there will be outliers because you can't have a road follow that straight line path.
Use google maps data btw.
>>59782463
>>59782530
since time zones are retarded - like with overlaps, switching zones and leaps - it will be a pain in the ass, OP.
Your best bet is probably to use a route calculation library/tool/whatever and check each mile or so for the time zone.
http://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates
>>59782463
Just implement A* you twat
>>59782463
webdev solution:
Query the google maps api through a node.js framework
Real solution: every road is an edge, every intersection is a vertex, the weight of the road is its speed limit times its length
Do Dijkstra's on this model
(No traffic accounted for in this shit)
>>59782463
>the route between origin and destination is the shortest/fastest by road for the traveler to enter a new time zone
This makes no fucking sense. Why?
>>59782463
We're not doing your homework for you, fgt. Or your job.
>>59782732
This sounds handiest. Thank you.
>>59783093
Because I want to know the fastest way to drive into a new time zone from where I am.
>>59783107
It's neither of those things.
>>59782463
>his country has more than 1 timezone
>>59783682
Thankfully. Otherwise this would be much more difficult.