Learn R Programming

stplanr (version 0.1.4)

buff_geo: Create a buffer of n metres for non-projected 'geographical' spatial data

Description

Solves the problem that buffers will not be circular when used on non-projected data.

Usage

buff_geo(shp, width, ..., silent = TRUE)

Arguments

shp
A spatial object with a geographic CRS (WGS84) around which a buffer should be drawn
width
The distance (in metres) of the buffer
...
Arguments passed to rgeos::gBuffer()
silent
A binary value for printing the CRS details (default: FALSE)

Details

Returns a

Examples

Run this code
data("routes_fast")
sp::proj4string(routes_fast) <- CRS("+init=epsg:4326")
buff <- buff_geo(routes_fast, width = 100)
plot(buff)
plot(routes_fast, add = TRUE)

Run the code above in your browser using DataLab