Clipping a Surface By a Polygon
[This article was first published on Spatial Analysis » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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):
Click here to view the code.
To leave a comment for the author, please follow the link and comment on their blog: Spatial Analysis » R.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.