movenetw | R Documentation |
The function provides the facility to calculate LCPs between multiple origins.
Two types of networks are produced: one where each origin location is connected to all the others locations; one where
only pairs of neighboring locations are connected. In other words, in the latter case, each location is connected to the location that is the
nearest in terms of walking cost, either in terms of time or energy (or abstract cost), according to the selected cost function.
Optionally, a raster representing the density of the first type of network can be produced.
Visit this LINK to access the package's vignette.
movenetw(
dtm = NULL,
origin,
netw.type = "allpairs",
studyplot = NULL,
barrier = NULL,
plot.barrier = FALSE,
irregular.dtm = FALSE,
funct = "t",
move = 16,
field = 0,
cogn.slp = FALSE,
sl.crit = 10,
W = 70,
L = 0,
N = 1,
V = 1.2,
z = 9,
lcp.dens = FALSE,
transp = 0.5,
export = FALSE
)
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 |
locations from which the network of least-cost paths is calculated (SpatialPointsDataFrame class). |
netw.type |
type of network to be calculated: 'allpairs' (default) or 'neigh' (see 'Details'). |
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 |
irregular.dtm |
TRUE or FALSE (default) if the input DTM features irregular margins (see |
funct |
cost function to be used (for details on each of the following, see -functions for wheeled-vehicles- -functions expressing abstract cost- -functions expressing cost as metabolic energy expenditure- |
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 coinciding with the barrier (0 by default) (see |
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 |
lcp.dens |
TRUE or FALSE (default) if the user wants or does not want the least-cost paths density raster to be produced. |
transp |
set the transparency of the slopeshade raster that is plotted over the DTM (0.5 by default). |
export |
TRUE or FALSE (default) if the user wants or does not want the LCPs network to be exported as a shapefile, and the LCPs network density as a GeoTiff; the DTM is exported only if it was not provided by the user and downloaded by the function from online sources. |
Like movecost()
, the function just requires an input DTM ('RasterLayer' class) and an origin dataset ('SpatialPointsDataFrame' class).
If a DTM is not provided, movenetw()
downloads elevation data from online sources for the area enclosed by the polygon fed via
the studyplot
parameter (see movecost
for more details). Under the hood, movenetw()
relies on movecost()
and implements the same cost functions:
see the help documentation of movecost()
for further information.
movenetw()
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 LPCs network ('SpatialLinesDataFrame' class) is represented by black lines.
To calculate the network connecting all the locations, the user may want to set the netw.type
parameter to allpairs
(which is the default value).
If the user wants to calculate the network connecting neighbouring locations, the netw.type
parameter is to be set to neigh
.
Optionally, by setting the lcp.dens
parameter to TRUE
, the function produces a raster representing the density of the LCPs connecting each location to all the
other locations. The raster, which is rendered overlaid to a slopeshade visualization, expresses the density of LCPs as percentages.
The percentages are calculated in relation to the maximum number of LCPs passing through the same cell stored in the raster.
A density raster expressing counts is NOT rendered BUT is returned by the function. The density raster retains the cell size and coordinate system of the input DTM.
The function returns a list storing the DTM (only in case this has not been fed into the function but acquired online), a list of LCPs
split by origin, a SpatialLineDataFrame representing the merged LCPs, two rasters representing the LCPs network density
expressed as counts and percentages respectively, and cost matrices. As for the latter, if the selected cost function defines cost as
walking time, two matrices are returned, one expressing time in minutes, one in hours (note that the values are in decimal format).
If the selected cost function expresses cost differently (i.e., energy or abstract cost), the two above mentioned cost matrices will be set to NULL,
and a third cost matrix will store all the pair-wise costs.
The above mentioned data (DTM, LCPs, network density) can be exported by setting the export
parameter to TRUE
. The LCPs network (exported as a shapefile)
and the density raster (as a GeoTiff) will bear a suffix indicating the used cost function.
The function returns a list storing the following components
dtm: Digital Terrain Model ('RasterLayer' class); returned only if acquired online
LCPs.netw: list containing the LCPs ('SpatialLinesDataFrame' class) split by origin
LCPs.netw.merged: 'SpatialLinesDataFrame' corresponding to the merged LCPs
LCPs.netw.neigh: list containing the LCPs between neighboring locations ('SpatialLinesDataFrame' class) split by origin
LCPs.netw.merged: 'SpatialLinesDataFrame' corresponding to the merged LCPs between neighboring locations
LCPs.density.count: raster ('RasterLayer' class) representing the counts of LCPs on each raster's cell
LCPs.density.perc: same as the preceding, but re-expressing the counts as percentages
cost.matrix.min: matrix of cost between locations, expressing cost in minutes
cost.matrix.hr: matrix of cost between locations, expressing cost in hours
cost.matrix: matrix of cost between locations, expressing cost either in energy or abstract cost, depending on the used cost function
movecost
# load a sample Digital Terrain Model
data(volc)
# load the sample destination locations on the above DTM
data(destin.loc)
# calculate the least-cost path network between neighboring locations
# using the Tobler's hiking function (for on-path walking)
result <- movenetw(dtm=volc, origin=destin.loc, move=8, funct="t", netw.type="neigh")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.