Queries the sparse tables directly; no dense matrix is created. For points at cell centres this reproduces materialize_chunk() exactly: extract_burn(x, xy, fun) == materialize_chunk(x, fun)[cbind(row, col)]

extract_burn(x, xy, fun = c("id", "sum"))

Arguments

x

A controlledburn object returned by burn().

xy

A two-column matrix or data.frame of x, y coordinates in the CRS of the burn.

fun

character, "id" (last geometry written wins, NA background) or "sum" (accumulated coverage/length/count, 0 background). Same semantics as materialize_chunk().

Value

A numeric vector of length nrow(xy). Points outside the grid extent are NA for both funs.

Details

Interior runs are matched by row equality plus column interval containment; edges, lines, and points by exact (row, col) match. Cost is O(points + hits), independent of grid dimension.