Skip to contents

Combine ROIs geometrically. Each accepts several sg_roi via ..., or a single sg_roi_layer. Multi-part results are returned as one ROI with MULTIPOLYGON geometry (the return type is always a single sg_roi).

Usage

sg_roi_union(..., call = rlang::caller_env())

sg_roi_intersect(..., call = rlang::caller_env())

sg_roi_difference(..., call = rlang::caller_env())

sg_roi_symdiff(..., call = rlang::caller_env())

Arguments

...

Two or more sg_roi, or a single sg_roi_layer.

call

The calling environment, for error reporting.

Value

A single sg_roi with source = "derived".

Examples

a <- sg_roi_rect(0, 0, 6, 6, label = "x")
b <- sg_roi_rect(4, 4, 10, 10, label = "x")
sg_roi_area(sg_roi_intersect(a, b))
#> [1] 4