Consumer Data Research and Census Enumeration
Talk at ONS, Tichfield 25/2/16
Continue reading »The latest outputs from researchers, alumni and friends at the UCL Centre for Advanced Spatial Analysis (CASA).
Talk at ONS, Tichfield 25/2/16
Continue reading »Keynote given at Regional Studies Early Career Conference, Sheffield 29/10/15
Continue reading »Keynote given at ESRI European Education Conference, 13/10/15; Saltzburg, Austria
The above talk has no sound; vimeo rather than speakdeck was used as there are a few embedded videos.
Continue reading »I committed to testing this a long time ago, however, a number of other projects intervened, so I have only just got around to writing up this short tutorial. One of the exciting things from the ESRI Developers Conference this year was the launch of the R-ArcGIS bridge. In simple terms, this enables you to run R scripts from within ArcGIS and share data between the software. In fact, this is all explained in a nice interview here.
I won’t go into detail about the R script itself, and the code can be found on github. If I am honest, this is pretty rough, and was written to demonstrate what could be done – that said, it should be usable (I hope… but don’t complain if it isn’t!). ESRI have also provided a nice example which can be found here, and was the basis of my code.
Before you can link ArcGIS Pro to R, you need to install and load the ‘arcgisbinding’ package, which is unfortunately not on CRAN. There are instructions about how to do this here using a Python toolbox; however, I preferred a more manual approach.
Open up R and run the following commands which installs the various packages used by the toolbox. You might also need to install the Rtools utilities as you will be compiling on Windows (available here). Although the TwitteR and httr packages are available on CRAN, for some reason I have been having issues with the latest versions failing to authenticate with Twitter; as such, links to some older versions are provided.
#Install the arcgisbinding package
install.packages("https://4326.us/R/bin/windows/contrib/3.2/arcgisbinding_1.0.0.111.zip", repos=NULL, method="libcurl")
#Install older versions of the TwitteR and httr packages
install.packages("https://cran.r-project.org/src/contrib/Archive/twitteR/twitteR_1.1.8.tar.gz", repos=NULL, method="libcurl")
install.packages("https://cran.r-project.org/src/contrib/Archive/httr/httr_0.6.0.tar.gz", repos=NULL, method="libcurl")
#Load the arcgisbinding package and check license
library(arcgisbinding)
arc.check_product()
Before you can use the Twitter Search Tool in ArcGIS Pro, you first need to register an app with Twitter, which gives you a series of codes that are required to access their API.
I created an R script that:
1. Authenticates a session with Twitter
2. Performs a search query for a user specified term within a proximity (10 miles) of a given lat / lon location
3. Outputs the results as a Shapefile in a folder specified
The inputs to the script include the various access codes, a location, a search term and an output file location. These variables are all fed into the script based on Toolbox inputs. Getting the inputs is relatively simple – they appear in the order that they are added to the Toolbox, and are acquired via in_params[[x]]
where x
is the order number; thus search_term = in_params[[1]]
pulls a search term into a new R object called “search_term”. The basic structure of a script are as follows (code snippet provided by ESRI):
tool_exec <- function(in_params, out_params) {
# the first input parameter, as a character vector
input.dataset <- in_params[[1]]
# alternatively, can access by the parameter name:
input.dataset <- in_params$input_dataset
print(input.dataset)
# ... do analysis steps
out_params[[1]] <- results.dataset
return(out_params)
}
For more details about the functions available in arcgisbinding, see the documentation located here
The Twitter Search Tool was run within ArcGIS Pro and requires you to add a new toolbox. The toolbox should be downloaded along with the R script and placed in a folder somewhere on your hard drive. The files can be found on github here.
The following screenshot is of the Shapefile shown on an OpenStreetMap basemap; with the attribute table also shown – you will see that the full Tweet details are displayed as attributes associated with each point.
Anyway, I hope this is of use and can assist people getting started linking R to ArcGIS.
Continue reading »Talk given at Geocomputation 2015, University of Texas, Dallas. 20-23rd May, 2015.
Continue reading »Talk given at Geocomputation 2015, University of Texas, Dallas. 20-23rd May, 2015.
Continue reading »Talk given at AAG, Chicago 2015
Continue reading »Talk given at AAG, Chicago 2015
Continue reading »Seminar given at Saïd Business School, University of Oxford; 28/4/2015
Continue reading »Seminar given at Saïd Business School, University of Oxford; 28/4/2015 (While very jet lagged!)
Continue reading »View the site here.
HEFCE have released funding prior to a full loan system being introduced that provides bursaries to students wishing to pursue postgraduate study. The ways in which this scheme are being operated by the different university are d…
Continue reading »A workshop talk given at “Agent-based Modelling for Economics and Finance”, Oxford-Man institute, University of Oxford. 23/2/15.
Continue reading »My new book (co-edited with Chris Brunsdon) is now out.
Many thanks to all the chapter authors for their hard work; and if not arrived already, a very brightly coloured book should be in the post!
Thanks also go to Sage for a really nice production job.
Geocomputation is the intersection of advanced computational methods and geographical analysis and modelling. Geocomputation is applied and often interdisciplinary, with methodological developments typically embedded in applications seeking to address real world problems.
Geocomputation excels as a framework for researching many contemporary social science problems associated with large volumes of dynamic and spatio-temporal ‘big data’, such as those generated in ‘smart city’ contexts or from crowdsourcing.
This text:
Seminar given at Cardiff University on 16/12/14.
Continue reading »Seminar given at UCL on 2/12/14.
Continue reading »Short talk given at Nottingham Business School, ESRC KEO Event 27/11/14.
Continue reading »Quite a long time ago I spent considerable hours trawling through QMRG reports that featured in old issues of Area and Transactions of the Institute of British Geographers to examine how the committee had evolved over time. In these pre R days, I assem…
Continue reading »Yesterday I needed to simplify a shapefile quite substantially to get the size down enough that it could be loaded into CartoDB. Using QGIS this tended to leave sliver or gaps between polygons, but I came across Mapshaper. This is primarily a command l…
Continue reading »Talk at the Market Research Society, London; 5/11/14.
Continue reading »Paul Longley , James Cheshire and I supervised the PhD of Chris Gale over the past couple of years who developed the 2011 Census ONS Output Area Classification.
During development, Paul and I were approached by the Greater London Authority (GLA) to…
Continue reading »Keynote given in Dublin, Ireland IRLOGI (http://www.irlogi.ie/) conference on 16th October 2014.
Continue reading »Talk given at the Royal Society, Retail Research and Big Data Meeting – 7th October 2014.
Continue reading »Talk given at the Royal Society, Retail Research and Big Data Meeting – 7th October 2014.
Continue reading »Talk given at the University of Leeds, 3rd October 2014.
Continue reading »About the QMRG The Quantitative Methods Research Group is one of a number of Speciality Research Groups of the RGS-IBG. These Research and Study Groups bring together Society Fellows who are active researchers and those with a professional interest in a particular aspect of geography. The QMRG exists to promote the application of quantitative methods […]
Continue reading »The GIScRG is a group of academics and practitioners interested in promoting GIScience and GITechnology in geographical research, teaching and the workplace. We also support and promote e-science and the application of novel computing and spatial analysis paradigms to geographical systems, for example, agent-based modelling. We are currently sponsoring a number of sessions at the … Continue reading GIScience Research Group →
Continue reading »The following case studies demonstrate: the widespread use of quantitative methods and GIS in the workplace and how quantitative skills can be employed to produce excellent student work across the discipline. Case Studies… Risk Insurance GIS and Mapping Environmental Sector Environmental Consultancy Humanitarian Sector Local Government Financial Sector Student Work Featured Image: https://www.flickr.com/photos/churkinms/2582615161/sizes/o/
Continue reading »The Transport Map Books are available for each local authority district in England and present a series of maps related to commuting behaviour. The data are derived from multiple sources including: the 2011 Census, Department for Transport estimates and the results of a research project looking at carbon dioxide emissions linked to the school commute.
All the maps are available to download HERE; and the R code used to create them and the emissions model is on Github.
These data relate to Middle Layer Super Output Area (MSOA) level estimates of travel to work flows by transport mode. The raw data are available from the ONS. For the maps, the flows have been limited to those both originating and terminating within each local authority district.
The Department of Transport provide a range of statistics at Lower Layer Super Output Area level about accessibility and connectivity to a series of key services. A subset of variables were mapped.
These data were generated as part of an ESRC funded project investigating emissions associated with the school commute. The model provides an estimate of the carbon dioxide emitted at Lower Layer Super Output Area level. For full details of the methodology, see the open access paper:
Singleton, A. (2013) A GIS Approach to Modelling CO2 Emissions Associated with the Pupil-School Commute. International Journal of Geographical Information Science, 28(2):256–273.
These attributes were extracted from the 2011 census data provided by Nomis at Output Area level.
Workplace zones are a new geography for the 2011 census for the dissemination of daytime population statistics. A number of attributes were selected related to transport, and also were downloaded from Nomis.
Alex Singleton – Cities and context: The codification of small areas through geodemographic classification from The Programmable City on Vimeo.
Talk given at NUI Maynooth – Code and the City, 3-4 September 2014.
Continue reading »As part of an ESRC Secondary Data Analysis Initiative grant Michail Pavlis, Paul Longley and I have been working on developing methods by which temporal patterns of geodemographic change can be modelled.
Much of this work has been focused on census based classifications, such as the 2001 Output Area Classification (OAC), and the 2011 OAC released today. We have been particularly interested in examining methods by which secondary data might be used to create measures enabling the screening of small areas over time as uncertainty builds as a result of residential structure change. The writeup of this work is currently out for review, however, we have placed the census based classification created for the years 2001 – 2011 on the new public.cdrc.ac.uk website, along with a change measure.
A map of the clusters in 2001 and 2011 for Leeds are as follows:
A talk given at the Oxford Institute for Population and Ageing, University of Oxford 4/6/14.
Continue reading »Talk given at National Centre for Geocomputation: Home – NUI Maynooth 21/5/14.
Continue reading »This time last year I published the first version of the 2011 Census Open Atlas which comprised Output Area Level census maps for each local authority district. This turned out to be quite a popular project, and I have also extended this to Japan.
The methods used to construct the atlases have now been refined, so each atlas is built from a series of PDF pairs comprising a map and a legend. These are generated for each of the census variable (where appropriate), with the layout handled by Latex. As with demonstrated in the Japan atlas, this also gives the advantage of enabling a table of contents and better description for each map.
Some other changes in version two include:
When the original project was picked up by the Guardian I made an estimate of the actual number of maps created, however, for this run, I counted them. In total 134,567 maps were created.
The maps can be downloaded from github; and again, the code used to create the maps is here (feel free to fix my code!).
A manual map might typically take 5 minutes to create – thus:
So, if you take a 35 hour working week for 46 weeks of a year (6 weeks holiday), this equates to 1,610 hours of map making time per year. As such, finishing 134,567 maps would take 6.9 years (11,213.9 / 1,610).
This would obviously be a very boring job; however, it would also be expensive. If we take the median wages of a GIS Technician at £20,030 then the “cost” of all these maps would be 6.9 X £20,030 = £138,207. This toy example does illustrate how learning to code can help save significant money, and indeed what a useful tool R is for spatial analysis.
Continue reading »Talk given at the EEO-AGI seminar series at the University of Edinburgh 31/1/14.
Continue reading »Talk given at the EEO-AGI seminar series at the University of Edinburgh 31/1/14.
Continue reading »When members of staff within your department retire, there are usually office clearouts, resulting in piles of interesting old books being given away.
A recent addition to my collection is a cartographic gem from 1995 titled “Statlas UK: A Statistic…
Continue reading »This article is published in the January 2014 issue of Geographical Magazine – page 77.
In my opinion, a geography curriculum should require students to learn how to code, ensuring that they’re equipped for a changed job market that’s increasingly detached from geographic information systems (GIS) as they were originally conceived.
The ability to code relates to basic programming and database skills that enable students to manipulate large and small geographic data sets, and to analyse them in automated and transparent ways. Although it might seem odd for a geographer to want to learn programming languages, we only have to look at geography curriculums from the 1980s to realise that these skills used to be taught. For example, it wouldn’t have been unusual for an undergraduate geographer to learn how to programme a basic statistical model (for example, regression) from base principles in Fortran (a programming language popular at the time) as part of a methods course. But during the 1990s, the popularisation of graphical user interfaces in software design enabled many statistical, spatial analysis and mapping operations to be wrapped up within visual and menu-driven interfaces, which were designed to lower the barriers of entry for users of these techniques. Gradually, much GIS teaching has transformed into learning how these software systems operate, albeit within a framework of geographic information science (GISc) concerned with the social and ethical considerations of building representations from geographic data. Some Masters degrees in GISc still require students to code, but few undergraduate courses do so.
The good news is that it’s never been more exciting to be a geographer. Huge volumes of spatial data about how the world looks and functions are being collected and disseminated. However, translating such data safely into useful information is a complex task. During the past ten years, there has been an explosion in new platforms through which geographic data can be processed and visualised. For example, the advent of services such as Google Maps has made it easier for people to create geographical representations online. However, both the analysis of large volumes of data and the use of these new methods of representation or analysis do require some level of basic programming ability. Furthermore, many of these developments have not been led by geographers, and there is a real danger that our skill set will be seen as superfluous to these activities in the future without some level of intervention. Indeed, it’s a sobering experience to look through the pages of job advertisements for GIS-type roles in the UK and internationally. Whereas these might once have required knowledge of a particular software package, they increasingly look like advertisements for computer scientists, with expected skills and experience that wouldn’t traditionally be part of an undergraduate geography curriculum.
Many of the problems that GIS set out to address can now be addressed with mainstream software or shared online services that are, as such, much easier to use. If I want to determine the most efficient route between two locations, a simple website query can give a response within seconds, accounting for live traffic-volume data. If I want to view the distribution of a census attribute over a given area, there are multiple free services that offer street-level mapping. Such tasks used to be far more complex, involving specialist software and technical skills. There are now far fewer job advertisements for GIS technicians than there were ten years ago. Much traditional GIS-type analysis is now sufficiently non-technical that it requires little specialist skill, or has been automated through software services, with a subscription replacing the employment of a technician. The market has moved on!
Geographers shouldn’t become computer scientists; however, we need to reassert our role in the development and critique of existing and new GIS. For example, we need to ask questions such as which type of geographic representation might be most appropriate for a given dataset. Today’s geographers may be able to talk in general terms about such a question, but they need to be able to provide a more effective answer that encapsulates the technologies that are used for display. Understanding what is and isn’t possible in technical terms is as important as understanding the underlying cartographic principles. Such insights will be more available to a geographer who has learnt how to code.
Within the area of GIS, technological change has accelerated at an alarming rate in the past decade and geography curriculums need to ensure that they embrace these developments. This does, however, come with challenges. Academics must ensure that they are up to date with market developments and also that there’s sufficient capacity within the system to make up-skilling possible.Prospective geography undergraduates should also consider how the university curriculums have adapted to modern market conditions and whether they offer the opportunity to learn how to code.
Continue reading »