validate_poi: bbox from center point

Description Usage Arguments Value Note Examples

View source: R/aoi_processing.R

Description

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

Usage

1
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.

Note

This is for buffered data requests around a point.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
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)
}

slga documentation built on June 12, 2021, 9:07 a.m.