gEdgePoints: Adjust a polygonal study area to incorporate points near...

Description Usage Arguments Value Examples

View source: R/polygonprocessing.R

Description

Function to buffer an existing polygonal study area to create a revised study area that includes all known points.

Usage

1
gEdgePoints(x, pts, width)

Arguments

x

input study area of class SpatialPolygons*

pts

observations of class SpatialPoints*

width

width to buffer the points

Value

An object of class SpatialPolygonsDataFrame

Examples

 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")

ahb108/sparch documentation built on Feb. 3, 2021, 1:21 a.m.