Home > Web > Hampshire Twittering Traffic-Jams – SMS alerts – @hants_motorway

Hampshire Twittering Traffic-Jams – SMS alerts – @hants_motorway

January 14th, 2010 Ed Leave a comment Go to comments

Something that drives me nuts is every so often there’ll be an accident on the M3 or M27 and the entire surrounding area will be flooded with people trying to avoid the deadlock, only to find they’re on a tiny road with thousands of other people. Yes, I could check the traffic websites each morning, or do some intelligent parsing of traffic RSS feeds, but the first option requires effort before 9am (not going to happen), and the second option is never going to be reliable enough – it’d be too hard to programmatically determine how bad the conditions on the road really are.

Twitter feed

What I really want is a text message telling me which junctions on the M27 and M3 are delayed and roughly what their speed are. While I don’t actually use the motorways to get to work, if they’re gridlocked, the surrounding country-roads tend to also be gridlocked, so this should work. My house already texts me thanks to twitter, so that part of the system is easy, and has the bonus of other people can use it.

After discovering a site that gives average speeds between junctions, cogs started to whir. Unfortunately the site doesn’t provide a nice feed, but that wasn’t going to stop me.

A few hours of Java hacking later, @hants_motorway was born.

Every 20 minutes, between 7am-10am and 4pm-7pm, the speeds of each junction between J2-J12 on M27 and J4-J14 on M3 are recorded in a database, and compared against the speed of that junction at that time in the previous month. If it is less than 45%, it assumes there’s a delay and puts a message on Twitter. When the list of junctions delayed change, or the delays end, another message is put on Twitter.

I’ve setup my personal account (@ejellard) to follow @hants_motorway and to text me each update.

I’m hoping that this means that those driving from the Southampton area to some location near Winchester won’t have to sit in stupid amounts of traffic. I obviously can’t guarantee it’s accuracy, and no doubt my house will have a power-cut or network outage the one day it would be useful, but it shouldn’t give false-positives (or negatives, depending which way you look at it). Let me know what you think, and if there are any better ways of doing this.


And purely because I can, here’s an “interesting” graph of road speeds of different junctions along the M3:
M3 Roadspeeds

And the M27:
M27

Categories: Web Tags: , ,
  1. January 14th, 2010 at 16:11 | #1

    I live further north in Hampshire (M3 J4) – any chance of extending the north/south readings for the M3 :-)

  2. Ed
    January 14th, 2010 at 16:13 | #2

    Sure. Think I’ll extend it to there and to Portsmouth. Will increase number of irrelevant SMSes people get, but hey!

  3. January 14th, 2010 at 22:19 | #3

    Noooo, I don’t want to know about Portsmouth or anywhere north of Winchester! He’s not from round here; make him queue!

    That is an interesting graph, but which direction at all of those junctions? Will also be interesting to see if the graph changes when they’ve finished working on the junction 5 roundabout.

  4. January 30th, 2010 at 12:55 | #4

    Oh, very nice stuff Ed – hopefully this will help me avoid/be aware of the jams on the few occasions that I do venture out in meatspace :)

  1. January 14th, 2010 at 17:53 | #1