Apply sf::st_make_valid() to invalid ROIs (which also drops duplicate
consecutive vertices) and clamp out-of-bounds vertices into the image bounds,
reporting what changed.
Usage
at_fix_geometry(project, verbose = TRUE, call = rlang::caller_env())Arguments
- project
An annot_project.
- verbose
Logical; whether to report repairs. Default
TRUE.- call
The calling environment, for error reporting.
Value
The annot_project with repaired geometry. Repairs are reported via
cli::cli_inform() when verbose is TRUE. Issues that cannot be repaired
(zero area, degenerate, NA coordinates) are left in place and reported.