Clipping a Surface By a Polygon

Sep 08 2010 Published by James under R Spatial Data hints, Resources

Background:

A common function in standard GIS software enables users to create a raster surface and extract values or clip it based on a set of polygons. This may be used in cases where you want analysis to be constrained to within a town’s boundaries or a coastline. This tutorial will outline how to create a surface using kernel density estimation (KDE) and then clip the surface so that it is constrained within the City of London Boundary.

Data Requirements:

City of London Boundary Shapefile: Download (requires unzipping).

London Cycle Hire Locations: Download.

Install the following packages (if you haven’t done so already):

sm, maptools.

Click here to view the code.

No responses yet

Writing a Spatial Function: The Location Quotient

Sep 07 2010 Published by James under R Spatial Data hints, Resources

Background:
In some cases it is necessary to conduct the same analysis multiple times on either the same or different data. In such circumstances it is worth writing a function to simplify the code. In this example the location quotient provides a simple calculation easily written in to a function.

The location quotient (LQ) is an index for comparing a region’s share of a particular activity with the share of that same activity found at a more aggregate spatial level (a good book on this kind of thing is Burt et al.). In this example we take a shapefile of London Boroughs that contains information on the population of each borough and the percentage of sports participation in each borough. In this case there is little point in calculating the LQ as the percentage alone would be more meaningful. The focus here is how to undertake the methods, not their appropriate use, or the validity of the results.

Data Requirements:

London Sport Participation Shapefile: Download (requires unzipping)

Install the following packages (if you haven’t already done so):

maptools, RColorBrewer.

Click here to view the tutorial code.

No responses yet

R Maps

Sep 06 2010 Published by James under R Spatial Data hints, Resources

This is an updated version of my Making Maps with R tutorial. I think the code is lot simpler and it also includes some data for you to play around with.

Background:

Spatial data are becoming increasingly common, as are the tools available in R to process it. Of course one of the best ways of visualizing spatial data is through a map. Maps need to be well thought out. Not least, the selected colours need to be appropriate and sufficient context is provided through the use of a legend, title, scale bar and north arrow. The worksheet will demonstrate how to produce a map with R that includes all these elements.

Data Requirements:

London Sport Participation Shapefile. Download (requires unzipping)

Install the following packages (if you haven’t already done so):

maptools, RColorBrewer, classInt

Click here to view the tutorial code.

2 responses so far

Free GIS Resources

Jan 26 2010 Published by James under Book Review, Journals, Resources, Software

Over the last couple of days I have utilised some excellent free GIS resources. I have listed these and some others below.

Geospatial Analysis: This is the free online version of de Smith, Longley and Goodchild’s excellent book by the same title. It provides full coverage of current GIS methodologies. It also provides extensive information regarding the various GIS software available.

Analysing Spatial Point Patterns in R: 200 pages of workshop notes written by Adrian Baddeley. These provide extremely detailed and comprehensive overview of the spatstat in R.

GeoDa Center Tutorials: A range of tutorial material provided by creators of the GeoDa Software. I would focus on the R tutorials as the GeoDa tutorials are awaiting an update in line with the software’s latest release.

Spatial Stats. in ArcGIS: A preview chapter from the Springer’s Handbook of Applied Spatial Analysis.

CATMOGs: A hugely successful series of publications that cover the basics of spatial analysis, they have been written by many of the pioneers in the field. Topics include The Modifiable Areal Unit Problem (Openshaw), Voronoi (Thiessen) Polygons (Boots), Spatial Autocorrelation (Goodchild).

CASA Working Papers: A shameless plug for my fellow researchers. The nice thing about these is you don’t need to be part of an academic institution to access academic research.

I am sure there are many others and I welcome your suggestions…

4 responses so far

Making Maps with R

Jan 13 2010 Published by James under Interests, London, Software, Visualisation

***This tutorial has been updated, please click here***

I frequently use R (a free software environment for statistical computing and graphics) for data analysis.  As almost all my data are spatial it is often good to produce a map of the results without having to export the data into another GIS package. I am often asked how to do this so I have included here the code I used to create the map you see below. It should be quite straightforward to substitute my data with your own shapefile and alter some of the parameters such as the colour and the break points to produce your own map. For those interested in more advanced spatial analysis with R I recommend this book.

1801

4 responses so far

Lattice: Multivariate Data Visualization with R

Jan 11 2010 Published by James under Book Review, Visualisation

I have just reviewed Sarkar‘s Lattice: Multivariate Data Visualization with R for the Journal of the Royal Statistical Society Series A.  I would highly recommend the book to all R users who wish to produce publication quality graphics using the software. You can read the full review here.

Lattice_Coveer

No responses yet

Applied Spatial Data Analysis with R

Aug 25 2009 Published by James under Book Review, Resources, Software

I have just reviewed the book Applied Spatial Data Analysis with R which has been published in the September2009  issue of the Royal Statistical Society’s Significance magazine.

cda_displayimage

Applied Spatial Data Analysis with R is an accessible text that demonstrates and explains the handling of spatial data using the R Software Platform. The text’s authors have all been key contributors to the R spatial data analysis community, and the range of their contributions is evident from the comprehensive coverage of this work. It will appeal to those familiar with R but not spatial data, and vice versa, as well as those proficient in both and in search of a reference text. I highly recommend the book to those interested in embarking on spatial data analysis, those proficient in handling spatial data in other software and want to utlise R, and those already using R to manipulate and analyze spatial data.

One response so far