eli5 -How does gps software calculate drive time?

523 views

I understand mapping the shortest routes, tollways vs non tollways, ect but how is programming like google maps able to determine the amount of time your commute will take due to traffic patterns and congestion?

In: 13

8 Answers

Anonymous 0 Comments

It is using other phones in the network to base the estimation off of wether they are using navigation or not.

Anonymous 0 Comments

All the other phones in the road are sending data in real time. Combined with your phone knowing how fast you are driving it goes a long way towards an accurate estimate.

People have done experiments like taking a wagon and filling it with phones. They walk slowly down an empty road and it appears as a traffic jam on other phones.

Anonymous 0 Comments

The other replies about other phones feeding speed data are only partially correct. You can get an accurate calculation of drive time without it, just by knowing the speed of each segment of road. This data is available in map databases, and it comes from sensors within a municipality. Measurements are taken throughout the day so it is possible to get road segment average speed measurements for different times of day to refine further the drive time estimate, but even without this, posted speed limits can be used (and this is what early GPS maps did).

Google takes this further by taking speed data from phones in real time so that it can react to things like accidents and unexpected jams.

When the GPS calculates a route, the algorithm generally makes a branching tree of routes from the start point and the destination point, adding up times for each road segment, and whichever two branches from each side meet, that’s the fastest route.

Anonymous 0 Comments

The simplest way is to just take the distance divided by the speed limit on each segment to get a best case, then multiply it by a factor of 0.5-0.9 based on how much of the rout features things like traffic lights and stop signs.

That won’t take into account congestion and traffic, but it gives you a baseline.

Things like google maps are connected to the internet, where they have a database on current traffic built by other Android phones with location services/Google maps running and just normal traffic condition reporting data.

Anonymous 0 Comments

The system stores the map as a set of intersections and lines in between them for the roads. It does this even for things like on ramps. (In computer science this is called a graph).

As people drive over all these little segments using their maps, they send information back to the map system saying how long it took them.

Once the route is chosen, it can look up all the little segments and calculate a time.

That’s the basics. There’s more they can do, like estimate time at lights, or keep track of how much time it takes over the course of each day, and it can estimate ahead of time what it will be like.

Anonymous 0 Comments

Think about this for a second: say you want to go to the local shops, how would **you** calculate travel time?

“I went to the shops yesterday and it took 15 minutes.”

“But it’s 5pm and I know there’s going to be rush hour traffic, last time that happened was three weeks agon and it took me 25 minutes.”

“Oh but X highway is closed due to works, I have to take slower backstreets that will add another 10 minutes because the speed limit on those roads is slower.”

That’s fundamentally how mapping services like Google Maps do it. A combination of historic data, historic data for specific time periods (which automatically accounts for peak times, public holidays, etc), known road works, posted speed limits, average time spent at intersections etc. Combine that with the fact millions of drivers are carrying GPS tracking devices around that can report real-time traffic data back to Google for more accurate predictions, depending on what function you’re using (eg. setting a future departure or arrival time).

Anonymous 0 Comments

Aggregate data collected over a period of time. Google maps receives position and time info from your (and everybody else’s) phone. Using all that data, Google can predict how long it will take you to reach your destination. Because the data is updated so frequently, it can see traffic jams or other hold ups and update it’s prediction accordingly.

Anonymous 0 Comments

That’s already part of how they find the “shortest” route in the first place. Every road has a weight, several weights in fact, like actual distance, average time spent on the road, historical traffic data, actual traffic data, elevation info etc. These were all used to find the route, so they can be also used to calculate the time. Basically adding up these in a clever way.

It’s graph algorithms all the way down in navigation.