For the full version of the analysis and to view all the code click here (also to appreciate the amount of work going into this :-)
Junction elements:
Comparing the tasks and performance of junctions is a great way compare and improve traffic situations. However, the roads and junctions are a network and therefore inter-connected. Hence the poor performance of a junction may be due to the poor performance of a nearby system (road, junction, etc.) and not because of its own components/configuration. However, if a junction has excellent performance we can pride its components and configuration. Statements:
This means that you can’t simply replace the components of a bad performing junction with components of a similar (in task) components of a good performing junction. Because the bad performance may be due to the system. Hence, you first have to analyse the traffic as a whole.
I would suggest that analysis is done to inspect the origin of bad traffic. We should assume that this is either at a junction, or at a place of an accident or similar unpredicted event.
If we can identify the junction that first starts clogging and slow down overal traffic than we can start by applying junction analysis on that junction. Identify its task, identify other junctions with a similar task, and do a perfomance analysis.
In the following exploration we have originally skipped a proper analysis of localising the origin of traffic problems and we started to analyse junction A13 N470 because we were told it is a troublesome junction. However, in the 4th round of analysis We did look into the complete A13 and managed to identify the N470 junction not just as an area where traffic problems happen around but also as the origin/cause of many traffic problems.
See the Shiny app for an interactive analysis of the 4th round.
Create a map of the locations at which there are intensity and speed measurements.
Plot the intensity ‘signatures’ of two junctions. Left is the A13 N470 intersection, right the A8 N516 intersection.
To explain the plot:
So the red line with circles is the road on the east entering the junction (ID5). Or the green line with squares is the road on the north going underneath the junction (ID9).
We can see that intersections are both very busy. However, the one on the right clearly has two very intens spikes, going into Amsterdam in the morning and leaving in the evening.
Because they have similar intensities and the right intersection is even more busy we can compare their performance. For their performance we plot the average speeds on those roads that relate to the intensities.
You can see that the velocity dips are pretty equal, but note that the the traffic from the North going through (green) is equally busy in the afternoon in both places and the at the A8 N516 the average speed remains above 100 km per hour.
This means we can look at the physical elements that allow the blue line morning traffic to maintain such a speed while allowing as many cars to drive through that normally create a traffic jam at the A13 N470 junction. We could literally copy and paste the elements to improve the flow at the A13 intersection.
We had identified way more intersections to compare with, but obly had the time to analyse a few. Here is another intersection for comparison. Again the intensity plot.
They are not very comparible because the A13 N470 junctions is nearly twice as busy. Hence we don’t need to look at the velocity (performance) plots.
The thought came to me that the junction of A13 with N470 could be a place where traffic is generally quite bad, but that the junction itself might not be the origin of the bad traffic.
Before I pursue deeper analysis of the junction and similar ones I want to explore ways to identify origins of bad traffic.
For this I thought to use minute by minute traffic data of A13, which is available for the year 2011 from Rotterdam Open Data.
There are 4 main pieces of available data: flow and speed in two direction. I focus on speed data in the direction of Rotterdam. (created a feather file previously for faster loading)
Add some time columns to data for filtering through. It’s a large data set.
Subset a smaller piece of the data for exploration. I first chose January and then decided to take a Tuesday not to close to New Years (Jan 25). I ‘zoomed in’ on the hour when bad traffic starts to build up (between 3pm and 4pm).
Then plot along the whole road (x-axis) the velocity of the vehicles. And plot each minute in a different colour. This allows you to see a lot, but it’s messy. To further bring across the idea see the next plot. I subset even fewer data, 8 consecutive minutes and create a faceted plot. Each plot plots the whole A13 on the x-axis, where each point represents the speed at a certain place along the road. You can see the ’dips, representing slow traffic. As time progresses these dips usually move to the left, against the direction of traffic. That is because the back of a traffic jam grows and the front dissolves, making the traffic jam crawl backwards.
Note that I added the grey lines in the plots, they represent the four junctions in the A13, excluding the front (with A4) and Kleinpolderplein. The fours junctions are shown on this map. This allows us to see if the N470 junction is a problem area.
This exploration led me to develop a Shiny app, there I continued the analysis much further. Mainly you can use it to filter any part of the data with select options and then to play the facetted plot in a single plot as a timelapse.
Further I also did some summary analysis.
It occured to me that the job of a road is to move people along, preferably at approx. speed of the speed limit. A good road does this steadily, and a bad road has a lot of slowing down and speeding back up. The above plots allowed us to see the flux (change in speed), and it seemed that traffic jams simply crwal backwards. That would make each area of road equally bad.
I calculated, instead of the speed, the change in speed from one minute compared to the previous minute at the same location (for each location). Then I took the absolute value (slowing down is negative, speeding up is positive) and calculated the average. Now we have a ‘flux’ number for each location on the road. The higher it is the worse. You can plot this for any subset of the 2011 data on the Shiny App. For most subsets I found plots looking like this one:
And N470 is usually a peak. That means that here is most slowing down and speeding up across the whole A13. Meaning it is a source of many traffic jams.