Learn R Programming

movecost (version 3.0.0)

mc_boundary: Cost-limit boundaries around origin locations

Description

Delineates, around each origin location, the area reachable within a given cost limit (for instance, the 30-minute walking catchment), reusing the graph stored in a mc_surface object. The accumulated cost surfaces for all origins are obtained with a single multi-source graph query, so the function scales efficiently with the number of origins (movecost <= 2.x recomputed the whole conductance matrix for each call).

Usage

mc_boundary(surface, origin, limit = NULL, time = "h")

Value

An object of class movecost_boundary, a list with components

  • boundaries: sf polygons (one feature per origin) with origin_id, limit, area (m^2) and perimeter (m) attributes;

  • accum: the minimum accumulated cost surface across origins (SpatRaster), useful for plotting;

  • origin: the origin location(s) (sf);

  • metadata used by the plot method.

Plot it at any time with plot() (see plot.movecost_boundary).

Arguments

surface

a movecost_surface object created by mc_surface.

origin

origin location(s) (sf points, SpatVector, or legacy SpatialPointsDataFrame).

limit

cost limit defining the boundary, in the unit of the cost function (for time-based functions, in the unit selected via time); if NULL (default), one tenth of the range of accumulated values across all origins is used.

time

unit for time-based cost functions: "h" (hours, default) or "m" (minutes).

Details

Unlike movecost <= 2.x, which derived the boundary from contour lines of a combined minimum-cost surface, version 3.0 polygonises each origin's reachable area directly (cells with accumulated cost <= limit), which yields closed polygons by construction and allows area and perimeter to be computed exactly. Overlapping catchments of different origins are preserved as separate (overlapping) polygons.

See Also

mc_surface, plot.movecost_boundary

Examples

Run this code
dtm <- mc_volc()
destin <- mc_destin_loc()

surf <- mc_surface(dtm, funct = "t", move = 8)
# 5-minute walking catchments around three locations
bnd <- mc_boundary(surf, origin = destin[1:3, ], limit = 5, time = "m")

bnd$boundaries     # polygons with area and perimeter
plot(bnd)

Run the code above in your browser using DataLab