movebound {movecost} | R Documentation |
R function for calculating slope-dependant walking cost boundary(ies) around point location(s)
Description
The function provides the facility to calculate walking cost boundary(ies) around one or more point locations. Rationale: while movecost
can calculate and render an accumulated cost surface and corresponding isolines around a point location, the user(s) might want to
calculate and plot a boundary (or boundaries) corresponding to a specific walking cost limit around one or more locations,
either in terms of walking time or energy expenditure.
Visit this LINK to access the package's vignette.
Usage
movebound(
dtm = NULL,
origin,
studyplot = NULL,
barrier = NULL,
plot.barrier = FALSE,
funct = "t",
time = "h",
move = 16,
field = 0,
cont.value = NULL,
cogn.slp = FALSE,
sl.crit = 10,
W = 70,
L = 0,
N = 1,
V = 1.2,
z = 9,
cont.lab = TRUE,
transp = 0.5,
add.geom = FALSE,
export = FALSE
)
Arguments
dtm |
Digital Terrain Model (RasterLayer class); if not provided, elevation data will be acquired online for the area enclosed by the 'studyplot' parameter (see |
origin |
location(s) around which the boundary(ies) is calculated (SpatialPointsDataFrame class). |
studyplot |
polygon (SpatialPolygonDataFrame class) representing the study area for which online elevation data are acquired (see |
barrier |
area where the movement is inhibited (SpatialLineDataFrame or SpatialPolygonDataFrame class) (see |
plot.barrier |
TRUE or FALSE (default) if the user wants or does not want the barrier to be plotted (see |
funct |
cost function to be used (for details on each of the following, see -functions expressing cost as walking time- -functions for wheeled-vehicles- -functions expressing abstract cost- -functions expressing cost as metabolic energy expenditure- |
time |
time-unit expressed by the isoline(s) if Tobler's and other time-related cost functions are used; h' for hour, 'm' for minutes. |
move |
number of directions in which cells are connected: 4 (rook's case), 8 (queen's case), 16 (knight and one-cell queen moves; default). |
field |
value assigned to the cells coincidinng with the barrier (0 by default) (see |
cont.value |
cost value represented by the calculated isoline(s) (NULL by default); if no value is supplied, it is set to 1/10 of the range of values of the accumulated cost surface. |
cogn.slp |
TRUE or FALSE (default) if the user wants or does not want the 'cognitive slope' to be used in place of the real slope (see |
sl.crit |
critical slope (in percent), typically in the range 8-16 (10 by default) (used by the wheeled-vehicle cost function; see |
W |
walker's body weight (in Kg; 70 by default; used by the Pandolf's and Van Leusen's cost function; see |
L |
carried load weight (in Kg; 0 by default; used by the Pandolf's and Van Leusen's cost function; see |
N |
coefficient representing ease of movement (1 by default) (see |
V |
speed in m/s (1.2 by default) (used by the Pandolf et al.'s, Pandolf et al.s with correction factor, Van Leusen's, and Ardigo et al.'s cost function; if set to 0, it is internally worked out on the basis of Tobler on-path hiking function (see |
z |
zoom level for the elevation data downloaded from online sources (from 0 to 15; 9 by default) (see |
cont.lab |
TRUE (default) or FALSE if the usuer wants or does not want labels to be attached to the isolines. |
transp |
set the transparency of the slopeshade raster that is plotted over the DTM (0.5 by default). |
add.geom |
TRUE or FALSE (default) if the user wants or does not want the area enclosed by each isolines to be calculated (see Details). |
export |
TRUE or FALSE (default) if the user wants or does not want the isoline(s) and the copy of the input 'origin' dataset (storing boundaries' geometry information) to be exported; if TRUE, they will be exported as a shapefile; the exported file will bear a suffix corresponding to the cost function selected by the user. The DTM is exported only if it was not provided by the user and downloaded by the function from online sources. |
Details
The function just requires an input DTM and a dataset ('SpatialPointsDataFrame' class) containing at least one point location.
If a DTM is not provided, movebound()
will download elevation data from online sources (see movecost
for more details).
Under the hood, movebound()
relies on the movecost()
function and implements the same
cost functions: see the help documentation of movecost()
for further information.
The following example uses in-built datasets and calculates 45-minute boundaries around three locations close to Mt Etna (Sicily, Italy), using the
Tobler's off-path hiking function (note: elevation data are acquired online for the area enclosed by the polygon fed via the
'studyplot' parameter):
result <- movebound(origin=Etna_end_location, cont.value=45, time="m", cont.lab = TRUE, funct="tofp", studyplot = Etna_boundary, add.geom=TRUE)
Note that by setting the parameter add.geom
to TRUE
, the function calculates the area enclosed by the boundary represented by each
calculated isoline. Needless to say, the unit of measure is the one used by the input layers' coordinate system. The value(s) of the area
will be appended as a new variables to a copy of the input 'origin' dataset. The area can only be calculated if the
isolines are "complete" and not truncated (i.e., if they do not meet the end of the study area for instance). Therefore, before using this option,
the user may want to be sure that all the isolines are actual loops.
With reference to the above example, the area of the three 45-minutes boundaries can be retrieved typing what follows:
result$origin_w_isolines_geom$area
It will return:
17857994 20428575 9172688
that are the values of the area of each 45-minute boundary in square meter.
Needless to say, if we want to convert to square km we can just:
result$origin_w_isolines_geom$area/1000000
which gives
17.857994 20.428575 9.172688
movebound()
produces a plot representing the input DTM overlaid by a slopeshade raster, whose transparency can be adjusted using
the 'transp' parameter. On the rendered plot, the calculated isoline(s) is displayed and the label(s) representing the cost limit can be
activated or deactivated using the 'cont.lab' parameter. The function also returns the isoline(s) ('SpatialLinesDataFrame' class) corresponding
to the selected accumulated cost limit and the copy of the 'origin' dataset (storing information about the boundaries' geometry) (see 'Value' below).
The isoline(s) and the copy of the 'origin' dataset can be exported as shapefile by setting the export
parameter to TRUE
.
Value
The function returns a list storing the following components
dtm: Digital Terrain Model ('RasterLayer' class)
isolines: contour line(s) representing the selected cost limit ('SpatialLinesDataFrame' class)
origin_w_isolines_geom: copy of the input origin location(s) dataset with a new variable ('area') storing the area values of the boundary calculated around each location
See Also
Examples
# load a sample Digital Terrain Model
data(volc)
# load the sample destination locations on the above DTM
data(destin.loc)
# calculate the 5minute walking time boundary around a location
# using the Tobler's off-path hiking function
result <- movebound(dtm=volc, origin=volc.loc, funct="tofp", move=8, time="m", cont.val=5)
# same as above, but around multiple locations; contours' labels are turned off
result <- movebound(dtm=volc, origin=destin.loc, funct="tofp", move=8, time="m",
cont.val=2, cont.lab=FALSE)