rectBuff: Construct rectangular buffers

Description Usage Arguments Value See Also Examples

Description

Construct rectangular buffers around points of x with side-lengths twice the values of d1 and d2. The axis defined by d1 will be aligned parallel with bearing b. If b is missing, then it is assumed to be 0 degrees. If parameter d2 is missing, then this function constructs a square with length d1.

Usage

1
rectBuff(x, d1, d2, b = 0)

Arguments

x

point(s) of longitude-latitude in a row vector or matrix of two columns, or an object of class SpatialPoints*

d1

half length of bearing aligned distance(s) of class units

d2

half length of bearing orthogonal distances(s) of class units

b

bearing(s) of d1 in degrees

Value

A SpatialPolygons object

See Also

bearing

Examples

1
2
3
4
5
6
7
8
9
p11 <- c(-92.44744828628, 34.566107548536)
p12 <- p11 + rnorm(2, sd=0.01)
p21 <- p12 + rnorm(2, sd=0.01)
p22 <- p21 + rnorm(2, sd=0.01)
b1 <- geosphere::bearing(p11, p12)
b2 <- geosphere::bearing(p21, p22)
sp::plot(rectBuff(p11, units::ud_units $mi, 2*units::ud_units $mi, b1))
sp::plot(with(units::ud_units, rectBuff(rbind(p11, p21), mi, 2*mi,
                                        c(b1, b2))))

cmarmstrong/buffy documentation built on May 16, 2019, 2:30 a.m.