Description Usage Arguments Value Examples
View source: R/polygonprocessing.R
Function to buffer an existing polygonal study area to create a revised study area that includes all known points.
1 | gEdgePoints(x, pts, width)
|
x |
input study area of class SpatialPolygons* |
pts |
observations of class SpatialPoints* |
width |
width to buffer the points |
An object of class SpatialPolygonsDataFrame
1 2 3 4 5 6 7 8 9 10 11 | utm34n <- CRS("+init=epsg:32634") # Greek UTM (west)
## Create some points within and beyond polygon b2
b1 <- basicbox(c(681900,4010900), c(682500,4011400), proj4string=utm34n)
b2 <- basicbox(c(681920,4010920), c(682480,4011380), proj4string=utm34n)
set.seed(123)
pts <- spsample(b1,100, type="random")
## New polygon to include all points
b2b <- gEdgePoints(b2,pts,25)
plot(b2b, border="red")
points(pts, pch=19, cex=0.3, col="blue")
plot(b2, add=TRUE, border="black", lty="dotted")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.