Monday, November 28, 2011

Adopt a Highway!

Aiphid's US Route 1
A few weeks ago, Aiphid asked me how he could get US Route 1 added to the Trip Planner on Atlas Quest. So I explained to him the tedious process of plotting the entire route, from end to end, which is inputted into Atlas Quest. And usually, when someone asks me about a route, that's where it ends. The person walks away and says, "Yeah, that sucks."

But not Aiphid. Oh, no.... he actually went in and started plotting the US Route 1 from somewhere in Maine to Key West, Florida. In all, there were about 1,400 plotted points--which is pretty remarkable. By comparison, when I did Interstate 95, I plotted a measly 159 points to mark the route. To be fair, there were reasons why the route was so poorly plotted out, but it was a remarkable amount of work.

And then I did absolutely nothing with it. The problem for me, you see, is that when I did the great Geocoder Update, I made some significant upgrades to how the trip planner worked. It allowed for much more accurate and precise information than ever before. One thing I did not upgrade, however, was my code to upload a new route. I no longer had any working code to upload the wonderfully detailed route Aiphid had created!

So my latest project has been to recreate this ability. Not only that, but to allow anyone to upload their own routes. Not only that, but to make it easier and faster than ever before. It's still a tedious, mind-numbing process to plot out thousands of points for a route--I've found no way around that--but the process of doing it could be made much easier. =)

And last night, I updated AQ with my updates. I'm still working on some stuff so I'm going to share all of the new features just yet... with a few exceptions.

  • I used Aiphid's route to test the new code. Works great! =) Which also means you'll now see "US Route 1" as the last option in the Trip Planner. Enjoy! And thank Aiphid for the new route if you ever find yourself using it. =)
  • Like the map image at the beginning of this post? AQ generated it for me. Well, technically, Google generated the map, but based on the information from AQ. =) Soon, you'll be able to see such images for all routes. You'll even be able to zoom in and see exactly what AQ is using to calculate distances from the route. And if you've ever wondered why the distances sometimes seem so screwed up, this will show the reason!
  • I used Aiphid's route to test the creation of a new route. I also wanted to test the editing of an existing route and spent four hours this morning re-mapping 2,932 vertices that make up Interstate 5. So if you do any searches along I-5, you'll find that the distances are very accurate now along the entire route. (On a side note, AQ is still processing the data for I-5 which should take a few hours. So technically, you might get "unusual" results during that timespan. When it's done, though....) The limiting factor with precision is no longer the route, but the precision of the location for each letterbox.
  • When you manually write out a Trip Planner search from the Advanced Search page, you'll usually type something like "along I-5 FROM San Diego, CA to Los Angeles, CA." Now, you can also call other commonly known names such as the "along the San Diego Freeway from San Diego to Los Angeles" and it'll work too. AQ, however, isn't particularly smart about where that particular name starts or ends along the route--as far as it knows, all of I-5 is called the San Diego Freeway. Other names that will work in place of I-5 include Pacific Highway, Cascade Wonderland Highway, West Side Freeway, Grand Army of the Republic Highway, Santa Ana Freeway, and Golden State Freeway.
And finally--what the title of this post is about: Adopting a highway! It took me about four hours to plot I-5 accurately, and there are currently 74 routes supported on AQ. At this rate, it would take me nearly 300 hours to re-plot all of the routes. (Okay, maybe a little less--I-5 is one of the longest routes supported. Most routes are shorter!) And frankly, if you had to wait for me to fix all of the routes, you'll likely be waiting for years.

But another new feature I've added is the ability to transfer ownership of routes to other members, and I'm looking to adopt all of these routes out. =) Aiphid gets Route 1, and I've already done I-5, but all other routes are up for grabs. If you've ever wanted to fix problems with a route you travel frequently, now's your chance! And, as a special incentive, anyone who adopts and fixs up a route also get first access to a number of new features including making your own personal routes. =) One catch, though--you do have to be a premium member in order to volunteer. Personal routes are going to be a premium-member perk.

I'm also interested in adding new routes for Canada and Europe. If you are interested in creating such routes, let me know. =)

6 comments:

Anonymous said...

Tis is great... especially as someone who lives along the Rt 1 Highway. Thank you Aiphid for your persistence and thank you oh Great Green One for making it happen.

~Muddy Paws

Tink and Tom of T-N-T said...

WooHoo! Thanks to both of you for all of the work!

Girlguides said...
This comment has been removed by the author.
Anonymous said...

I'll volunteer for US-40, The National Road. Just need some specifics. ~speedsquare

Girlguides said...

We can volunteer for I-68 and/or I-70. However we have never done anything like this. Is it that you plot the lat/long every 5 miles along the route? How do you present the results? on a spreadsheet?

bumblebeebunny said...

Wow... why would you manually plot thousands of points by hand, when google API is there for all to use!?

Try using the google directions API.
http://code.google.com/apis/maps/documentation/directions/

For instance, to get the I-5 from san diego to seattle,

http://maps.googleapis.com/maps/api/directions/xml?origin=SanDiego,CA&&destination=Seattle,WA&sensor=false

One can specify waypoints, etc to get complicated routes.

The result contains some encoded polylines, among other data. The google API covers how to decode these programatically, or you can do it manually here (though it will be slow for thousands of points)
http://facstaff.unca.edu/mcmcclur/googlemaps/encodepolyline/decode.html

The response has a high level overview_polyline -- which has a few hundred points in the case of the I-5. If you want more detail, each individual leg has much finer detail level. For the I-5, this was well over 8000 points.

Doing this manually (copy/paste the encoded polylines into the decoder from each step)... it took a few minutes to get a few thousand points. Or one could implement a simple page to specify a route, then call google api, and grab all the resulting details and stuff into lat/lon, or whatever format you want...