Traffic data

From Wazeopedia

Along with every routable segment, Waze stores separate data about how long it takes to cross that segment in both directions and transition (straight, right, left, exit, keep) to every other segment that is junctioned to it. It stores similar information related to the entry and exit segments to junction boxes and the junction box that connects them. This information is used by the routing servers to figure out the fastest way to get to a destination. If a segment is deleted, then the information about the time it takes to cross it or enter it from another segment is also deleted. Some types of changes at nodes can also cause loss of information about the transition from one segment to another through this node.

This article explains what traffic data is stored and what happens to it when the map is changed.

Summary: How to preserve traffic data while editing

  • Avoid creating too-short segments (less than 19.69 ft (6 m))
  • Avoid deleting segments. If you delete a segment, Waze loses all traffic data for that segment.
  • Avoid disconnecting segments. If you disconnect a segment from the junction node where it joins another segment, and reconnect it in a different place, then Waze loses all traffic information about crossing to / turning onto the next segment.
  • Follow established procedures for creating a divided roadway in place of a 2-way street. Use pieces of the 2-way segment to create both new parallel one-way segments to preserve the speed data in both directions and to preserve the "most important" turn wait times.
  • Follow appropriate procedure for "undividing" a roadway. Use both one-way segments to create a single new 2-way segment so it can carry the speeds from both one-way segments. Preserve the "most important" turn wait times.
  • To preserve junction box data when it is necessary to delete and recreate a junction box, preserve as many of the segment IDs as possible by minimizing cutting or merging of segments.

Why Waze stores traffic data

Waze uses a routing algorithm to search for the quickest route from the start point ot the end point. These types of algorithms all construct a route from node to node on the map, using traffic data along the way to figure out the quickest node-to-node travel times that will get you to your destination. The Waze routing server uses uses Waze's proprietary algorithms and the traffic data you transmit every time you use the waze app to figure out the fastest route on the waze map.

If a portion of the route goes from node 1 to node 2 to node 3, using segments 100 and 200 along the way, Waze uses its stored traffic data to figure out how long it takes to travel the length of segment 100, through node 2 to segment 200, and then the entire length of segment 200 all the way to node 3. If the route begins or ends somewhere in the middle of a segment, Waze uses the traffic data to estimate the just the portion of total travel time for that segment you will use along the part of the segment you will travel.

For drives in the US and Canada, the Waze routing server always uses default data for travel on parking lot segments. This means there is no accounting for different wait times for outbound turns in different directions, or at different intersections. Traffic data from actual wazers is used in routing over all other segment types.

Traffic data is stored for every way out of each segment.

What traffic data is stored

  • As you drive, the Waze app (client) on your mobile device collects data about your GPS location and when you were there. It sends that data to the Waze server.
  • The Waze server uses this data to figure out which nodes you travelled through, which segments you used to travel between them, your average speed, how long it took you to make it through the segment.
  • This data is collected even on drivable segment types for which the Waze routing server does not use that data.
  • Traffic data collected on short segments (less than 19.69 ft (6 m)) is less accurate.
  • Waze averages together everyone's information during the same time slice from the last several months so it can figure out how long it took to get from one node to another, through it, and onto a new segment.
  • It keeps track of this information in the forward (A to B) and reverse (B to A) direction, and for every possible exit from the segment at the node it is joined to. So if segment 100 is junctioned to segments 201, 202, and 203 at its B junction node, It can figure 3 different cross times in the A->B direction - for 100->201, 100->202, and 100->203.
  • If the segment has a restricted lane (Bus, Express, HOV, etc) , the same type of information is stored for one "extra" lane. So if segment 100 also has a left HOV lane, then Waze will be able to figure out 3 more cross times in the same direction - for 100HOV -> 201, 100HOV->202, 100HOV->203.
  • Nodes are the primary way Waze routing server looks at routes. All data about transition between two segments is stored with the ID of the node involved, as well as the two segments connected to it.
Junction Box 5.png

Junction boxes and traffic data

When a junction box is created, Waze begins to calculate and store junction box traffic data in addition to the data associated with the segments and nodes. In this example, for traffic entering the junction box on segment F, Waze will begin keeping track of traffic data for traffic exiting at B (left turn), A (straight) and E (right turn). This allows Waze to keep better track of the difference in speeds for traffic backed up past node D to turn left versus traffic moving quickly through to go straight. Junction boxes function something like a node. Where they are present, Waze routing servers use the junction box traffic data instead of the underlying segment and node traffic data, though it continues to collect both sets of data.

If a junction box is deleted and then recreated using the same segments before too much time passes, the Waze routing servers can use the previously stored junction box data for any segment IDs that have not been deleted.

Where does this information come from

  • When a new segment is created, initial traffic data are created based on a default average speed for the road type and a transition time to each segment it is junctioned to. These values will be updated as soon as waze records traffic using the segment and the junction nodes.
  • Waze frequently updates traffic data by analyzing the traffic that has travelled on each segment at each time slice of the week. Those real-life traffic data are averaged to come up with the stored values. There are a lot of details we do not know about how traffic data is analyzed, and how the traffic calculations take into account loss of cell service, wazers stopping on the side of the road or entering or leaving a segment in the middle, etc. LiveMap shows us 48 time slices per day (every hour and half hour), and we don't know whether that has anything to do with the number of time slices Waze uses in its calculations.

Glossary

segment 
One piece of road. Every segment has a unique segment ID, an A and B end, and might have some geometry points between. Every segment is connected to a node at both ends, and has a forward (A to B) and reverse (B to A) direction of travel.
node 
Nodes are found at both ends of every segment. The Waze routing engine uses the information associated with the segments and nodes to determine how long it takes to travel between two nodes. If two segments are joined to the same node, the node is often referred to as a junction node. If only one segment is attached to the node, the node is often referred to as an end node. An end node may become a junction node if another segment is joined to it, and a junction node may become an end node if all but one attached segments are removed from it.
Time slice 
A specific day of week and portion of a day. A time slice might cover an hour or half hour of the day, or it might cover a different length of time.
Segment cross time 
The time it takes a wazer to enter the the segment, cross it, and exit the segment in one of the possible exit directions. This cross time includes the average time spent "waiting for the light to change", "waiting to make a turn", or "waiting at the 4-way stop". For a 2-way segment connected to a 4-way intersection at each end, there are 4 segment cross times in the A->B direction (straight, left, right, and u-turn) and 4 more in the B->A direction. For segments marked as having an additional reserved lane (HOV, Express, motorcycle, etc) in the right/middle/left lane, there is one more additional set(s) of cross times associated with the restriction (for more on this, please see Carpool, HOV, Transit lanes.
Segment cross speed 
segment cross time divided by length.
Traversal Time 
A "base" time to cross a segment in the A->B or B->A direction, not including transition times to cross from one segment to one of the other segments it is junctioned to. Might be used to calculate new segment cross times when an existing segment is cut into two new segments.
Transition Time 
A calculated "wait" time to transition from one segment to another, not counting the Traversal time. Might be used to calculate new segment cross times when an existing segment is cut into two new segments.

What information we can see

Scripts like route speeds can retrieve segment cross times for an hour or half hour, any day of the week, along any of the routes the routing server gave it. These scripts can calculate speeds based on these cross times.

When is traffic data lost?

  • When a segment is deleted, all traffic data involving that segment is lost.
  • When a node is deleted, then all the data about transitions between segments connected to that node is lost.
  • If a segment is disconnected from a node and saved, then data about transitions between that segment and the remaining segments still connected to that node will eventually be lost.
  • If a junction box is deleted and recreated, but the entry and exit segments to the junction box are different, then some traffic data will be lost.
  • If no traffic is assigned to a segment or a direction on a segment then the old traffic data for that direction will be retained for a week or two. After that, it will be lost.

What happens to traffic data when you make changes to the roads

  • When you delete a segment (let's call it segment 100)
    • All traffic data for that segment is deleted
    • All traffic data for other segments coming INBOUND to that segment is lost
    • All traffic data OUTBOUND to other segments is lost.
    • If you delete a segment and replace it with a newly-drawn segment, waze has to start from scratch with default values for segment speeds and turns and collect new traffic data.
  • When you shift the position of a junction without disconnecting anything, changing the lengths of several segments
    • The speed on the segments can be used - cross times will change to account for the fact that the junction has moved.
    • Over time, the stored traffic data will change to bring segment cross times back into line with reality.
  • When you cut a segment (let's call it segment 100) into 2 shorter segments without changing anything else at the 2 original junctions (Examples, connecting a PLR to segment 100 or having a change in speed limit along segment 100.)
    • Two new segments are created with brand-new segment IDs (let's call them 201 and 202)
    • The segment and the segment ID (100) from the segment you cut is deleted.
    • A junction node is created where the two new segments are joined.
    • The segment cross times of the original segment are used to calculate new cross times for the new segments, including cross times connecting the two new segments.
    • Over time, the stored traffic data will change to adjust the new transition times in line with reality.
  • When you merge two segments (let's call them segments 201 and 202) into one longer segment by deleting the junction node connecting them (node 999)
    • A new segment is created with a brand-new segment ID (let's call it segment 300)
    • The segment cross times of segments 201 and 202 through node 999 are used to calculate new cross times for segment 300
    • Node 999 is deleted.
    • Segments 201 and 202 are deleted.
  • If you move one end of a segment (connected to node 999) and connect it to another node, the node that was not moved will be used for the new junction.
    • If node 999 was connected to an additional segment, it will remain in place.
    • If node 999 was only connected to the segment end you moved, it will be deleted.
  • When you disconnect a single segment from a junction:
    • the node remains connected to the unmoved segment and
    • a new node is created on the moved end of the moved segment.
    • Therefore, If you move a segment end away from a junction node and then move that same segment end back to the same junction node, you will preserve the original node ID and all associated traffic data
    • But if you move a segment end away from a junction node, and then move the other segment(s) away from the old junction to join the new node ID, you will lose the original node ID and all associated traffic data.
  • When you move segments from one junction node to another junction node
    • All traffic data which passed through the first junction node are lost, because they were associated with the two connected segment IDs and the node connecting them.
    • Traffic speed on the segment is still usable.
    • New traffic data connecting the same segments through the new junction node are created using default values because traffic data connecting two segments depends on the two segment IDs and the junction node ID.
    • If you begin with two segments, 101 and 102, disconnect them, save, reconnect them through a new junction node, and save again, the original transition times between 101 and 102 will be lost. They will be replaced by new default values.
    • Over time, transition times between the two segments will be adjusted to reflect the new traffic data.
  • Traffic data corresponding to a restricted (red) transition arrow between segment 200 and 201 will still be collected as long as traffic can be assigned to a route from segment 200 to 201 (see below)
  • Improperly divided roads
    • Traffic data corresponding to the "wrong direction" on a one-way segment will not be collected if the traffic data is assigned to other nearby segments. If no traffic is assigned to a segment direction, the old traffic data will be retained for a week or two.
    • If a 2-way segment is improperly divided by drawing a new one-way segment parallel to the old segment, and the old segment is made one-way, then the stored "wrong way" traffic data on the old segment will be retained for a period of a week or two. New traffic data in that direction will be collected on the new one-way segment.
    • If you find an improperly divided road w/in a few days (red road(s) for the new section(s)/not connected segments/improper turn restrictions) then turn the original sections back to two way and properly divide the road. This will retain the older data vice having to restart the data collection from scratch.
    • This is why it is best to use pieces of the existing 2-way road for constructing both new one-way roads when it is necessary to divide a roadway (create a dual carriageway)