Learn R Programming

SurfRough (version 0.0.1.2)

TRIbi: TRIbi: TRI with bilinear interpolation along diagonals

Description

TRI is based on DDs of first order (at least in its original definition), however, it does not take into account the different distances between the pixels on the diagonals with respect to the cardinal ones. This version corrects with bilinear interpolation to get the right distance. As TRI, it is a proxy of slope!

Usage

TRIbi(x, ...)

# S3 method for numeric TRIbi(x, ...)

# S3 method for SpatRaster TRIbi(x, ..., .method = c("rcpp", "r"))

Value

TRI (in the same units of input)

Arguments

x

A DEM/image as a SpatRaster or a vector of numeric values from a focal window in a DEM from which to compute the index

...

reserved for future use

.method

Either r or rcpp (fast batch processing using C++)

References

Trevisani S., Teza G., Guth P.L., 2023. Hacking the topographic ruggedness index. Geomorphology, tools:::Rd_expr_doi("doi:10.1016/j.geomorph.2023.108838").

Examples

Run this code
library(terra)
dem= rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep=""))
roughTRIbi=TRIbi(dem)
plot(roughTRIbi)#proxy of slope!

Run the code above in your browser using DataLab