Description Usage Arguments Examples
This function runs the Fast Hiking Method from sp and raster objects and outputs results in the same formats, making it more convenient for (geo)spatial analyses and simulation. Output arrival time is in hours.
1 | spFastHike(dem, seeds, spatial.res, fun = "Tobler", verbose = T)
|
dem |
A |
seeds |
A |
spatial.res |
(Optional) Spatial resolution of the raster in metres. Defaults to that of the raster used. |
fun |
(Optional) Hiking function to use, See hiking.speed for details. |
verbose |
(Optional) Boolean to control verbose output. |
1 2 3 4 5 6 7 8 9 10 | library(raster); library(sp); library(rgdal)
domain <- raster(system.file("external/test.grd", package="raster")) # sample raster
coords <- cbind(c(179000,181200), c(330000, 333000)) # coordinates for seeds
seed.df <- data.frame(Id= c(1,2), incept=c(0,0)) # parameters for each seed
seeds <- SpatialPointsDataFrame(coords, seed.df, proj4string=crs(domain))
fh <- spFastHike(domain, seeds, verbose=FALSE)
par(mfrow=c(1,2), mar=c(1,1,1,3))
plot(domain); contour(fh$arrival.time, levels=seq(0.1,.5,0.2), add=TRUE)
plot(fh$process); contour(fh$arrival.time, levels=seq(0.1,.5,0.2), add=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.