Clipping a Surface By a Polygon

September 8, 2010
By

(This article was first published on Spatial Analysis » R, and kindly contributed to R-bloggers)

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.

To leave a comment for the author, please follow the link and comment on his blog: Spatial Analysis » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , , , , , ,

Comments are closed.