Snap ROI vertices to a grid
Usage
sg_roi_snap(roi, grid = 1, call = rlang::caller_env())Arguments
- roi
An sg_roi.
- grid
Positive numeric grid spacing in pixels. Default
1.- call
The calling environment, for error reporting.
Value
An sg_roi with vertices rounded to the nearest grid multiple.
See also
Other geometry:
sg_roi_buffer(),
sg_roi_check_containment(),
sg_roi_check_geometry(),
sg_roi_clamp(),
sg_roi_contains(),
sg_roi_distance(),
sg_roi_fix_geometry(),
sg_roi_flip_y(),
sg_roi_overlaps(),
sg_roi_rescale(),
sg_roi_ring(),
sg_roi_rois_overlap(),
sg_roi_setops,
sg_roi_simplify(),
sg_roi_transform()
Examples
sg_roi_snap(sg_roi_point(3.4, 5.6, label = "a"), grid = 1)
#> <sg_roi> a (POINT)
#> id: "roi_000000052" | level: 0 | source: manual
#> bbox: [3, 6] - [3, 6]