rwPerformance: Random walk runout path performance

View source: R/randomwalk_performance.R

rwPerformanceR Documentation

Random walk runout path performance

Description

Computes the area under the receiver operating characteristic curve (AUROC) for runout paths simuluated using the random walk model component of the GPP tool in SAGA-GIS. The AUROC compares a runout polygon to the simulated path.

Usage

rwPerformance(
  dem,
  slide_plys,
  slide_src,
  slide_id = 2,
  slp = 33,
  ex = 3,
  per = 2,
  gpp_iter = 1000,
  buffer_ext = 500,
  buffer_source = NULL,
  plot_eval = FALSE,
  saga_lib = NULL
)

Arguments

dem

A DEM as a RasterLayer object

slide_plys

Runout tracks as a SpatialPolygonsDataFrame

slide_src

Source points as a SpatialPointsDataFrame or source areas as a SpatialPolygonsDataFrame

slide_id

Selects a single runout polygon from slide_plys by row to run GPP model

slp

Random walk slope threshold - below lasteral spreading is modelled

ex

Random walk exponent controlling lateral spread

per

Random walk persistence factor to weight flow direction consistency

gpp_iter

Number of model iterations

buffer_ext

(Optional) Defines buffer distance (in meters) around runout polygon to crop source DEM. This helps to reduce computational time

buffer_source

(Optional) Can define a buffer distance (in meters) to extend source point to a source area

plot_eval

logical. If TRUE will plot random walk path and runout polygon

saga_lib

The initiated SAGA-GIS geoprocessor object

Details

Runout source can be either point or area.

Value

The area under the receiver operating characteristic

Examples

## Not run: 
# Initialize a saga object
saga <- Rsagacmd::saga_gis()

# Load elevation model (DEM)
dem <- raster::raster(system.file("extdata/elev_12_5m.tif", package="runout.opt"))

# Load runout polygons and source points
runout_plys <- rgdal::readOGR(system.file("extdata/dflow_runout_ply.shp", package="runout.opt"))
source_pnts <- rgdal::readOGR(system.file("extdata/dflow_source_pnt.shp", package="runout.opt"))

# Run GPP random walk model for a rounout polygon
rw <- rwPerformance(dem, slide_plys = runout_plys[1,], slide_src = source_pnts,
    slp = 30, ex = 3, per = 2,
    gpp_iter = 1000, buffer_ext = 500, buffer_source = 50,
    plot_eval = TRUE, saga_lib = saga)

rw # returns AUROC


## End(Not run)

jngtz/runout.opt documentation built on July 17, 2025, 3:06 a.m.