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)
Run the code above in your browser using DataLab