geo.buffer | R Documentation |
Buffers data in geographic (Latitude/Longitude) projection
geo.buffer(x, r, ...)
x |
A sf or sp vector class object |
r |
Buffer radius in meters |
... |
Additional arguments passed to sf::st_buffer |
Projects (Latitude/Longitude) data in decimal-degree geographic projection using an on-the-fly azimuthal equidistant projection in meters centered on
an sp or sf polygon class object representing buffer for each feature
Jeffrey S. Evans <jeffrey_evans@tnc.org>
st_buffer
for st_buffer ... arguments
library(sf)
e <- c(61.87125, 23.90153, 76.64458, 37.27042)
names(e) <- c("xmin", "ymin", "xmax", "ymax")
s <- st_as_sf(st_sample(st_as_sfc(st_bbox(e)), size=100,
type = "regular"))
st_crs(s) <- st_crs(4326)
s$id <- 1:nrow(s)
b <- geo.buffer(x=s, r=1000)
plot(st_geometry(b[1,]))
plot(st_geometry(s[1,]), pch=20,cex=2, add=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.