Convert between image orientation (top-left origin, y down) and GIS orientation (bottom-left origin, y up). Self-inverse.
Usage
sg_roi_flip_y(roi, height, call = rlang::caller_env())Arguments
- roi
An sg_roi.
- height
Numeric image height in pixels at the ROI's reference level.
- call
The calling environment, for error reporting.
Value
An sg_roi with the y-axis flipped.
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_overlaps(),
sg_roi_rescale(),
sg_roi_ring(),
sg_roi_rois_overlap(),
sg_roi_setops,
sg_roi_simplify(),
sg_roi_snap(),
sg_roi_transform()
Examples
sg_roi_flip_y(sg_roi_rect(0, 0, 10, 5, label = "a"), height = 100)
#> <sg_roi> a (POLYGON)
#> id: "roi_000000018" | level: 0 | source: manual
#> bbox: [0, 95] - [10, 100]