Tube Line Closure Map

anim

The Tube Line Closure Map accesses Transport for London’s REST API for line disruption information (both live and planned) and uses the information there to animate a geographical vector map of the network, showing closed sections as lines flashing dots, with solid lines for unaffected parts. The idea is similar to TfL’s official disruption map, however the official one just colours in the disrupted links while greying out the working lines (or vice versa) which I think is less intuitive. My solution preserves the familiar line colours for both working and closed sections.

My inspiration was the New York City MTA’s Weekender disruptions map, because this also blinks things to alert the viewer to problems – in this case it blinks stations which are specially closed. Conversely the MTA’s Weekender maps is actually a Beck-style (or actually Vignelli) schematic whereas the regular MTA map is pseudo-geographical. I’ve gone the other way, my idea being that using a geographical map rather than an abstract schematic allows people to see walking routes and other alternatives, if their regular line is closed.

Technical details: I extended my OpenStreetMap-based network map, breaking it up so that every link between stations is treated separately, this allows the links to be referenced using the official station codes. Sequences of codes are supplied by the TfL API to indicate closed sections, and by comparing these sequences with the link codes, I can create a map that dynamically changes its look with the supplied data. The distruption data is pulled in via JQuery AJAX, and OpenLayers 3 is used to restyle the lines appropriately.

Unfortunately TfL’s feed doesn’t include station closure information – or rather, it does, but is not granular enough (i.e. it’s not on a line-by-line basis) or incorrect (Tufnell Park is shown only as “Part Closed” in the API, whereas it is properly closed for the next few months) – so I’m only showing line closures, not station closures. One other interesting benefit of the map is it allows me to see that there are quite a lot of mistakes in TfL’s own feed – generally the map shows sections open that they are reporting as closed. There’s also a few quirks, e.g. the Waterloo & City Line is always shown as disrupted on Sundays (it has no Sunday service anyway) whereas the Rominster Line in the far eastern part of the network, which also has no Sunday service, is always shown as available.

Try it out

Visit the new oobrien.com Shop
High quality lithographic prints of London data, designed by Oliver O'Brien

General Election Maps for 2015

ge_swingmap

When I first moved to UCL CASA back in 2010, the first online map I created from scratch was one showing swings in the general election that year. So it seemed fitting to update the old code with the data from the 2015 general election, which took place last week. You can see the resulting maps here – use the dropdowns to switch between headline swing, winner, second places, turnout % variations, majorities, political colour and individual party votes and X-to-Y swings.

Screen Shot 2015-05-11 at 15.09.08

My style of Javascript coding back in 2010 was – not great. I didn’t use JQuery or event AJAX, choosing instead to dump the results of the database query straight into the Javascript as the page was loaded in, using PHP. I was also using OpenLayers 2, which required some rather elaborate and unintuitive coding to get the colours/shapes working. My custom background map was also rather ugly looking. You can see what the map looked like in this old blog post. I did a partial tidyup in 2013 (rounded corners, yay!) but kept the grey background and slightly overbearing UI.

Now, in 2015, I’ve taken the chance to use the attractive HERE Maps background map, with some opacity and tinting, and tidied up the UI so it takes up much less of the screen. However, I decided to leave the code as OpenLayers 2 and not AJAX-ify the data load, as it does work pretty well “as is”. The constituency boundaries are now overlaid as a simplified GeoJSON (OL 2 doesn’t handle TopoJSON). For my time map, I was using OL 3 and TopoJSON. Ideally I would combine the two…

Link to the interactive maps.

ge_colourmap

Visit the new oobrien.com Shop
High quality lithographic prints of London data, designed by Oliver O'Brien

Street Trees of Southwark

southwarktrees_rotherhithe
Above is an excerpt of a large, coloured-dot based graphic showing the locations of street trees in Rotherhithe, part of the London Borough of Southwark in London, as released by them to the OpenStreetMap database back in 2010. You can download the full version (12MB PDF). Street trees are trees on public land managed by LB Southwark, and generally include lines of trees on the pavements of residential streets, as well as in council housing estates and public parks. By mapping just the trees, the street network and park locations are revealed, due to their linear pattern or clumping of many types of trees in a small area, respectively. Trees of the same genus have the same colour, on this graphic.

southwarktrees_thinWhy did I choose Southwark for this graphic? Well, it was at the time (and still is) the only London borough that had donated its street tree data in this way. It is also quite a green borough, with a high density of street trees, second only to Islington (which ironically has the smallest proportion of green space of any London borough). There are street tree databases for all the boroughs, but the data generally has some commercial value, and can also be quite sensitive (tree location data can useful for building planning and design, and the exact locations of trees can also be important for neighbourly disputes and other damage claims. It would of course be lovely to have a map of the whole of London – one exists, although it is not freely available. There are street tree maps of other cities, including this very pretty one of New York City by Jill Hubley. There’s also a not-so-nice but still worthy one for Washington DC.

Also well as a PDF version, you can download a zip-file containing a three files: a GeoJSON-format file of the 56000-odd street trees with their species and some other metadata, a QGIS style file for linking the species to the colours, and a QGIS project file if you just want to load it up straight away. You may alternatively prefer to get the data directly from OpenStreetMap itself, using a mechanism like Overpass Turbo.

A version of this map appears in London: The Information Capital, by James Cheshire and Oliver Urberti (who added an attractive colour key using the leaf shapes of each tree genus). You can see most of it below. I previously talked about another contribution I made to the same book, OpenStreetMappers of London, where I also detailed the process and released the data, so think of this post as a continuation of a very small series where I make available the data from my contributions to the book.

The data is Copyright OpenStreetMap contributors, 2015, under the Open Database Licence, and the origin of most of the data is a bulk-import supplied by Southwark Council. This data is dated from 2010. There are also some trees that were added manually before, and have been added manually since, by other OpenStreetMap contributors. These likely include some private trees (i.e. ones which are not “street” trees or otherwise appear on private land.) Many of these, and some of the council-data trees, don’t have information their genus/species, so appear as “Other” on the map – orange in the above extract.

southwarktrees_book

GISRUK 2015

The week before last I was at GISRUK, the long-running annual academic conference for early (and not-so-early) career researchers in GI Science in the UK, Ireland and further afield. This year’s conference was in Leeds and attracted a record number of 250+ participants. I presented a poster at a meeting the day before the main conference, but otherwise had no talk to give at Leeds, which means I was able to relax and focus on seeing the most interesting sessions. This year we had some great keynotes, including two visually impressive talks from Google’s Ed Parsons and MIT’s Sarah Williams, opening and closing the conference respectively. Outside of the keynotes, there were three main streams running simultaneously, but with the theme regularly changing after each group of talks, which meant for plenty of room swapping.

Some of my favourite talks:

  • With a large UCL attendance, there were plenty of talks on geodemographics and socioeconomic mapping. One of my favourites was from Monsuru Adepeju of the UCL Crime, Policing and Citizenship project, the talk looked at a new way of detecting crime hotspots. The presentation included the below map showing a crime-weighted geodemographic map of London.gisruk1
  • Staying with UCL and geodemographics, but going from crime to food, this classification, developed alongside a major food retailer in the UK, was presented by UCL’s Guy Lansley of the Consumer Data Research Centre, the work linked ethnic-weighted classifications with the popularity of certain food types, to simplify the task of providing particular food-types popular with one or more major ethnic groups in the UK, as the country’s population demographic continues to change and move.gisruk2
  • Staying with the geodemographic theme, Mark Birkin of Leeds gave an overview of geodemographics research in the era of big data, where ever increasing amounts of data allow ever more sophisticated analysis to be performed. The below image shows a slide from a presentation presenting a very detailed geodemographic map – right down to postcode (typically 50 homes) level.gisruk3
  • Away from geodemographics and to cartography: Jonny Huck of Lancaster presented the results of a study into creating a number of map types that encouraged good interaction with the map itself – the aim making maps for mobile devices that were engaging and encouraged people to look at the screen frequently when navigating – but not being so difficult to interpret that they were frustrating. Four styles of map, of the Lancaster University campus, were created from a Google Maps base, and participants were asked to navigate around the campus. The style that proved to be most effective in terms of engagement, while being fun to use, was the “PacMap”, a screenshot of which is shown below. Ironically Google released an unrelated PacMap for the whole world, as part of this year’s “April Fool” Google Maps hack.gisruk4
  • Ed Manley of UCL showed some results of using mobile phone data to derive patterns of mobility through certain parts of an urban area, showing that different communities experience their cities in different ways and to different extents.gisruk5
  • I didn’t see the presentation by Robin Lovelace (Leeds) on his work-in-progress on creating an R/Shiny-based tool for visualising current inter-neighbourhood cycling flows, and predicting future flows based on several scenarios, but I did get a demo of the tool, which is looking impressive, and will be a powerful way to communicate and interrogate a complex dataset.
  • Some other highlights included TransportOAC (Nick Bearman, Liverpool) which is a geodemographic map focused on who people move around the UK. The classification is relatively “noisy” spatially, and London’s unique transport system (compared with the rest of the UK) means it gets a number of classification groups to itself. I also enjoyed Nilufer Aslam’s talk about linking metro smartcard data (from TfL’s Oyster Card) with journey and usage information of bikeshare systems, to see whether they indeed formed a “last mile” option for commuters, and how availability patterns affected this.
  • I presented a poster, below, on DataShine, at the poster session for a meeting immediately prior to GISRUK. The poster summarises the three websites that are my principal output thus far, from the BODMAS project.gisruk6

So, an excellent conference, full of interesting talks on geodemographics and various other GIS-related research. Thanks to the organisers for their hard work in staging a smoothly-run and successful three days.

Book Review: GIS Cartography (2nd Ed)

GIS software is used by many professionals to process spatial information, but the results are often poorly presented and the resulting map can be unattractive. GIS packages, such as QGIS, are increasingly including a broad range of cartographic styling and map design options, to present synthesised spatial data attractively, but it remains all too easy to produce a map without due consideration for its presentation. The old, non-geospatial approach produces beautiful maps in regular graphic applications, e.g. Illustrator, but these lose the data linkages and spatial analysis capabilities of GIS that produce the data to be mapped in the first place. Then there’s the new “slippy map” online map websites that provide a whole new set of tools to allow anyone – be they a geospatial professional or not – to create maps. It can however be all to easy to produce maps with these tools that are unhelpful, look ugly, are difficult to interpret or worst of all are downright misleading.

GIS Cartography, by Gretchen Peterson, is a book that seeks to address these problems, seeking to guide GIS software users and web designers alike to produce maps that contain good cartographic design, harking back to when maps were produced by a dedicated “offline” cartographer. The book does this by taking a structured approach to the elements of data-driven maps, and examining and commenting on each of these in detail.

The book is largely technology-agnostic, not detailing operations for specific GIS software or online mapping APIs but instead outlining the basic concepts of good digital maps that users of such software should normally be able to implement. Peterson is not afraid to espouse her opinion – her experience in the field means that her view is a salient and sensible one. For example, the author has a distinct dislike for the use of logos on maps – arguing for them to be minimised – or ideally dropped altogether, while making the creator’s name more prominent than is often the case. I particularly liked the discussion on fonts and the display of text – perhaps not an area traditionally dwelled on by GIS-focused map makers. For example, different kinds of text halo application are demonstrated well, with a set of excellent graphics. One section of the book that I felt was overlong however was the section on the colour palettes for feature types. Gretchen is attempting to cover all common types of GIS maps (from political to soil) but the detail is overwhelming. By contrast, the section detailing colour blindness issues with maps (which I frequently get caught out with) was succinct.

Online cartography is dealt with in the last chapter “Zoom-Level Design”. This section reflects the recent rise of online mapping software (Google Maps, OpenLayers, Leaflet, etc) used by non-professionals, with the core part of the book solidly focused on the regular desktop GIS (ArcGIS, QGIS, MapInfo, etc). The section focuses on the issues of scale and generalisation for maps designed to be viewed rapidly at multiple zoom levels. Ideally the book would integrate the online and offline (or “slippy map” and “GIS window”) worlds throughout its length rather than addressing online mapping in a single chapter. Of course, many of the aspects presented in the main part of the book – particularly relating to colour and adornments – are also applicable to this kind of mapping.

One slight irony is the variable quality in the design and reproduction of the illustrations in the book itself. Many of them are rather traditional looking, and some are quite pixellated. The generic look is likely because of the desire of the author to keep the book as neutral and platform-independent as possible.

Overall this is an excellent and comprehensive guide to ensuring high quality cartographic output from GIS users and slippy map creators. If you read it from cover you’ll build up an excellent set of guidelines for maps with a rigorous high quality. Alternatively you can dip in to it from time to time when you need advice on specific aspects of your mapmaking, such as tips on how to do scale bars or inset maps well. Even if you are already experienced with mapmaking from GIS software, you’ll quite become aware of design aspects you hadn’t previously considered. If you regularly create online maps, or find yourself increasingly using a GIS to create and output maps straight for presentation, this is an essential book in your professional collection.

GIS Cartography: A Guide to Effective Map Design (Second Edition)
Author: Gretchen Peterson, Publisher: CRC Press. 299 pages. Out now.

Further information on Amazon.

Thanks to the Society of Cartographers for arranging a review copy. This review may appear in the society’s Bulletin in due course. I am happy to accept copies for review of other books in this and related fields – send to Oliver O’Brien, Dept of Geography, UCL, Gower Street, London WC1E 6BT. Review copies can be returned on request, if an SAE is included.

Election Time!

electiontime

I’ve created an Election 2015 Time Map which maps the estimated declaration times that the Press Association have published. It follows on from a similar map of the Scottish independence referendum.

Each constituency is represented by a circle which is roughly in its centre (using a longest-interior-vertex centroid determined in QGIS). The area of the circle represents the size of the electorate, with the Isle of Wight being noticeably larger, and the Western Isles and Orkney/Shetland constituencies smaller, than average. The main colours show the expected time (red = around midnight, falling to green for the slow-to-declare constituencies late in the morning) while the edge colour shows the 2010 winning party. Mouseover a constituency circle for more data. Grey lines shows the constituency boundaries, created from ONS data (for Great Britain) and aggregating NISRA small area and lookup data (for Northern Ireland). You can download the resulting TopoJSON file, which is simplified using MapShaper. The data is Crown Copyright ONS/NISRA.

As the election approaches, and after the results come in, I hope to modify and update the map with other constituency-level data, such as the result itself.

Out of Station Interchanges (OSIs)

osi_nlondon
Stations on the tube map with multiple lines are normally shown with a white circle (except where obscured by a disabled access blob) indicating connections where you can change lines there, while continuing on a single journey (and so not have to pay for two). However, there are a number of connections not shown on the map. These are Out of Station Interchanges (OSIs) and generally involve a walk out through ticket barriers, along a road or two, and back through more barriers. However, TfL will do the maths to ensure that you still only get charged for a single journey altogether – so long as you don’t spend too long a time between the two sets of barriers. TfL is quite secretive about these “hidden” free interchanges, likely because marking/highlighting the links and limit times would be tedious* so the current list is maintained by frequent Freedom of Information Requests. I’ve taken the current list, excluded interchanges with National Rail, and added the remaining (TfL to TfL) OSIs to my Tube Data Map. The OSIs are shown by white circles, connected together with white lines and black borders. There are a few more, where I’ve already joined OSI-linked stations as being actually in the same place. Sometimes you can leave and then reenter barriers within a single barriered area – for instance, you can leave the barriers at Bank and go back in them at Monument, without paying for two journeys (so long as you take less than 15 minutes to do so). However you can also get between the two stations while staying behind the barriers. N.B. If you change the date to 2019 then it shows the OSIs that will likely be added for Crossrail, when the central section starts running then.

Many of the OSIs are for links between the Underground and Overground, as the latter network is not otherwise particularly well connected. The longest Tfl-TfL OSI is from West Ruislip to Ickenham, in outer west London – it’s over a kilometre to walk between the two, but the link helps Central Line uses get easily to and from the transport hub at Uxbridge.

* They do however highlight a few at stations, e.g. Clapham High-Street to Clapham north. Some others have some street-signs pointing the way, e.g. Seven Sisters to South Tottenham.

Map background from HERE maps.

OS Open

Ordnance Survey have this week released four new additions to their Open Data product suite. The four, which were announced earlier this month, are collectively branded as OS Open and include OS Open Map Local, which, like Vector Map District (VMD), is a vector dataset containing files for various feature types, such as building polygons and railway stations. The resolution of the buildings in particular is much greater than VMD – surprisingly good, in fact. I had expected the data to be similar in resolution to the (rasterised) OS StreetView but it turns out it’s even more detailed than that. The specimen resolution for OS Open Map Local is 1:10000, with suggested uses down to a scale of 1:3000, which is really quite zoomed in. Two new files in OS Open Map Local are “Important Buildings” (universities, hospitals etc) and “Functional Areas” which outline the land containing such important buildings.

osopendata_oldnew
osvmd_osm

Above: Comparing the building polygon detail in the older Vector Map District (top left), previously the largest scale vector building open data from Ordnance Survey, and the brand new OS Open Map Local (top right). The new data is clearly much higher resolution, however one anomaly is that roads going under buildings no longer break the buildings – note the wiggly road in the centre of the top left sample, Malet Place, which runs through the university and under a building, doesn’t appear in full on the right. Two other sources of large-scale building polygons are OS StreetView (bottom left), which is only available as a raster, and OpenStreetMap (bottom right). The OS data is Crown Copyright and Database right OS, 2015. The OSM data is Copyright OSM contributors, 2015.

The other three new products, under the OS Open banner, are OS Open Names, OS Open Rivers and OS Open Roads. The latter two are topological datasets – that is, they are connected node networks, which allow routing to be calculated. OS Open Names is a detailed gazetteer. These latter three products are great as an “official”, “complete” specialised dataset, but they have good equivalents on the OpenStreetMap project. OS Open Map Local is different – it offers spatial data that is generally much higher in accuracy than most building shapes already on OpenStreetMap, including inward facing walls of buildings which are not visible from the street – and so difficult for the amateur mapper to spot. As such, it is a compelling addition to the open data landscape of Great Britain.

The OS also confirmed last week the location for its new Innovation Hub. It is indeed a mile from King’s Cross – specifically, it’s in Clerkenwell, and the hub will be sharing space with the Future Cities Catapult. Conveniently the new space has a presentation space and the May Geomob will be taking place there.

Taking the Scenic Route – Quantitatively?

A friend forwarded me this article which discusses this paper by researchers at the Yahoo Labs offices in Barcelona and the University of Turin. The basic idea is that they crowdsourced prettiness of places in central London, via either/or pairs photographs, to build up a field of attractiveness, then adjusted a router based on this map, to divert people along prettier, happier or quieter routes from A to B, comparing them with the shortest pedestrian routes. The data was augmented with Flickr photographs with associated locations and appropriate locations. and The article that featured this paper walked the routes and gives some commentary on the success.

Quantitatively building attractive routes is a great idea and one which is only possible with large amounts of user-submitted data – hence the photos. It reminds me of CycleStreets, whose journey planner, for cyclists, not only picks the quickest route, but adds in a quieter (and “best of both worlds”) alternative. Judging locations by their attractiveness also made me think of the (soon to be retired) ScenicOrNot project from MySociety which covered the whole of the UK, but at a much less fine-grained scale – and without the either/or normalisation.

In the particular example that the paper uses, the routes are calculated from Euston Square Station, which happens to be just around the corner from work here, to the Tate Modern gallery. It’s a little over 2 miles by the fastest route, and the alternatives calculated are only a little longer:
quercia_beauty
Above: Figure from http://dx.doi.org/10.1145/2631775.2631799

I really like the concept and hope it gets taken further – for more places and more cities. However, I would contend that local knowledge, for now, still wins the day. The scenic route misses out the Millennium Bridge which is surely one of the most scenic spots in all of London with its framed views to St Paul’s Cathedral and the Tate Modern itself. The quiet route does go this way, but the route is far from quiet when you consider the hordes of tourists normally near the cathedral and on the bridge. The pretty route goes down Kingsway which is a pretty ugly, heavily trafficked route, ignoring the nearby Lincoln Inns Fields, which is lovely. I think that the following, manually curated 3.0 mile route wins out as a much more beautiful route than the algorithmically calculated one:

beauty

Highlights include:

  • Walking through UCL’s Front Quad, through the university campus
  • Down Malet Street, past the imposing Senate House
  • Walking through the Great Hall of the British Museum
  • Bloomsbury Square garden and Lincoln’s Inn Fields
  • Chancery Lane
  • New Street Square (modern but attractive)
  • The statue of Hodge, Dr Johnson’s Cat
  • Wine Office Court, with the Ye Olde Cheshire Cheese Pub
  • Fleet Street and Ludgate Hill, with the famous view to St Pauls
  • The vista from St Paul’s Cathedral, across the Millennium Bridge to the Tate Modern.

Maps in this article are © Google Maps.

Ordnance Survey Open Data – The Next Level of Detail

An encouraging announcement from BIS (the Department for Business, Innovation and Skills) a few days ago regarding future Open Data products from the Ordnance Survey (press release here) – two pieces of good news:

  • The OS will be launching a new, detailed set of vector data as Open Data at the end of this month. They are branding it as OS OpenMap, but it looks a lot like a vector version of OS StreetView, which is already available as a raster. The key additions will be “functional polygons” which show the boundaries of school and hospital sites, and more detailed building outlines. OS Vector Map District, which is part of the existing Open Data release, is already pretty good for building outlines – it forms the core part of DataShine and this print, to name just two pieces of my work that have used the footprints extensively. With OpenMap, potentially both of these could benefit, and we might even get attribute information about building types, which means I could filter out non-residential buildings in DataShine. What we do definitely get is the inclusion of unique building identifiers – potentially this could allow an crowd-sourced building classification exercise if the attribution information isn’t there. OpenMap also includes a detailed and topological (i.e. joined up under the bridges) water network, and an enhanced gazetteer, i.e. placename database.
  • The other announcement relates to the establishment of an innovation hub in London – an incubator for geo-related startups. The OS are being cagey about exactly where it will be, saying just that it will be on the outskirts of the Knowledge Quarter, which is defined as being within a mile of King’s Cross. UCL’s about a mile away. So maybe it will be very close to here? In any case, it will be somewhere near the edge of the green circle on the (Google) map below…

p.s. The Ordnance Survey have also recently rebranded themselves as just “OS”. Like University College London rebranding itself as “UCL” a few years ago, and ESRI calling itself Esri (and pronouncing it like a word), it will be interesting to see if it sticks. OS for me stands for “open source” and is also very close to OSM (OpenStreetMap), so possible confusion may follow. It does however mean a shorter attribution line for when I use OS data in my web maps.

Screen Shot 2015-03-04 at 17.47.52

London’s Knowledge Quarter