Description Usage Arguments Details Examples
The function provides the facility to calculate the accumulated cost of movement around a starting location and to optionally calculate least-cost paths toward
one or multiple destinations. It implements different cost estimations related to human movement across the landscape.
The function takes as input a Digital Terrain Model ('RasterLayer' class) and a point feature ('SpatialPointsDataFrame' class), the latter representing
the starting location, i.e. the location from which the accumulated cost is calculated.
1 2 3 4 5 |
dtm: |
digital terrain model (RasterLayer class). |
slope: |
slope dataset (RasterLayer class); if NULL (default), the slope (in degree) is internally calculated (see Details). |
origin: |
location from which the walking time is computed (SpatialPointsDataFrame class). |
destin: |
location(s) to which least-cost path(s) is calculated (SpatialPointsDataFrame class). |
funct: |
cost function to be used: t (default) uses the on-path Tobler's hiking function; tofp uses the off-path Tobler's hiking function; mt uses the modified Tobler's function; ic uses the Irmischer-Clarke's modified Tobler's hiking function (on-path); icofp uses the Irmischer-Clarke's modified Tobler's hiking function (off-path); ug uses the Uriarte Gonz<c3><a1>lez's slope-dependant walking-time cost function; ree uses the relative energetic expenditure cost function; hrz uses the Herzog's metabolic cost function; wcs uses the wheeled-vehicle critical slope cost function; p uses the Pandolf et al.'s metabolic energy expenditure cost function; vl uses the Van Leusen's metabolic energy expenditure cost function (see Details). |
time: |
time-unit expressed by the accumulated raster and by the isolines if Tobler's and Tobler-related cost functions are used; 'h' for hour, 'm' for minutes. |
outp: |
type of output: 'raster' or 'contours' (see Details). |
sl.crit: |
critical slope (in percent), typically in the range 8-16 (10 by default) (used by the wheeled-vehicle cost function; see Details). |
W: |
walker's body weight (in Kg; used by the Pandolf's and Van Leusen's cost function; see Details). |
L: |
carried load weight (in Kg; used by the Pandolf's and Van Leusen's cost function; see Details). |
N: |
coefficient representing ease of movement (1 by default) (used by the Pandolf's and Van Leusen's cost function; see Details). |
V: |
speed in m/s (1.2 by default) (used by the Pandolf's and Van Leusen's cost function; see Details). |
moves: |
number of directions used when computing the accumulated cost-surface (16 by default). |
breaks: |
isolines interval; if no value is supplied, the interval is set by default to 1/10 of the range of values of the accumulated cost surface. |
cont.lab: |
if set to TRUE (default) display the labels of the contours over the accumulated cost surface. |
destin.lab: |
if set to TRUE (default) display the label(s) indicating the cost at the destination location(s). |
cex.breaks: |
set the size of the time labels used in the isochrones plot (0.6 by default). |
cex.lcp.lab: |
set the size of the labels used in least-cost path(s) plot (0.6 by default). |
oneplot: |
TRUE (default) or FALSE if the user wants or does not want the plots displayed in a single window. |
export: |
TRUE or FALSE (default) if the user wants or does not want the outputs to be exported; if TRUE, the accumulated cost surface will be exported as a GeoTiff file, while the isolines and the least-cost path(s) will be exported as shapefile; all the exported files will bear a suffix corresponding to the cost function selected by the user. |
If the parameter 'destin' is fed with a dataset representing destination location(s) ('SpatialPointsDataFrame' class), the function will also calculate
least-cost path(s) plotted on the input DTM; the length of each path will be saved under the variable 'length' stored in the 'LCPs' dataset ('SpatialLines' class) returned by the function.
The red dot(s) representing the destination location(s) will be labelled with numeric values representing
the cost value at the location(s). The cost value will be also appended to the updated destination dataset returned by the function and
storing a new variable named 'cost'.
The function builds on functions out of the 'gdistance' package, and by default uses a 16-directions movement in calculating the accumulated cost-surface. The number of movements can be optionally set by the user via the 'moves' parameter.
The slope is internally calculated by the function using the 'terrain()' function out of the 'raster' package, using 8 neighbors.
The slope is calculated in degrees and, for the sake of its use within the implemented cost functions, it is internally modified (i.e., turned into either gradient or percent)
according to the user-selected cost function. The user can input a slope dataset (RasterLayer class) using the parameter 'slope'; this can prove usefull
in cases when the slope has to be preliminarily modified, for instance to mask out areas that cannot be crossed or to weight the slope values according
to a user-defined weighting scheme.
The following cost functions are implemented (x stands for slope):
Tobler's hiking function (on-path) (speed in kmh):
6 * exp(-3.5 * abs(tan(x*pi/180) + 0.05))
Tobler's hiking function (off-path) (speed in kmh):
(6 * exp(-3.5 * abs(tan(x*pi/180) + 0.05))) * 0.6
as per Tobler's indication, the off-path walking speed is reduced by 0.6.
M<c3><a1>rquez-P<c3><a9>rez et al.'s modified Tobler hiking function (speed in kmh):
4.8 * exp(-5.3 * abs((tan(x*pi/180) * 0.7) + 0.03))
modified version of the Tobler's hiking function as proposed by Joaqu<c3><ad>n M<c3><a1>rquez-P<c3><a9>rez, Ismael Vallejo-Villalta & Jos<c3><a9> I. <c3><81>lvarez-Francoso (2017), "Estimated travel time for walking trails in natural areas",
Geografisk Tidsskrift-Danish Journal of Geography, 117:1, 53-62, DOI: 10.1080/00167223.2017.1316212.
Irmischer-Clarke's modified Tobler hiking function (on-path):
(0.11 + exp(-(tan(x*pi/180)*100 + 5)^2 / (2 * 30)^2)) * 3.6
modified version of the Tobler's function as proposed for (male) on-path hiking by Irmischer, I. J., & Clarke, K. C. (2018). Measuring and modeling the speed of human navigation.
Cartography and Geographic Information Science, 45(2), 177<e2><80><93>186. https://doi.org/10.1080/15230406.2017.1292150. Note: the function originally expresses speed in m/s; it has been is reshaped (multiplied by 3.6)
to turn it into kmh for consistency with the other Tobler-related cost functions; also, originally the slope is in percent; tan(x*pi/180)*100 turns the slope from degrees to percent (=rise/run*100).
Irmischer-Clarke's modified Tobler hiking function (off-path):
(0.11 + 0.67 * exp(-(tan(x*pi/180)*100 + 2)^2 / (2 * 30)^2)) * 3.6
Uriarte Gonz<c3><a1>lez's slope-dependant walking-time cost function:
1/ (0.0277 * (tan(x*pi/180)*100) + 0.6115)
proposed by Uriarte Gonz<c3><a1>lez;
see: Chapa Brunet, T., Garc<c3><ad>a, J., Mayoral Herrera, V., & Uriarte Gonz<c3><a1>lez, A. (2008). GIS landscape models for the study of preindustrial settlement patterns in Mediterranean areas.
In Geoinformation Technologies for Geo-Cultural Landscapes (pp. 255<e2><80><93>273). CRC Press. https://doi.org/10.1201/9780203881613.ch12.
The cost function is originally expressed in seconds; for the purpose of its implementation in this function, it is the reciprocal of time (1/T) that is used in order to eventually get
T/1. Also, originally the slope is in percent: tan(x*pi/180)*100 turns the slope from degrees to percent (=rise/run*100).
Unlike the original cost function, here the pixel resolution is not taken into account since 'gdistance' takes care of the cells' dimension
when calculating accumulated costs.
Relative energetic expenditure cost function:
1 / (tan(x*pi/180) / tan (1*pi/180))
slope-based cost function expressing change in potential energy expenditure;
see Conolly, J., & Lake, M. (2006). Geographic Information Systems in Archaeology. Cambridge: Cambridge University Press, p. 220;
see also Newhard, J. M. L., Levine, N. S., & Phebus, A. D. (2014). The development of integrated terrestrial and marine pathways in the Argo-Saronic region, Greece. Cartography and Geographic Information Science, 41(4), 379<e2><80><93>390, with references to studies that use this
function; see also ten Bruggencate, R. E., Stup, J. P., Milne, S. B., Stenton, D. R., Park, R. W., & Fayek, M. (2016). A human-centered GIS approach to modeling mobility on southern Baffin Island, Nunavut,
Canada. Journal of Field Archaeology, 41(6), 684<e2><80><93>698. https://doi.org/10.1080/00934690.2016.1234897.
Herzog's metabolic cost function in J/(kg*m):
1 / ((1337.8 * tan(x*pi/180)^6 + 278.19 * tan(x*pi/180)^5 - 517.39 * tan(x*pi/180)^4 - 78.199 * tan(x*pi/180)^3 + 93.419 * tan(x*pi/180)^2 + 19.825 * tan(x*pi/180) + 1.64))
see Herzog, I. (2016). Potential and Limits of Optimal Path Analysis. In A. Bevan & M. Lake (Eds.), Computational Approaches to Archaeological Spaces (pp. 179<e2><80><93>211). New York: Routledge.
Wheeled-vehicle critical slope cost function:
1 / (1 + ((tan(x*pi/180)*100) / sl.crit)^2)
where sl.crit (=critical slope, in percent) is "the transition where switchbacks become more effective than direct uphill or downhill paths" and typically is in the range 8-16;
see Herzog, I. (2016). Potential and Limits of Optimal Path Analysis. In A. Bevan & M. Lake (Eds.), Computational Approaches to Archaeological Spaces (pp. 179<e2><80><93>211). New York: Routledge.
Pandolf et al.'s metabolic energy expenditure cost function (in Watts):
1 / (1.5 * W + 2.0 * (W + L) * (L / W)^2 + N * (W + L) * (1.5 * V^2 + 0.35 * V * (tan(x*pi/180)*100)))
where W is the walker's body weight (Kg), L is the carried load (in Kg), V is the velocity in m/s, N is a coefficient representing ease of movement on the terrain.
As for the latter, suggested values available in literature are: Asphalt/blacktop=1.0; Dirt road=1.1; Grass=1.1; Light brush=1.2; Heavy brush=1.5; Swampy bog=1.8; Loose sand=2.1; Hard-packed snow=1.6; Ploughed field=1.3;
see de Gruchy, M., Caswell, E., & Edwards, J. (2017). Velocity-Based Terrain Coefficients for Time-Based Models of Human Movement. Internet Archaeology, 45(45). https://doi.org/10.11141/ia.45.4.
For this cost function, see Pandolf, K. B., Givoni, B., & Goldman, R. F. (1977). Predicting energy expenditure with loads while standing or walking very slowly. Journal of Applied Physiology, 43(4), 577<e2><80><93>581. https://doi.org/10.1152/jappl.1977.43.4.577.
For the use of this cost function in a case study, see Rademaker, K., Reid, D. A., & Bromley, G. R. M. (2012). Connecting the Dots: Least Cost Analysis, Paleogeography, and the Search for Paleoindian Sites in Southern Highland Peru. In D. A. White & S. L. Surface-Evans (Eds.), Least Cost Analysis of Social Landscapes. Archaeological Case Studies (pp. 32<e2><80><93>45). University of Utah Press;
see also Herzog, I. (2013). Least-cost Paths - Some Methodological Issues, Internet Archaeology 36 (http://intarch.ac.uk/journal/issue36/index.html) with references.
Note: in the returned charts, the cost is transposed from Watts to Megawatts (see, e.g., Rademaker et al 2012 cited above).
Van Leusen's metabolic energy expenditure cost function (in Watts):
1 / (1.5 * W + 2.0 * (W + L) * (L / W)^2 + N * (W + L) * (1.5 * V^2 + 0.35 * V * (tan(x*pi/180)*100) + 10))
which modifies the Pandolf et al.'s equation; see Van Leusen, P. M. (2002). Pattern to process: methodological investigations into the formation and interpretation of spatial patterns in archaeological landscapes. University of Groningen.
Note that, as per Herzog, I. (2013). Least-cost Paths - Some Methodological Issues, Internet Archaeology 36 (http://intarch.ac.uk/journal/issue36/index.html) and
unlike Van Leusen (2002), in the above equation slope is expressed in percent and speed in m/s; also, in the last bit of the equantion, 10 replaces
the value of 6 used by Van Leusen (as per Herzog 2013).
Note: in the returned charts, the cost is transposed from Watts to Megawatts.
Note that the walking-speed-related cost functions listed above are used as they are, while the other functions are reciprocated.
This is done since "gdistance works with conductivity rather than the more usual approach using costs"; therefore
"we need inverse cost functions" (Nakoinz-Knitter (2016). "Modelling Human Behaviour in Landscapes". New York: Springer, p. 183).
As a consequence, if we want to estimate time, we have to use the walking-speed functions as they are since the final accumulated values will correspond to the
reciprocal of speed, i.e. pace. In the other cases, we have to use 1/cost-function to eventually get cost-function/1.
When using the Tobler-related cost functions, the time unit can be selected by the user setting the 'time' parameter to 'h' (hour) or to 'm' (minutes).
In general, the user can also select which type of visualization the function has to produce; this is achieved setting the 'outp' parameter to either 'r' (=raster)
or to 'c' (=contours). The former will produce a raster image with a colour scale and contour lines representing the accumulated cost surface; the latter parameter will only
produce contour lines.
The contour lines' interval is set using the parameter 'breaks'; if no value is passed to the parameter, the interval will be set by default to
1/10 of the range of values of the accumulated cost surface.
The function returns a list storing:
-$accumulated.cost.raster: raster representing the accumualted cost (RasterLayer class);
-$isolines: contour lines derived from the accumulated cost surface (SpatialLinesDataFrame class);
-$LCPs: estimated least-cost paths (SpatialLines class);
-$LCPs$length: length of each least-cost path (units depend on the unit used in the input DTM);
-$dest.loc.w.cost: copy of the input destination location(s) dataset with a new variable ('cost') added.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | data(volc) # load a sample Digital Terrain Model
data(volc.loc) # load a sample start location on the above DTM
data(destin_loc) # load the sample destination locations on the above DTM
# calculate walking-time isochrones based on the on-path Tobler's hiking function,
# setting the time unit to hours and the breaks (isochrones interval) to 0.05 hour;
# also, since destination locations are provided, least-cost paths from the origin to the destination locations will be calculated
# and plotted
res <- moveCost(dtm=volc, origin=volc.loc, destin=destin_loc, funct="t", time="h", outp="r", breaks=0.05)
#To compare two different sets of least-cost paths:
tobler <- moveCost(dtm=volc, origin=volc.loc, destin=destin_loc, funct="t", time="h", outp="r") #use the Tobler's on-path hiking cost function
wheeled <- moveCost(dtm=volc, origin=volc.loc, destin=destin_loc, funct="wcs", outp="r") #use the wheeled-vehicle critical slope cost function
plot(volc)
plot(volc.loc, add=TRUE, pch=20)
plot(destin_loc, add=TRUE, pch=20, col="red")
plot(tobler$LCPs, add=TRUE)
plot(wheeled$LCPs, add=TRUE, col="blue", lty=2)
#Isochrones and least-cost path from a start location on the Etna volcano, using other built-in data:
tobler <- moveCost(dtm=etna, origin=etna_start, destin=etna_stop, funct="t", time="h", outp="r")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.