Search Along A Driving Route
I recently went on a 3000 mile road trip, and as I was preparing for the trip, I wanted to know the answer to questions like “Where are all the Speedway gas stations that are within a mile of my route?”. I couldn’t find anything that would allow me to search for businesses near a given driving route, instead I could only search for things near a given point or city. I decided to build a mashup using Yahoo! Pipes and Google Maps that would allow me to do just what I wanted.
How to use it:
- Install the search-route bookmarklet.
- Go to Google Maps and create route.
- Click the search-route bookmarklet you installed in step #1.
- Search!
If you don’t want to bother installing the bookmarklet and want to try out the searching, you can test a local driving route or a long distance driving route.
How it Works:
After the user creates the route on Google Maps, clicking the bookmarklet sends the URL of their Google Maps page to a script on my site. This script will download the URL from Google Maps and parse out the encoded route in that page. Once we have this, we can give the user a search page with their route and map using Google Maps’ API. When the user searches, we call a Yahoo! Pipe which is passed the search parameters and a special id referencing this user’s route. The Yahoo! Pipe will download a specially crafted Atom feed for this route from my server. This Atom feed contains a list of some of the latitude and longitude points of the route. The Yahoo! Pipe then does a Yahoo! Local search on each point using the search parameters the user specified. Searches on particularly long routes can take several seconds to complete.
Adam said,
May 10, 2007 @ 2:14 pm
I’m doing a long drive today, and I want a similar mashup that will show me the weather all along the way (every 50 miles or so), given a start time and a route. How hard would it be to do that?
Luke said,
May 10, 2007 @ 2:40 pm
It’d be pretty easy to get a longitude / latitude point every 50 miles into your route. The harder part is finding a service that’ll return the weather forecast for a lon/lat pair. Perhaps you’d have to first find a service to convert lon/lat to zipcode. Here’s an ugly but valid atom feed with points every 50 miles for your route.
Adam said,
May 10, 2007 @ 2:55 pm
Maybe I’ll have to play with this later:
http://www.arl.noaa.gov/ready/cmet.html
Jim said,
May 14, 2007 @ 10:17 am
It wouldn’t be hard to write a script to build a table of zipcode/lat-lng pairs using the Google Maps API … there can only be 100,000 zipcodes, and my experience with this little flash movie leads me to believe there are significantly less than that.
B said,
May 24, 2007 @ 10:42 pm
Hello sir,
for my science class, I used http://www.flickr.com/photos/lukebaker/40669565/
that picture of yours and did a drawing of it. I was
wondering whether I could post it in my art gallery (giving you credit for the picture).
Please email me and let me know your answer.
If this is not okay (for me to post my drawing) then just
tell me and I will only use it for my science class (and tell my
friends that I drew the praying mantis from your picture).
Thanks.
Luke Baker said,
May 25, 2007 @ 7:05 am
B,
That is really cool to hear! Any way you could scan the drawing and
send it to me?
You may use the picture under the terms you describe as long as it is
for non-commercial uses (i.e., you’re not making any money off of it).
I’ve licensed the picture under the following license:
http://creativecommons.org/licenses/by-nc-sa/2.0/
Which says you are free to “remix” it (create a drawing of it) as long
as you do the following:
1. Attribute the picture to me (which you say you’re planning on doing).
2. Use it for non-commerical purposes.
3. License your drawing under this same license.
It sounds like your use fits under all of those categories, so feel
free to post it wherever you like.
I appreciate that you’ve asked for permission.
Luke Baker
Scott Edwards said,
August 27, 2007 @ 4:42 am
Luke,
You’ve finally done what I’ve been waiting for for years! I have no idea why the big boys (Google, Yahoo) have never seen the benefit that such a feature would have. Am I the only one who’s wondered time-and-again, “Ok, I’ve got to go to this destination, AND I’ve got to find a gasstation/copystore/fastfood or whatever SOMEWHERE along the way - I don’t care which one - just tell me the CLOSEST!” Have you shown this to any contacts at Google or Yahoo? If so, they should hire you right away!
I can understand that this takes some processing power, but I’m shocked how fast your solution does it, and I’m sure with the computing power of Google or Yahoo it would be FAST. So far, whenever I do a search on “search along route” on Google, I find your site, and a couple others (Map24, MultiMap). But, these other sites don’t let you type in a query - only pick from a limited list.
It’s hard to believe, but I think that your site is the only one IN THE WORLD that can do this! Does anyone know if any of the CDROM based solutions do this? Can you help me with any insight as to either: 1)why the big guys have never even talked about implementing this or 2) is there really that few users that would ever want this functionality?
Looks like the algorithms are out there for the taking also. Check out this link to a paper from Japan:
http://www.ieice.org/~de/DEWS/proc/2003/papers/2-B/2-B-04.pdf
Congratulations on an excellent job and for making me feel not so alone in wanting this feature! I hope your site stays up for a long time, as I will definitely be using this bookmarklet. (P.S. How hard would it be to add the ability be able to click on a found item in your map and select “include as middle destination”? I know Google maps now lets you insert destinations but is that available in the API?)