Extracting town road networks from OpenStreetMap

A while ago I worked on  a project that analysed the road networks in a number of towns and cities in England. Initially, we used the Ordnance Survey’s Integrated Transport Network (ITN). The process to extract an ITN network for a specific town was as follows:

  1. Using Digimap, extract the ITN network for a bounding box around the specific town.
  2. Extract the boundary polygon for the town and then trim the network to that polygon
  3. Tidy the road network – removing nodes (junctions) without edges (links), edges without a node at either end and disconnected islands. Fortunately, these tasks can be carried out within QGIS.

As you can imagine, this process is time-consuming and it limited the number of towns that we could analyse. Continue reading “Extracting town road networks from OpenStreetMap”

Danny Dorling and the GeoPandas

Churchyard, Cornwall

I recently picked up a copy of Danny Dorling’s So You Think You Know About Britain (Dorling, 2011) from a second-hand bookshop and it inspired me to explore some demographic data using Python and, in particular, GeoPandas.

The book discusses topics such as life expectancy, gender imbalances in the population, the concept of “optimum population”, migration, an aging population and aims to dispel the many myths that surround these matters. Continue reading “Danny Dorling and the GeoPandas”

Python, matrices, arrays, and the National Trip End Model

Travel demand in a matrix

Travel demand can be expressed using origin-destination (OD) matrices. In this example we have 4 zones:

1 2 3 4
1  10 2 9 18
2  3 2 2 1
3  2 1 15 17
4  1 3 1 4

The origins are in rows and the destinations are in columns, so number of trips from zone 1 to zone 2 is 2 and the number of trips from zone 3 to 4 is 17. Let’s say that this data is for weekday commuting trips by rail. To determine the total number of trips from zone 1 we simply sum across row 1 – 10+2+9+18=39. To determine the number of trips to zone 1 we sum down the column 10+3+2+1=16. Since the number of trips originating in zone 1 is higher than that arriving at zone 1, we can assume that zone 1 is mostly residential. Whereas we can say that zone 4 is mostly offices or factories. Continue reading “Python, matrices, arrays, and the National Trip End Model”

The Macclesfield Canal

To Marple by train for the start/end of the Macclesfield canal.

The canal is notable for its lack of locks. Apart from a cluster of twelve between Congleton and Macclesfield, there is a single lock on the canal (lock 13); a stop lock at the junction between the Macclesfield canal and what was then the Hall Green Branch of the Trent and Mersey. The canal was built relatively late (1830) and by then the practice was to cluster locks, which was thought more efficient for travel than having to navigate isolated locks. Continue reading “The Macclesfield Canal”

Mapping data drawn from a mySQL database

Previous examples of web maps generated using Leaflet have relied on GeoJSON files for their overlay data. Here data is extracted from a mySQL database containing some UK crime data. The data was downloaded from the Police website as a CSV file and then imported into mySQL using the Table Data Import Wizard in the mySQL Workbench. I would have preferred to use PostgreSQL, it’s more familiar, but my hosted web space only offers mySQL. Continue reading “Mapping data drawn from a mySQL database”

Metrolink for Oxford Road?

The “Wilmslow Road corridor” in Manchester is reputedly the busiest bus route in Europe, carrying thousands of students from the south of the city into the city centre and the two universities. A section of the route, from Rusholme to the city centre, is currently being transformed into a bus priority route with extensive “Dutch-style” segregated cycle lanes. The current works have exposed some of the history of the city’s earlier transport network. These images taken near the John Dalton Building, MMU show the exposed cobblestones and old tram tracks. Continue reading “Metrolink for Oxford Road?”

Holiday in Berlin

Berlin tourist map
Berlin tourist map

When in Dresden a few years ago I bought an old map of Berlin in a flea market.  Dated 1966, it was produced by Landkartenverlag Berlin, in the former DDR, who specialised in producing tourist maps.  It has a partial view of the city. Partial in both senses, since it omits any detail of West Berlin or “Territories  under US, British and French Occupation“.  The only features mapped in the West are S-Bahn stations (labelled) and major roads (unlabelled). Continue reading “Holiday in Berlin”

Debugging JavaScript with the Atom editor

JavaScript is not easy to debug. This is particularly the case when we try to “hack” some existing code for our own purposes rather than write the code from scratch, carefully checking each bit of code as we add it. We cut and paste and chop and change without fully understanding the intricacies of the code – no shame in that, of course, this technique has fuelled 20+ years of web development. Continue reading “Debugging JavaScript with the Atom editor”

Network checking with QGIS

I’ve recently been doing some work with town and city road networks in the UK using the Ordnance Survey ITN network dataset. For each town I have been using its boundary, as defined in the UK Census, as a “cookie cutter” for the network. Unfortunately this can lead to an untidy network:

  • nodes without links (A below)
  • links without end nodes (B below)
  • disconnected “islands” (C below)

Continue reading “Network checking with QGIS”