Be aware that there's a speed restriction of about 4 or 5 GDirections
requests per second. If you were to look up the road distances to 270
tube stations it's going to take something like 60 seconds.
What you can do is scan through the list of tube stations looking at the
straight line distances and create a shortlist of the 5 or 10 tubes that
have the nearest straight line distances. Then scan the shortlist for
the one with the shortest driving distance.
Be aware that people in London never drive to tube stations, because
there's nowhere to park. You may want to use walking distances, so that
the routes are allowed to walk the wrong way through one-way systems (of
which there are very many in London). However, you can't perform a
walking GDirections without a directions panel because Google are
legally required to display the disclaimer which they put at the top of
that panel.
Also be aware that Google only geocodes UK postcodes to "outcode"
accuracy (due to Royal Mail licensing restrictions). There may be
several tube stations in one postcode "outcode" region.
Consider an example. Suppose I want to find the nearest tube station
from a point anywhere in the W2 region. In reality the nearest tube
could be Edgeware Road, Bayswater, Queensway, Lancaster Gate,
Paddington, Marble Arch, Notting Hill Gate, Royal Oak or Westbourne
Park, depending on where exactly you are in the W2 region.
When you geocode "W2 4SS" (which is the postcode of the Queensway tube
station) the geocoder returns the centre of the "W2 3" region, which is
in the middle of Kensington Gardens. The nearest tube station to that
location turns out to be Lancaster Gate. GDirections:walking allows you
to walk through the park, a distance of 0.3 miles. GDirections:driving
knows that you can't drive through the park, so it snaps the starting
location to Bayswater Road and drives you round the one way system via
Lancaster Terrace and Westbourne Street.
--
Mike Williams
--
You received this message because you are subscribed to the Google Groups "Google
Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.