1. Summer daze

    No lolling about in the sun for us, as we follow an endless chain of projects through the hot months. Inured to hasslebot, we’ve not been posting to this blog much. Instead, busy working on, or soon about to work on:

    • The ePetitions site for Number 10
    • On a syndicated version of PledgeBank for someone’s large global warming campaign later in the year, and another for a fundraiser for a Brazilian NGO
    • Making more maps (like these) for the Department for Transport
    • Adding an API to TheyWorkForYou, paid for by an award from the Department for Constitutional Affairs
    • Meetings endless meetings. I’ve given up trying to track Tom meeting people, and just assume at all times he is in an important meeting.
    • Supporting all our existing sites – customer support emails, nursing parliament screen scrapers, fixing up WriteToThem contact details, making sure our servers don’t break.

    And that’s without mentioning Neighbourhood Fix-it and the call for proposals. Later in the year. Have I missed anything?

    Have a good weekend!

  2. How much is that map in the window?

    A charity wrote to us shortly after we published our time travel maps asking whether we could make such a map for them. We were happy to oblige – it is nice to know that there are real rather than theoretical users for work like this.

    Obviously, we knew we couldn’t do this work without getting the data licenced for commercial use. So I called the Ordnance Survey, left a query, and after a couple of clarifications here’s what we got back:

    ———- Forwarded message ———-
    From: PGA Helpdesk
    Date: 08-Jun-2006 17:15
    Subject: RE: mySociety mapping
    To: Tom Steinberg

    Sorry for the delay. Prices would be…

    25k – 16 tiles = £301.12
    Code Point – £731.59
    250k Raster – £106.22 for England cover or £183.22 for UK cover
    (please ignore what I put below about 250k only being available in uk

    All prices for 1 user, 1 year licence and exclude VAT. Terms of data
    use are internal business use, display and promotion as long as there
    is no financial gain.

    Hope this is okay.

    So fact fans, that’s between £837.81 and £1032.71 to produce a single map (depending on scale) as long as the user doesn’t publish it or show it to anyone else.

  3. Travel-Time maps: Pretty and useful

    mySociety developer Chris has made some maps. I think you will like them.

  4. Travel-time Maps and their Uses

    This project became Mapumental. Please visit www.mapumental.com for details of our transit-time maps and the services we can offer.

    The work was funded and supported by the Department for Transport.

    (See also the separate post on methods.)


    Transport maps and timetables help people work out how to get from A to B using buses, trains and other forms of public transport. But what if you don’t yet know what journey you want to make? How can maps help then?

    This may seem a strange question to ask, but it is one we all face in several situations:

    • Where would I like to work?
    • Where would I like to live?
    • Where would I like to go on holiday?

    These are much more complicated questions than those about individual journeys, but one thing they all have in common is transport: can I get to and from the places I’m considering quickly and easily?

    The maps on this page show one way of answering that question. Using colours and contour lines they show how long it takes to travel between one particular place and every other place in the area, using public transport. They also show the areas from which no such journey is possible, because the services are not good enough.


    Rail travel in Great Britain

    Our first example is about rail travel. The map below shows how long it takes to get from Cambridge Station to every other station in the UK, starting at seven o’clock on a weekday morning. This could be useful if you lived in Cambridge, and were wondering where you might go for a long weekend away and didn’t want to travel more than 4 hours. We assume that people will take a taxi from a convenient train station to their destination, so long as that journey is no more than an hour. (Please see our methods page for a more detailed description of our assumptions.) You can click on any of the maps on this page to see a larger version.

    Map showing travel times by rail and taxi from Cambridge to other points in Great Britain, starting at 7 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    The white contour lines are drawn at one-hour intervals, so the innermost, almost circular contour shows destinations up to an hour from Cambridge, the concentric one two hours, and so forth. (Technically, the contours are “isochrones”, meaning lines of constant time, as for “isobars” for lines of constant atmospheric pressure on a weather map.) Places, such as Leeds, which are surrounded by little circular contours are more-accessible “islands” served by fast trains with infrequent stops; they are therefore quicker to reach than those in the surrounding areas which require lengthy changes or journeys on slower services.

    The colour scale, shown on the top right of the map, is in hours of total travel time. Warm colours indicate short travel time—red for four hours or less, orange and yellow for four to eight hours—and cool colours longer journeys. The longest journey times of all, to destinations in the far north and west of Scotland, are over nineteen hours (remember that this includes waiting time, which could often be overnight). Areas with no colour at all, such as the area around Hawich on the Scottish Borders or the north-west coast of Scotland, cannot be reached at all by rail and a taxi journey of up to one hour.

    The map shows that the fastest journeys are those along the East Coast Main Line north to Edinburgh, and those south to London, which is served by frequent fast trains. Everywhere in England can be reached within about seven hours (so by two o’clock in this example), and everywhere in Wales within about ten hours, though many of the fastest journeys to rural areas of mid-Wales will involve a long taxi journey. The urban areas of lowland Scotland are similarly well-connected, but areas further north are much less accessible, or even inaccessible where there are no stations within an hour’s drive of a given destination.


    The next map is for journeys starting from Edinburgh Waverley station, but otherwise it is the same as the Cambridge map.

    Map showing travel times by rail and taxi from Edinburgh to other points in Great Britain, starting at 7 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    Here the East Coast Main Line is even more obvious than in the preceding map; it appears as a tendril of red and pink stretching south from Edinburgh down to London.

    Comparing car and train travel

    Again considering journeys starting from Cambridge, this map shows which parts of the country are quicker to get to by train (red and orange), and which by car (green and blue). Yellow and light orange show areas where there’s no great difference. This could be useful if you had limited access to a car and were planning where to go, or wanted to see whether it was worth hiring a car for a particular trip.

    Map showing the difference in journey times by rail and taxi, and by road alone, from Cambridge to other points in Great Britain, starting at 7 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    This time, contours are drawn for each hour of difference in travel time. Note also that the scale is quite asymmetric: the most time you can save travelling by train is about two hours, but—for places which are difficult to reach by train—you can save six or seven hours travelling by road.

    From this map, journeys to London are quicker by train (the road travel model takes no account of traffic or urban areas, so it is pessimistic about the time saving) as are journeys to Leeds, Berwick, Edinburgh, Glasgow and other points served by trains on the East Coast Main Line. In the west of England, journeys to Exeter and thereabouts are quicker by rail, but all other journeys are quicker by road (largely because most westward journeys require a change at London or a slow cross-country train to Birmingham).

    (However, the model of car journey times is very simplistic, so these results should not be taken too seriously—we hope to extend the work with a more realistic model of driving times, which may substantially change the comparative results.)

    Bus and rail travel in Cambridge and surrounds

    Our second example is based on public transport in and around Cambridge, which chiefly means buses within town and from outlying villages into the city center. Here we ask how early must you get up and leave your home to reach a particular place of work by public transport. In this example the destination we’ve selected is the University of Cambridge’s West Cambridge Site, which is also home to a number of commercial employers including Microsoft.

    Map of Cambridge showing times of departure to reach the West Cambridge site by 9 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    This map shows the city center of Cambridge, and the area around the destination, which is marked by a small black circle (left middle). Again, warm colours show short journey times—in this case, later departures—but the contour lines are drawn at intervals of ten minutes, rather than an hour, so that the innermost contour around the destination corresponds to a start time of about ten to nine. Again, uncoloured areas are those not served by any services; on this map these are all fields lying outside the city itself.

    Cambridge is a small city with a lot of bus services, so it is not very surprising that the whole of the city center and much of the suburbs are within twenty to thirty minutes’ travel of the destination, even including waiting and walking time. Moving further out, though, the picture changes: (selected villages are labelled for orientation purposes)

    Map of Cambridge and surrounds showing times of departure to reach the West Cambridge site by 9 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    The larger map clearly shows the differing level of service to various outlying villages within 5–10km of Cambridge. Areas which are connected to Cambridge by fast roads, such as the A14 which runs through Fenstanton and Bar Hill, then skirts Cambridge to the north, and continues east via Stow cum Quy (just south of Swaffham Bulbeck) are much better served than villages such as Reach, which lies well off the beaten track. Waterbeach and Great Shelford, to the north and south of the center of Cambridge respectively, are also served by train services. Even on this scale there are a few habitations with no or limited bus service and from which it is not possible to reach the West Cambridge Site for 9 o’clock purely by public transport without a long walk or an overnight journey (for instance, Rampton, to the north-east of Longstanton, or Childerley, to the north-west of Hardwick).

    Looking at a yet larger scale shows a similar pattern:Map of Cambridgeshire and surrounds showing times of departure to reach the West Cambridge site by 9 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    This map shares the same colour scheme as the previous one—warm colours indicate short journeys, and cool colours long journeys—but the contours are at intervals of thirty minutes rather than ten. Towns such as Huntingdon, Newmarket and Ely are ideal commuter territory, as are some intermediate villages; but most outlying villages aren’t connected at all.


    As a comparison with transport around Cambridge, we’ve also drawn maps for London, a much more densely-populated area with correspondingly better transport infrastructure (you will see that there are almost no inaccessible grey areas). Here the chosen destination is the Department for Transport (DfT) headquarters on Horseferry in Westminster. Starting with the most local map:

    Map of central London showing times of departure to reach the Department for Transport building by 9 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    Again, warm colours indicate short journeys and cool ones longer journeys. On this map contours are shown at ten-minute intervals, so that the near-circular one around the destination indicates the area in which you can get to the DfT by leaving the house at about ten to nine in the morning.

    Moving slightly further out, nearby tube stations (St James’s Park, Westminster and Pimlico) and bus routes to the south and east are important. Further south there are islands of accessibility around mainline train stations such as Brixton and Clapham Junction. On a smaller-scale map, the tube and railway lines themselves show up as chains of such islands:

    Map of central London and suburbs showing times of departure to reach the Department for Transport building by 9 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    On this scale, particular ill-connected areas of London are clearly visible: Hackney, Richmond and Dulwich (despite a direct train service to Victoria) both require an eight o’clock start to arrive at the DfT for our nine o’clock deadline. Compare these to the region of good connectivity stretching south and south-west from the center, along the Northern Line and mainline rail line through Wimbledon, the District line to the west, and the Docklands Light Railway to the east. On this scale individual bus routes are not particularly evident, even though they are significant everywhere that rail or tube stations are too far away to walk to in the model; contrast this with the Cambridgeshire maps above.

    On this final map, of the whole Greater London area and surrounds, the contour lines are at half-hour intervals:

    Map of Greater London and surrounds showing times of departure to reach the Department for Transport by 9 o'clock on a weekday morning

    © Crown copyright. All rights reserved. Department for Transport 100020237 2006

    At this scale the suburbs of London appear to be arranged along a southwest–northeast axis, a result of good rail links to Surbiton and Twickenham (at the ends of the two red tendrils which stretch away from the center to lower left). Other rail lines, such as those to Bromley and Orpington in the southeast, are also visible, as are islands of short journey time such as Watford (northwest), Hersham and Esher (southwest); these surround individual locations with fast (c. 1 hour) journey times into central London.

    What next? Further work

    We are considering various possible extensions and improvements, and we’re keen to talk to anyone else interested in the work so far, or any of these ideas:

    Relating journey times to house prices
    An obvious application for travel time data are to people’s decisions about where to live. By comparing journey time data for particular locations to house prices in areas nearby it would be possible to tabulate the cheapest areas to live in within a certain travel time of a desired location, for instance a person’s place of work.
    Improving the road travel model to better reflect comparative rail and road journey times
    At the moment our rail travel model assumes that the final stage of each journey is by taxi, under the assumption of a uniform and isotropic road network. This is clearly inadequate; we would like to extend it using journey planning software (preferably including traffic and time-of-day effects) to
    produce more reliable travel time and modal comparison maps.
    At the moment the maps are constructed on the assumption that users will always choose the quickest journey under the imposed constraints. Of course in reality users also respond to other incentives, of which one of the most importantly is price. If we could obtain fare data we could show journey costs rather than times, use more realistic constraints (for instance, choosing the shortest journey cheaper than a certain amount), or comparing the prices for tickets bought on the day to those bought at varying intervals before travel.
    Improving the readability of the maps
    The maps could be made much easier to understand. Improvements could be made by refinement of the colours used and by replacing the current (OS Explorer and 1:250,000) base maps with simpler ones showing sufficient information to allow the viewer to understand the placement of the map without extraneous detail such as building lines etc.
    Incorporating reliability information
    Presently we assume that all public transport services run according to their published timetable. This means that we are more optimistic about total travel times than would be regular users of those services, who will know how often services are late, cancelled or whatever. In some cases—for instance, train services—reliability data are published, but in general this is probably better handled by a statistical model. Both reliability and
    users’ tolerance for unpunctuality could be incorporated, so that users could state the tolerance they have for late arrival at their destination (for
    instance, no more than once every month) and journey times computed so as to meet that target on average.
    A real-time web service
    While our approach uses only published data and services (existing public sector journey planners such as
    TransportDirect), the maps are quite slow to construct; for instance, the one of London above required about ten hours of computer time; further, each one is relevant only to a particular destination or origin (and points near it). If we could speed up this process, we could generate maps on demand for visitors to a website; to do this we would need to work with organisations such as Transport for London and incorporate more specific information about services in each area, rather than relying entirely on outside services. This is an attractive idea, although it would be expensive to build.

    Please contact us if you have any questions or comments.


    This work was funded by the Department for Transport, who also made it possible for us to use Ordnance Survey maps and data through their licence; without this assistance we would have had to pay expensive fees to use the underlying mapping data or to produce maps with no landmarks, which would be almost incomprehensible. DfT also gave us access to their National Public Transport Access Node database, which records the locations of train and tube stations and bus stops; without this it would have been difficult to produce any maps at all.

    The data we used

    Although the journey planning services and software we used were publicly accessible, almost none of the other data is available unless you pay for it, or your work falls under an existing licencing agreement. So while we set out to demonstrate how easily we could make travel-time maps from public data, very little of this work could be cheaply reproduced or extended without assistance from a government department.

    That’s unfortunate, because it means that innovative work by outsiders in this area can only go ahead if it’s explicitly sponsored by government. If all the data we’ve used had been available for free, somebody else might well have done what we’ve done years ago, with no cost to the taxpayer. We’d love it if others extend the work that we’ve done, but realistically there aren’t very many people in a position to do this cheaply.

    Remember, this blog post was written many years ago

    Visit Mapumental for our latest mapping technologies!

  5. Travel time maps: methods

    This project became Mapumental. Please visit that site for details of our travel-time maps services.
    The work was funded and supported by the Department for Transport.

    See also: the main travel-time maps report.


    Clearly the travel-time for a particular journey is a function of the origin and destination points, the time of travel (whether of departure or arrival), the modes used, and of decisions made by the traveller (for instance whether to prefer faster or cheaper journeys). Our travel-time maps can only conveniently display a function of one point (the origin or destination point), so we need to fix the other arguments so that (a) it describes journey times which are useful to users in some context, and (b) it is practical to compute.

    We evaluate the travel-time function using published the following journey planners:

    This is off-the-shelf desktop software for planning rail journeys on the national rail network. It includes a full timetable for rail services in Great Britain.
    Transport Direct
    This is a website which provides uniform access to regional journey planner services operated by local councils and others in different parts of the country. It will give routes by all modes of public transport and road journeys throughout the country.
    Transport for London’s journey planner
    This is a website which provides the same service as TransportDirect for the London area.

    In each case custom programs were written to drive the journey planner. For RailPlanner, this took the form of a small Microsoft Windows program which simulates filling of the text fields for origin, destination and departure time in the RailPlanner application window, simulates clicking of the button to start a search, and extracts the results using the Windows debugging API. This allows queries for routes between rail stations to be computed quickly and conveniently; because it runs on the local machine, the search is fairly fast, and a few minutes is enough to compute the journey time from a given starting location to all other railway stations in the country.

    In the other two cases a conventional web “scraper” was written using the WWW::Mechanize perl extension. In these cases we ask for routes between postcodes, rather than between named bus stops, tube stations, etc. We chose this approach because, while there is a standard dictionary of bus stop etc. names in the National Public Transport Access Node database, we were not confident that those names would be interpreted unambiguously by the journey planner websites. By contrast, postcodes are completely unambiguous and since most bus stops etc. are in built-up areas, nearby postcodes can be used as placeholders for their locations; we offset travel time by the assumed walking distance from the origin postcode to the nearby interchange point. Admittedly this is not ideal!

    The RailPlanner scraper is very fast: it can find the travel times from a single station to all the other (c. 2,800) stations in Great Britain in two or three minutes on a modest desktop PC. The web scrapers are much slower, partly because they have to call out over the network, partly because the multimodal route planning problem is much harder than for rail alone, and partly because those services are of course heavily used by people for real journey planning rather than experiments. For TransportDirect query times of tens of seconds for individual journeys are common. We limited the rate at which we sent queries to ensure that there was no adverse effect on the services for other users.

    Most journeys don’t start and finish at railway stations or bus stops, so we need to be able to calculate journey times between arbitrary points; these are used to estimate the time taken to get from an origin to join a public transport service, and from its destination to the final destination point.

    In the case of the railway travel-times, we did this by assuming that users would continue from the destination station to their final destination by taxi, taking ten minutes to change mode. Taxi journey times were assumed to be a simple function of the distance travelled—we ignore the effects of the road network, and of traffic. To form an estimate of this model we simulated a large number of car journeys using off-the-shelf route-planning software, and then fit a simple function to the journey time. For long distances we find that the cross-country speed is about 66km/h; while that seems slow, bear in mind that the distance in question is the as-the-crow-flies distance. We assume that people will tolerate a taxi journey of up to one hour, though obviously this is an arbitrary choice.

    In the multimodal case, TransportDirect and the TfL journey planners will actually compute travel-times for journeys starting and ending at arbitrary postcodes. However, it’s much more efficient to restrict our search to journeys starting at bus stops, tube stations etc., and then to compute travel times from arbitrary locations to the appropriate bus stop. In this case we assume that the user will begin their journey on foot, travelling at 1m/s cross-country; this matches the assumption made by the journey planner for the time to (e.g.) walk between nearby bus stops. We let the journey planner site determine the time taken for the final component of the journey (typically, from a nearby bus stop to the fixed final destination), since there is no disadvantage to doing so. We assume that people will tolerate a walk of up to 15 minutes at the start of their journey.

    Therefore, in each case, we compute the maps as follows:

    • Fix an origin and start time (in the case of the rail maps) or a destination and arrival deadline (in the case of the multimodal maps); and choose a region of interest; in the case of the rail maps, this was the whole of Great Britain; in the case of the multimodal maps, a square of side 40km centered on the destination. This latter is an arbitrary choice; we could pick a larger area (slower to cover), or an area which doesn’t contain the destination, for instance to ask from what parts of London it is possible to commute to somewhere outside London.
    • Iterate over all railway stations (rail maps) or over all transport interchanges (multimodal) in the region of interest, and compute the earliest arrival for a departure after the start time (rail) or the latest departure for an arrival before the deadline (multimodal) and record it.
    • Now we have enough information to draw the map. Do this by iterating over a grid of points in the region of interest (choosing the spacing by the resolution of the map to be drawn); at each point we search for transport interchanges within an hour’s taxi journey (rail) or 15 minutes’ walking distance (multimodal) of that point, and choose the one which gives the shortest overall journey time, if any. Record this value.

    This generates a grid of points at which we know the journey time, or know that no journey is possible. From this it is trivial to draw a map where each point is coloured according to journey time, or uncoloured if no journey is possible. We choose the colours according to a standard scale, but adjust the colours using histogram equalisation so that each colour covers approximately the same area of map.

    Drawing the contours, which are essential to making the map comprehensible, is slightly more subtle, because the function to contour (the travel-time) is not actually defined everywhere in the region of interest. We fix this up by extrapolating the values of the travel time outside the domain of the function, contouring the extrapolated function, and then clipping the contours against the domain of the function. Our extrapolation is a solution to Laplace’s equation, fixing its value to the value of the travel-time on the boundary of its domain, and fixing the normal derivative at zero on the boundary of the region of interest. Though there is no real justification for this approach it produces acceptable results.

    For the national rail travel maps, the coloured fields and contours were generated using the University of Hawaii’s Generic Mapping Tools, which generate PostScript output; this was then manually composited with raster base-map data in an image-processing program. Unfortunately it is hard to produce satisfactory results by this means, so for the other maps a custom tool was developed to plot and contour maps into raster graphics files which were therefore correctly aligned with the base map data. The overlays are rendered with alpha of around 50% (adjusted by eye for contrast with the different base maps).

    Software used

    custom software in C, mingw and msys, Windows 2000, VMWare, RailPlanner
    For computing rail travel-times.
    custom software in perl, WWW::Mechanize
    For computing multimodal travel-times.
    GMT, custom software written in C, GIMP
    For producing maps.

    If you’d like a copy of the custom software we wrote, or if you have any other questions or comments, please email hello@mysociety.org. Our software is available under the terms of the GNU Affero GPL.

    Summary of data used

    Excludes timetable data supplied through RailPlanner and the journey planning websites.

    NaPTAN (National Public Transport Access Node database)
    For locations of railway stations, bus stops etc.
    CodePoint (Ordnance Survey database of postcode centroid locations)
    Postcodes were used to describe origin and destination points as input to the two web scrapers, as described above.
    1:25,000 Scale Colour Raster Maps (Ordnance Survey)
    For use as large-scale base mapping.
    1:250,000 Scale Colour Raster Maps (Ordnance Survey)
    For use as small-scale base mapping.

    These data were kindly supplied by agreement with the
    Department for Transport.