buffer_rectangle: A rectangle Function

Description Usage Arguments Value References Examples

View source: R/buffer_rectangle.R

Description

Creates a rectangular polygon

Usage

1
buffer_rectangle(point, x_length, y_length, degree = 0)

Arguments

point

Centre point of the buffer, must equal to true in: sf::st_is(point, "POINT")

x_length

Length of the x-side (horizontal side), should be in the unit of projection (numeric)

y_length

Length of the y-side (vertical side), should be in the unit of projection (numeric)

degree

The angle at which the rectangle is centred (clockwise). Must be between 0 and 360 (numeric)

Value

An object of class sfc_POLYGON

References

Rotation function taken from Edzer Pebesma sf package vignette https://r-spatial.github.io/sf/articles/sf3.html

Examples

1
2
3
4
5
example_point = sf::st_point(c(1,2))
example_point = sf::st_sfc(example_point)
example_point = sf::st_sf(example_point)
buffer_rectangle(example_point, 200, 90, 22) -> rectangular_shaped_buffer
plot(rectangular_shaped_buffer)

buffeRs documentation built on Aug. 22, 2021, 9:07 a.m.