Pages Menu
TwitterRss
Categories Menu

Posted by on Sep 8, 2010 in R Spatial, Resources | 6 comments

Clipping a Surface By a Polygon

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.

Share on Facebook
Bookmark this on Google Bookmarks
Share on reddit
Bookmark this on Digg
Share on StumbleUpon
Share on LinkedIn

6 Comments

  1. Hi! interesting reading the code – FWIW I also had to install
    rgl
    rpanel
    to get it to run :)

    • Thanks for that- yeah the sm package needs it. Sorry for missing it off!

  2. Absolutely fantastic. This is really useful. Thanks.

  3. Installing sm and maptools was all I needed to get it working.
    Thanks for the nice post.

Post a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>