bbx_aggregate: Functions for aggregating bbx objects These functions can...

Description Usage Arguments Value Examples

View source: R/aggregate.R

Description

Functions for aggregating bbx objects These functions can perform union and intersection operations on bbx objects

Usage

1
2
3
4
5
bbx_aggregate(bbx, bbx2 = NULL, fx1, fy1, fx2, fy2)

bbx_union(bbx, bbx2 = NULL)

bbx_intersect(bbx, bbx2 = NULL)

Arguments

bbx

character vector of bounding boxes to perform operation on

bbx2

optional character vector of bounding boxes to element-wise aggregation with 'bbx'. If specified, needs to be length 1 or equal in length to 'bbx'.

fx1, fy1, fx2, fy2

functions to use for aggregating x1, y1, x2, y2, respectively. Defaults to 'min' for x1,y1 and 'max' for x2,y2

Value

bbx or missing value, if result is invalid bounding box

Examples

1
2
3
4
bbx_union(c("5 1 7 3", "2 4 6 8"))
bbx_union(c("5 1 7 3", "2 4 6 8"), c("1 1 1 1"))
bbx_intersect(c("5 1 7 3", "2 4 6 8")) # should return NA
bbx_intersect("5 1 7 3", "2 2 6 8")

dmi3kno/bbx documentation built on May 14, 2020, 9:08 p.m.