| overview_burn | R Documentation |
Aggregate a burn() result onto a grid of square tiles of block cells
and return the mean coverage per tile (in [0, 1] for non-overlapping
polygons). Tiles cut off by the grid boundary are normalised by their
actual cell count. Cost is proportional to the number of records plus
the number of tiles: a run that spans several tiles contributes partial
lengths to its two end tiles, and the fully covered tiles between them
are filled with a difference array, so nothing is expanded to cells
whatever the block size.
overview_burn(x, tiles = 256L, block = NULL)
x |
A |
tiles |
Target number of tiles along the longer grid axis; ignored
if |
block |
Tile size in cells. |
The result is a matrix in raster order (row 1 is the top), ready for
ximage::ximage(ov, extent = attr(ov, "extent")).
A numeric matrix (tile rows by tile columns) with attributes
extent (c(xmin, xmax, ymin, ymax) of the tile grid, which extends
past the burn grid on the right and bottom when block does not
divide its dimension) and block. Untouched tiles are NA.
if (requireNamespace("geos", quietly = TRUE)) {
poly <- geos::as_geos_geometry("POLYGON ((1 1, 9 1, 9 9, 1 9, 1 1))")
r <- burn(poly, extent = c(0, 10, 0, 10), dimension = c(1000L, 1000L))
ov <- overview_burn(r, tiles = 20)
dim(ov)
attr(ov, "extent")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.