aoi_snap: Snap Area of Interest

View source: R/aoi_snap.R

aoi_snapR Documentation

Snap Area of Interest

Description

Adjusts the area of interest to the nearest 100m. Note that this package assumes to data is in a metric equal area projection.

Usage

aoi_snap(aoi, method = "shrink")

Arguments

aoi

is a sf object (e.g. polygon). The bounding box of the shape will be used to create rectangular shape.

method

Options are shrink or expand. Shrink will snap the aoi in to the nearest 100m, Expand will snap the aoi out to the nearest 100m.

Details

This is an essential first step. As subsequent co-variate layers will be generated at multiple resolutions (e.g. 5, 10, 25m^2) and then disaggregate'd back to the lowest resolution. Having the aoi set 100m break-points facilitates this.

Examples

## Load sf object
aoi_raw <- sf::st_read(dsn = "../data/Block_aoi.gpkg", quiet = TRUE)
## snap aoi to nearest 100m
aoi_snap(aoi_raw)
##
## [1] "initial extent is:"
## xmin      ymin      xmax      ymax
## 559691.2 5994955.0  560687.0 5995832.5
## [1] "Expanded extent is:"
## xmin    ymin    xmax    ymax
## 559600 5994900  560700 5995900

ColinChisholm/pemGeneratr documentation built on March 18, 2023, 1:45 a.m.