Chrestomathy
Yet another voice in the cacophony.
Wednesday, August 15 2018 @ 06:09 AM PDT
 Topics  
Books
Fiction
Food
Kitsch
Life
Movies
Music
Philosophy
Politics
Sports
Technology
Travel

 What's New  
STORIES
No new stories

COMMENTS last 48 hrs
No new comments

 Events  
There are no upcoming events

 User Functions  
Username:

Password:

Don't have an account yet? Sign up as a New User

 Other Stuff  
< ? bostonites # >
The Syndicate
GPG/PGP Key


 Bending the will of Google Maps   
 Author:  matt
 Dated:  Saturday, October 28 2006 @ 06:14 PM PDT
 Viewed:  1114 times  
TechnologyThere's a fundamental difference between how people and computers write travel directions. People are usually much more able to gauge whether or not something is relevant, and tailor the directions accordingly. Today I was writing directions for my sister, and I know she knows how to get to Boston - it's the part from the exit on that I was writing directions for, and I thought it could use a map.

I've found in my own travels that the hybrid view in Google Maps is very good for giving me not just turn by turn directions but also context. I can see the way a road curves, and how the turn I'm looking for might not be visible until I'm right on top of it. The problem is that when you're giving somebody else directions, having the route highlighted is effectively a requirement, but how do you start a route at an arbitrary spot on the highway, or how do you end a route at a place that has no address?

Let me show you.

Let's take as an example someone from the south shore of Massachusetts who's going to Castle Island (technically the name is "Fort Independance Park" and it's neither a castle nor an island, but that's really beside the point.)

We'll start by getting a map centered around the fort, so I go to maps.google.com and enter "fort independence park, south boston, ma" (click to display)

That query didn't work, so we'll expand the results by clicking the "See all 1,556 results..." link. (click to display)

There has to be a better way to do this.

Let's start over, and just get to the right neighborhood. (click to display)

Castle Island is at the end of the peninsula just south of Logan, but how do I tell that to Google Maps?

The key here is the "Link to this page" link at the top right of the Google Maps screen. When you click that link, it replaces the URL in your location bar with a URL that would give you exactly what you're currently seeing, after you've done all your panning and zooming and switching views around. What we're going to do is lift some information out of that URL and feed it back to Google Maps as input.

So, first let's get a good shot of Castle Island in Hybrid view. (click to display)

Now, let's quickly deconstruct the URI:
http://maps.google.com/maps?f=q&hl=en&q=south+boston,+ma&ie=UTF8&om=1&z=18&ll=42.338138,-71.011274&spn=0.003176,0.006781&t=h

For those of you not familiar with how URIs are constructed, I'll do the whole thing, rather than just lifting the interesting bits.

http is the application protocol identifier.

maps.google.com is the host address, in fully qualified name form.

No port information is provided, so the browser defaults to the application protocol default, in this case 80.

/maps is the path to the document requested.

Everything after the "?" and before the "#" (which isn't present) is part of the query string, which has its own rules. First we split it up wherever there's an ampersand:
f=q
hl=en
q=south+boston,+ma
ie=UTF8
om=1
z=18
ll=42.338138,-71.011274
spn=0.003176,0.006781
t=h


Everything on the left side of the equals symbol is the name of a field, and everything on the right is the encoded value for that field. The encoding basically just replaces characters that would cause problems for the computer that is trying to read the URI, so it's pretty straightforward. In this case, the only encoded characters are the two spaces in "south boston, ma" being translated to plus symbols.

Not surprisingly, the "ll=42.338138,-71.011274" gives us the coordinates of the center point on the map.

This information looks like it might come in handy, so let's do the same thing for a spot on the highway before the exit. (click to display)

This one yields "ll=42.299587,-71.047844"

Let's try plugging these values into the directions mode. (click to display)

That works like a charm, but I personally prefer the drive along Morrissey Boulevard, so I'd rather take that exit than the Columbia Road route that the directions provide. In this particular case, the easiest way to make that happen is to pick the exit ramp itself as the starting point. (click to display)

This won't work in all situations, so maybe one of these days I (or Google) will figure out a way to add in waypoints along the route - a much requested feature of theirs.

Incidentally, if you want to save a click, when you're looking for directions you can just type "from: place1 to: place2" into the main Google Maps search box. The same final map from above done this way looks like this: (click to display)



 What's Related  
  • (click to display)
  • (click to display)
  • (click to display)
  • (click to display)
  • (click to display)
  • (click to display)
  • (click to display)
  • (click to display)
  • More by matt
  • More from Technology

  •  Story Options  
  • Mail Story to a Friend
  • Printable Story Format