flowpath: Flow path

Description Usage Arguments Value Author(s) Examples

Description

Compute the flow path (drainage path) starting at a given point. See package gdistance for more path computations.

Usage

1
flowPath(x, p, ...)

Arguments

x

RasterLayer of flow direction (as can be created with terrain

p

starting point. Either two numbers: x (longitude) and y (latitude) coordinates; or a single cell number

...

additional arguments (none implemented)

Value

numeric (cell numbers)

Author(s)

Ashton Shortridge

Examples

1
2
3
4
5
6
7
8
data(volcano)
v <- raster(volcano, xmn=2667400, xmx=2668010, ymn=6478700, ymx=6479570, crs="+init=epsg:27200")
fd <- terrain(v, opt = "flowdir")

path <- flowPath(fd, 2407)
xy <- xyFromCell(fd, path)
plot(v)
lines(xy)

Example output

Loading required package: sp

raster documentation built on Jan. 5, 2021, 3:01 a.m.