Learn R Programming

slga (version 1.2.0)

validate_poi: bbox from center point

Description

Get a bounding box from an x,y point and desired buffer distance

Usage

validate_poi(poi = NULL, product = NULL, buff = 0)

Arguments

poi

Numeric; length-2 vector of x, y coordinates or `sf` style point.

product

Character, one of the options from column 'Short_Name' in slga_product_info.

buff

Integer, cell buffer around point. Defaults to 0 (single cell).

Value

sf style bbox or list of same, aligned to requested product, centered on `point` and extending `buff` cells away from centre.

Examples

Run this code
# NOT RUN {
{
library(slga)
poi <- c(152, -27)

# size 0 = extent of single cell
slga:::validate_poi(poi = poi, product = 'SLPPC', buff = 0)

# size 3 = 7x7 cells (centre cell and 3 in each direction)
slga:::validate_poi(poi = poi, product = 'SLPPC', buff = 3)
}

# }

Run the code above in your browser using DataLab