Detect boundaries (edges). Boundaries are cells that have more than one class in the 4 or 8 cells surrounding it, or, if classes=FALSE, cells with values and cells with NA.
SpatRaster. Cell values are either 1 (a boundary) or 0 (not a boundary), or NA
Arguments
x
SpatRaster
inner
logical. If TRUE, "inner" boundaries are returned, else "outer" boundaries are returned
classes
character. Logical. If TRUE all different values are (after rounding) distinguished, as well as NA. If FALSE (the default) only edges between NA and non-NA cells are considered
directions
integer. Which cells are considered adjacent? Should be 8 (Queen's case) or 4 (Rook's case)
falseval
numeric. The value to use for cells that are not a boundary and not NA
ignoreNA
logical. If TRUE and classes=TRUE external boundaries (with NA cells) are ignored, only boundaries between classes are returned (and the value of argument inner is irrelevant)