O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  


GOOGLE MAPS HACK

Better Driving Directions
Create more useful driving directions by truncating the extraneous bits to use a more general starting or ending point.

Contributed by:
KevinFink
[01/24/06 | Discuss (0) | Link to this hack]

One of the challenges I often run into when trying to create useful driving directions is that I usually don't want directions from one address to another - I want them from some commonly known point (like 520 crossing the lake) to an address. This is because I am often generating driving directions for other people, coming from different places (which I may or may not know the details of), but they all know how to get to 520. I don't know of any mapping site that offers this ability directly, but you can force Google Maps (and maybe others) to do it.

Let's take the example of creating driving directions from Seattle to my house in Carnation. If I use the obvious "from: Seattle, WA to: 32040 NE 112th, 98014" I get very detailed steps starting between 5th and 6th on Marion in downtown Seattle.

Example 1: from: Seattle, WA to: 32040 NE 112th, 98014
http://maps.google.com/maps?q=from%3A+Seattle,+WA+to%3A+32040+NE+112th,+98014&ll=47.658450,-122.161789&spn=0.275482,0.512718&f=d&hl=en

The first five or six steps are irrelevant details. What I really want is to have the directions start from out near the end of 520, as anyone who lives in Seattle can easily get there from where-ever they start from. The trick is to use a latitude,longitude pair as a starting point rather than an address. To find the correct lat/long, double click on the position you want to start at (zooming in as appropriate to get an accurate position). This will center the map on that location. Once you have it centered appropriately, click on the "Link to this page" link in the upper-right hand corner of the map. This will regenerate the URL in the browser.

Example 2: Zoom into desired starting point
http://maps.google.com/maps?q=from%3A+Seattle,+WA+to%3A+32040+NE+112th,+98014&ll=47.667064,-122.116492&spn=0.004304,0.008011&f=d&hl=en

From it, copy the latitude and longitude assigned by the "ll" parameter and paste it into the "Start address" form element, then click on "Search" (or hit Enter) to resubmit it. This will then generate driving directions from that lat/long to the destination address.

Example 3: Finished Driving Directions from 520 to 32040 NE 112th, 98014
http://maps.google.com/maps?q=from%3A+47.667064,-122.116492+to%3A+32040+NE+112th,+98014&f=d&hl=en


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.