Using the Google Maps API to Estimate Future Travel

Can I request Google Maps for an estimated travel time between two points at any time in the future?

I regularly use the Google Maps Navigation app on my Droid phone while driving, and this is surprisingly useful, especially since it knows about traffic delays. However, I would like to receive these notifications of traffic delays ahead of schedule, so I know that I will leave early if the fastest route takes a little longer than usual. In fact, I would like to make a version of these broadcasting warnings, except for those that are really useful in the sense that they know the exact points that I travel to and from.

I was looking for documents, and while there were some similar questions and information about adding traffic overlay to the map or getting routes and even getting the duration of the trip , there seems to be no explicit way to indicate when the trip is taking place (for example, when I usually commute).

EDIT: I do not expect to get a forecast for the month in the future. Just a couple of hours maximum.

+4
source share
1 answer

Not like that.

The Google Maps API Direction class has a getDuration() method, which indicates the number of seconds to travel.

The GDirectionsOptions class GDirectionsOptions not contain temporary methods. He has such things as indicating the type of trip (drive, walk, bus), โ€œavoid tracksโ€ flags, etc.

Even if there is some way to extrapolate traffic in the future, there is no way to access the data itself, so you cannot use it to calculate your own duration in any case.

+2
source

All Articles