Tuesday 4 December 2018

How much traffic might switch to the Toll Bridge to avoid the Bath CAZ?

A high estimate, based on 2017 traffic counts of A36-A46 transits, is that up to 30 vehicles/hour on this route could avoid the Bath Clean Air Zone (CAZ) and join the evening peak traffic (currently 100/hour) on the Toll Bridge. This is a 'high estimate' because it (a) ignores 'retirements' of old cars over the next 3 years (b) assumes all vehicles that currently go through Bath, are liable for the CAZ and could switch to the Toll Bridge, would definitely switch to avoid the CAZ.
In previous posts, I've explored the excellent Bath traffic data provided by BathHacked, looking at transits of Bath (which split into two groups North-East and South-West), and transits using the entry/exit points on the by-pass at Swainswick, and the A36 at Bathampton (Dry Arch). 

Now, I finally zoom in to get a first answer to the question of how much more traffic might there be over the Toll Bridge when the CAZ starts. I'm using (just) 2 days of data 31 Oct 2017 and 1 Nov 2017.

From the analysis so far, the main flow likely to generate additional traffic over the Toll Bridge is A36-A46 transiting traffic. I've not shown it so far in the blogs, but I found little evidence in the ANPR data of significant traffic on local flows with a choice between BathwickRoad-LondonRoad and WarminsterRd-TollBridge. There must be Batheaston-Combe Down traffic, for example, but not large compared to the 1,000 per day each way on the A36-A46.

First, here are the A36-A46 flows. In these diagrams traffic, like time, is going from left to right: start at Swainswick heading South, and leave at Bathampton heading East; or vice versa Bathampton West then Swainswick North. The height represents the number of vehicles: the thin 'Swainswick_S' vertical green bar represents around 2,600 (south-bound) transits.

Under half of the vehicles on these transits are detected by the ANPRs on London Road, or Warminster Road. While a few vehicles' number plates might not have been read at either intermediate point, it seems a reasonable assumption that most of the remainder (the light blue) simply took the 'direct' route avoiding the intermediate ANPRs, over the Toll Bridge. 



The key question is - how many vehicles currently go through Bath rather than take the Toll Bridge now, which might switch when the CAZ comes in?

To answer this, I first plot the traffic by hour of the day. We've seen that slightly more than half already take the bridge. The bar chart below shows this again, and shows in addition that the bridge traffic is fairly steady through the day (remember this is A36-A46 transits, so won't include school runs), while through Bath there's a more pronounced mid-day peak: less transit traffic in the morning and evening rush, for obvious reasons!


The chart has 2,606 vehicles over the Toll Bridge, 1,983 going through Bath in total. The peak hours on these two days for transits using the bridge are the evening, around 100 vehicles per hour (total in the two directions). 

Additionally, the chart shows the split between petrol, diesel and hybrid or pure electric - though this difference isn't essential here.




Then I split the vehicles into:

  • heavy-commercials (HCVs), which nearly all go through Bath, because they have no choice;
  • those with high or unknown emissions and therefore likely to be subject to the CAZ charge;
  • those with low emissions and therefore definitely exempt.




If the CAZ came in today, the vehicles that might change their behaviour are the middle set on the right: those that currently go through Bath and are likely to be liable to the charge. The proportion of these changing is unlikely to be 100%, because some might choose to go through Bath for other reasons (dropping someone off, say), or it might just be that we've classified the car as 'unknown' when they would not be liable, so an estimate here is an upper bound. Let's assume it's 100% for now.

The graph shows that, in the evening peak there's up to 30 cars per hour that could be tempted to make the switch, if the CAZ happened today. There's a little over 30 in the middle of the day, but the bridge is slightly quieter then.

But these are 2017 data. The key is assumptions about 'retirement' of the vehicles between now and the start of the CAZ at the end of 2020. Unfortunately, for the moment I haven't found good data to estimate that retirement rate, though my recollection is that the BreAthe consultation suggested retirement rates of 70-80%. That would bring us to the magic number of 'around 10/hour', but I'm not currently in a position to explore that step further.




Saturday 1 December 2018

More evidence that most cars and light commercials transiting Bath (Bathampton-Swainswick) already use the toll bridge

In an earlier post, I estimated that nearly half of vehicles transiting Bath between the A36 Warminster Road and the By-pass at Swainswick already used the toll bridge.

In this post, I provide more supporting evidence for this: showing that the split by vehicle types makes sense.

Nearly all heavy commercial vehicles (HCVs) go into town (via Warminster Road and London Road, or vice versa) and then back out again. 

Recall that in these plots, a transit of Bath starts on the left and ends on the right. There's just the thinnest of light blue lines at the top of the diagram for HCVs which are not recorded by ANPRs between Swainswick (south-bound) and Bathampton (Dry Arch). 



The majority of cars and light commercial vehicles that are heading South (see the "Swainswick_S" node on the left) are next recorded at "Bathampton_E" (Dry Arch, leaving Bath). These, we are assuming, use the toll bridge, although a small percentage might have been missed by 2 ANPRs on the way (previously we estimated this 'missed' rate at less than 5%).

Heading North, the proportions are slightly smaller, between 50% and 60%. 






Jumping between RStudio Notebooks and Google Blogger

I've been looking for some time for a way to prepare blogs - a mix of text, highlighted code and diagrams - in RStudio notebooks and get them easily into Blogger.

A simple cut-and-paste doesn't work (on MacOS, from Safari or Chrome). Inspecting the html, somewhere along the line the code gets stripped out, just leaving the HTML tags behind. So code blocks are empty.

The work-around I've found is only half clunky! (This is for MacOS)


  1. In RStudio, R notebooks. Get rid of "code folding" to avoid having 'hide' buttons that don't work lying around in your blog. This is best done from the 'output options' menu (next to the 'preview' button just above your code). If you insert this directly in the code, the R notebooks seems to revert to markdown. You should see something like this:

  2. Header: 

    title: "XXX"
    output:
      html_notebook:
        code_folding: none
        highlight: tango
        theme: flatly

  3. Preview - in Chrome (not Safari). 
  4. Select all - copy - paste into rtf in TextEdit.
  5. Copy again and paste into ‘compose’ pane of Blogger.
  6. Select all, set text background to white (of all) to get rid of in-line code having a black background.
  7. Delete each image. (They look ok, but will show as 'unknown png' when you preview)
  8. Drag each image from Notepad, separately, and resize. (If you want more control, then you need to export each separately from RStudio and import into Blogger.
  9. Cut out the title, and paste it into the title box of Blogger.

If you have a neater way, do let me know!