Emissions and the School Commute

This week I have been busy running around organising GISRUK 2013 – however, in between this, I talked about some research I have been completing to develop a national individual level model of CO2 emissions that are linked to the school commute. For anyone who missed the talk, this was recorded by Robin Lovelace from the University of Sheffield (thanks!) and put on YouTube.

2011 Census Open Atlas Project

CensusAtlasThis month has seen the release of the 2011  census data for England and Wales at Output Area Level.

This offers the possibility to map various attributes about people and places for very small geographic areas. Output Areas represent the most detailed geography for which Census data are released and are the building blocks for many popular products such as geodemographic classifications.

Because the data and boundaries are available under an open government licence, and that these data have been usefully placed online as direct downloads (data, boundaries), it makes it  possible to create maps for England and Wales in a highly automated way.

As such, since launch of the Output Area level data I have been busy writing (and then running – around 4 days!) a set of R code that would map every Key Statistics variable for all local authority districts. The code for doing this is fully reproducible, and I have dropped this on my Rpubs blog.

I have generated a PDF atlas for each local authority district, for example:

IF YOU THINK ANY OF THE INFORMATION I HAVE CREATED IS USEFUL, INTERESTING OR OF VALUE, THEN PLEASE  READ THIS BLOG POST AND HELP PROTECT THE NEXT CENSUS!

Why have I created these atlases?

  1. To demonstrate the value of the 2011 census
  2. Provide a free 2011 static Census atlas to anyone who wants one
  3. Because I do not believe web maps should necessarily be the default way of distributing geographic data
  4. To illustrate how open data and software can be used in creative ways to generate insight
  5. An attempt to save local authorities money who might be thinking of doing these type of analyses themselves
  6. To provide reproducible code that enable others to generate similar maps at Output Area level
  7. For fun!
  8. Because R is awesome!
  9. Because R really is awesome!

What is in each atlas?

Each atlas contains a series of vector PDF maps for each Key Statistics variable. The following is a map from the Liverpool Atlas and shows the percentage of “White: English/Welsh/Scottish/Northern Irish/British” for each Output Area in Liverpool.

white

About the data and maps

Almost every non count variable (apart from Hectares) was mapped from the  Key Statistics data disseminated by Nomis, and are either percentage scores or some type of ratio / average. Maps were excluded where there were only a few scores within a local authority district – you can see further explanation of this on the Rpubs page accompanying the analysis. A couple of further points…

  • The variables mapped were based on the calculations that were part of the Nomis data.
  • I have always been a fan of blue choropleth maps which was why the particular colour scheme was chosen.
  • The cartography was automated for all the maps – this means it is more successful for some local authority districts than in others. Some issues I have noted;
    • Those local authorities with many wards appear a little busy with labels (e.g. Cornwall)
    • Cardiff  appears to have a rogue polygon which may be issue with the OA to higher geography lookup table. I will investigate this in a future release…. [Power of the crowd reveals that this is in fact Flat Holm island - thanks to @geospacedman]
    • It would be nice to add scale bars and north arrows to the maps, however, this was proving to be problematic when outputting to PDF. Again, I will try and fix this in a future release.
  • The boundaries used are the generalised files to increase mapping speed and reduce file size – these could be supplemented for the full resolution boundaries in the future
  • These maps are without guarantee or warranty / feel free to fix my code!

View the maps

All maps are available after clicking continue reading….

Continue reading

Creating 2011 Census Output Area Change Maps Using R

E08000003The 2001 Census used a different set of Output Areas (OA) than the current 2011 boundaries; reflecting changes in the spatial distribution of the underlying population. For example, if an area has become more heavily populated since 2001, it makes sense that a previous OA might be split into multiple new segments.

The ONS have provided both the Shapefiles and lookup tables for these changes, however, as yet, I haven’t seen any maps of these changes.

I have had a go at creating these in a reproducible way using R – the code with links to all the data (which is public domain) can be found on my Rpubs page. At the base of the Rpubs post are links to downloadable PDF maps of all local authority districts in England and Wales.

A recurring pattern that will become clearer when the high resolution census data become available in 2013, is the splitting of OA in the centre of many large urban areas, typically as a result of increased population density. A couple of direct links to maps are as follows:

For the remaining maps and R code, see the Rpubs page.

Using R with Routino to provide road network paths between random Tweets and an iconic Smiths landmark

A couple of days ago I posted how you can go about installing Routino on OSX; and now I have just finished writing a quick post over on my Rpubs blog about how you go about using it from within R. I also wanted to know a bit more about how R and Twitter play together so this is woven in too. Oh, and I was also listening to the Smiths back catalogue today – thus; you end up with:

Using R with Routino to provide road network paths between random Tweets and an iconic Smiths landmark

For those who don’t know what the connection between the Salford Lads Club and the Smiths is; then have a look at this video:

The geodemographics of access and participation in Geography

Geography is not a compulsory subject of study beyond the age of 14 in English schools and this has had an impact on both absolute and relative participation rates over recent years. Geodemographic analysis reveals that pupils domiciled within more affluent and less ethnically diverse areas record the highest rates of participation and attainment in GCSE Geography, and that the stratified patterns of participation have increased between 2005 and 2009. Within this period, those schools that have stopped supplying successful GCSE Geography entries by 2009 were found to have overall low aggregate attainment and to draw pupils from more deprived areas. The profile of schools visited by the Royal Geographical Society (with the Institute of British Geographers) (RGS-IBG) Ambassador Scheme was also considered to assess the extent that the schools visited are representative of pupils who are most at risk of non-participation.

Singleton, A.D. 2012. “The Geodemographics of Access and Participation in Geography.” The Geographical Journal 178 (3): 216–229. http://dx.doi.org/10.1111/j.1475-4959.2012.00467.x.

A Survey of the use of Geographic Information Systems in English Local Authority Impact Assessments.

Across the public sector, Geographic Information Systems (GIS) and spatial analysis are increasingly ubiquitous when making decisions involving people and places. However, historically GIS has not been prevalently applied to the various types of impact assessment. As such, this paper presents findings from a survey conducted in 2011 of 100 local authorities in England to examine how embedded GIS, spatial analysis and visualisation practices are to the process of conducting impact assessments. The results show that despite obvious advantages of applying GIS in these processes, applications employing basic techniques are at best sporadic, and where advanced methods are implemented, these in almost all instances are conducted by external contractors, thus illustrating a significant GIS under capacity within the sampled local authorities studied.

Riddlesden, D., A.D. Singleton, and T. B. Fischer. 2012. “A Survey of the Use of Geographic Information Systems in English Local Authority Impact Assessments.” Journal of Environmental Assessment Policy and Management 14 (01): 1250006. http://dx.doi.org/10.1142/S1464333212500068.

Researching the Riots

This commentary sets out an agenda for researching the riots that swept through English cities in 2011, and for exploring the broader issues raised by these events. Drawing inspiration from groundbreaking social and cultural geographies of the 1981 riots, and also from mappings and quantitative studies of the more recent disturbances, this paper sets out a framework for researching the riots, and underlines the importance of doing so. It concludes that while riots are traumatic experiences for many, they can also be opportunities, which effective research can help to realise, recasting these events as catalysts for change.

Phillips, Richard, Diane Frost, and A.D. Singleton. 2012. “Researching the Riots.” The Geographical Journal. http://dx.doi.org/10.1111/j.1475-4959.2012.00463.x.

GISRUK 2013 at the University of Liverpool

Something else which has been keeping me busy of late is organising GISRUK 2013 which we are hosting next April at the Univerity of Liverpool.

The deadline is approaching – 15th November; so still time to submit a paper!

About
The 21st GIS Research UK (GISRUK) conference is being hosted by the Department of Geography and Planning in School of Environmental Sciences at the University of Liverpool from Wednesday 3rd through to Friday 5th April. As with previous years, there is a day of workshops on the 2nd April, including the Young Researcher’s Forum. The conference will follow the usual format of plenary sessions from invited keynote speakers, and oral presentation of papers in a series of parallel themed sessions. A full social programme will also feature during the conference.

Lots more information on the GISRUK 2013 website.

Installing Routino under OSX

Routino is a set of libraries that enable road based route calculations to be conducted over OpenStreetMap data. I have been using them extensively over the past six months for a project looking at CO2 emissions and the commute to school.

Although Routino was designed to run under Linux, it can also be compiled and installed under OSX (sorry no windows!).

1. First download and unzip the latest version of Routino from here.
2. Ensure that Xcode and the Xcode command line tools are both installed. On Xcode 4.5 the command line tools can be installed from within Xcode through Xcode >>> Preferences >>> Downloads tab >>> Click “install”.
3. Navigate to the downloaded Routino folder using the terminal and compile the source code using a “make” command. You would need to supplement “alex” in the following commands for you own user account name.

cd /Users/alex/Desktop/routino-2.3.2/
make

The result should be a series of messages printed to the terminal that indicate Routino being compiled correctly.
4. The next stage is to copy the compiled libraries (found in the /web/bin folder into your usr/bin folder which should appear in your system PATH (You can check if this is the case by running echo $PATH from the terminal). The -R and the fact that bin ends with a “/” mean that the contents of the folder are copied rather than the folder itself.

sudo cp -R  /Users/alex/Desktop/routino-2.3.2/web/bin/ /usr/bin/

To check that this has worked, if you enter “planetsplitter” or “router” on the terminal the input parameters of these tools should be printed.

For more information on use of the programme, see the Routino documentation here.

The only issue I have had with Routino is that occasionally I would get implausible and very long routes calculated. It turned out that this was related to an issue in the underlying OSM data where access by foot wasn’t necessarily specified on “trunk” roads. A work around for this was to specify that pedestrians could walk on these routes using the tagging rules in the specification XML files. The results of these changes can be seen in the following map.

How Scenic is the HS2 Route?

It is fairly clear from the duration between this and my last post that various other things have been getting in the way of updates. Anyway, I shall try and post a few updates on news and things I have been working on recently in the coming weeks before getting back to regular posting!

Back in January I had a student working on a dissertation about the High Speed 2 railway. This got me thinking about what sort of data could be used to characterise the route. As it transpired there wasn’t a publicly available Shapefile of the route at the time, however, an ex-colleague (Daryl Lloyd) who by chance now works for the Department for Transport, had almost in unison realised the same thing; and indeed, on the day I had contacted him was negotiating with HS2 Ltd to release the file. This is now available to download from here.

One unusual dataset that I thought would provide interesting context is the My Society project ScenicOrNot. This application enables users to rate the level of “scenic”[ness] of a series of random georeferenced photographs taken from the Geograph project. The raw scores are available to download here. For each picture lat / lon, multiple votes were concatenated in single line. As such, the records were split up, so one each vote appeared as a single line in the exported CSV. This was done using the following R code.

#Read in Scenic Data from http://scenic.mysociety.org/
Scenic <- read.delim2("http://scenic.mysociety.org/votes.tsv", header = TRUE, sep = "\t", quote="\"")
AllVotes <- NULL
list <- for(x in 1:nrow(Scenic)) {
row <- Scenic[x,]
Lat <- row$Lat
Lon <- row$Lon
ID <- row$ID
Votes <- as.data.frame(strsplit(as.character(row$Votes),",")) # Gets the votes as a dataframe list
Votes$Lat <- Lat #Add Lat
Votes$Lon <- Lon #Add Lon
Votes$ID <- ID # Add ID
names(Votes)[1] <- "Votes" #Rename Votes list
AllVotes <- rbind(AllVotes,Votes)
rm(Votes,ID,Lat,Lon,row)
print(x)
}
AllVotes_test <- AllVotes
AllVotes_test$Lat <- as.numeric(AllVotes_test$Lat)
AllVotes_test$Lon <- as.numeric(AllVotes_test$Lon)
write.csv(AllVotes_test, file = "scenic_final_out.csv", row.names = FALSE)

The resulting CSV can be downloaded here. This relates to an extract from January 22nd 2012.

These data were then converted into OSGB and imported into a PostGIS database. A point in polygon operation was used to create average scores for a 5km grid over England. The shapefile with average votes can be downloaded here.

Created using QGIS, the following maps show the output of these analyses…




When we overlay the HS2 route onto these data we can see that this passes through areas with varying degrees of “scenic”ness.




Although these data are interesting in themselves, there is obvious utility if this sort of information was combined with other indicators such as population density and characteristics. The assumption being that all other things being equal, then people may object to disruption in those areas which they consider more “scenic”… perhaps something for further work!