| mc_alloc | R Documentation |
Partitions the landscape into zones of pertinence, assigning each DTM cell
to the origin location from which it can be reached at the smallest
accumulated cost. The result is the cost-based analogue of Voronoi/Thiessen
polygons.
mc_alloc(surface, origin, time = "h", breaks = NULL)
surface |
a |
origin |
origin location(s) (sf points, SpatVector, or legacy SpatialPointsDataFrame); at least two. |
time |
unit for time-based cost functions: "h" (hours, default) or "m" (minutes). |
breaks |
optional isoline interval for the minimum-cost surface; if NULL (default), one tenth of its range. Isolines are returned for optional display in the plot method. |
All the accumulated cost surfaces are obtained with a single multi-source
graph query on the mc_surface object: with n origins,
movecost <= 2.x performed n full conductance-matrix constructions plus n
accumulation runs, whereas this implementation performs none of the former
and one batched run of the latter, making allocation over many sites orders
of magnitude faster.
An object of class movecost_alloc, a list with components
alloc: allocation zones (SpatRaster; cell value = index
of the prevailing origin);
zones: the same zones as polygons (sf) with an
origin_id attribute;
accum.min: minimum accumulated cost across origins
(SpatRaster);
isolines: isolines of accum.min (sf);
origin: the origin locations (sf);
metadata used by the plot method.
Plot it at any time with plot() (see
plot.movecost_alloc).
mc_surface, plot.movecost_alloc
dtm <- mc_volc()
destin <- mc_destin_loc()
surf <- mc_surface(dtm, funct = "t", move = 8)
al <- mc_alloc(surf, origin = destin)
plot(al) # allocation zones
plot(al, isolines = TRUE) # with cost isolines overlaid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.