chessboard | R Documentation |
Segment a raster into square regions of equal size arranged in a chessboard-like pattern.
chessboard(r, size)
r |
numeric terra::SpatRaster. One or more layers used to drive heterogeneity. |
size |
Numeric vector of length one. Size (in pixels) of each square segment. Must be a positive integer. |
This function divides the extent of a terra::SpatRaster into
non-overlapping square segments of the given size, producing a segmentation
map where each segment has a unique integer label. It can be an alternative
to sky_grid_segmentation()
in special cases.
terra::SpatRaster with one layer and integer values, where each unique value corresponds to a square-segment ID.
caim <- read_caim()
seg <- chessboard(caim, 20)
plot(caim$Blue)
plot(extract_feature(caim$Blue, seg))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.