sf_studyArea: Make Study Area Polygons

Description Usage Arguments Value Creation notes Future directions

Description

Make study area polygons from the extent (bbox) of an sf layer. Includes scaling options to increase or decrease size of the polygon by a ratio or by a distance calculated in map units. Because of this, the distance parameter only works for projected layers.

Usage

1
sf_studyArea(sfLayer, ratio = 1, dist = NULL)

Arguments

sfLayer

sf object

ratio

Numerical vector of length 1 or 2 (as it pertains to the x,y axes). Default: 1 to create a basic study area polygon for the sfLayer. Ignored if a dist is given.

dist

Numerical vector of length 1 or 2 (as it pertains to the x,y axes). Default: NULL.

Value

Returns a polygon sf layer that is a rectangle.

Creation notes

First created on 2019-Apr-22 while working on my IBM class project.

Future directions

I may need to add checks to make sure negative distance values won't flip the min and max values in the extent creation section.


jacpete/jpfxns2 documentation built on May 10, 2020, 9:15 p.m.