Title: | Calculate Surface/Image Texture Indexes |
---|---|
Description: | Methods for the computation of surface/image texture indices using a geostatistical based approach (Trevisani et al. (2023) <doi:10.1016/j.geomorph.2023.108838>). It provides various functions for the computation of surface texture indices (e.g., omnidirectional roughness and roughness anisotropy), including the ones based on the robust MAD estimator. The kernels included in the software permit also to calculate the surface/image texture indices directly from the input surface (i.e., without de-trending) using increments of order 2. It also provides the new radial roughness index (RRI), representing the improvement of the popular topographic roughness index (TRI). The framework can be easily extended with ad-hoc surface/image texture indices. |
Authors: | Sebastiano Trevisani [aut, cre]
|
Maintainer: | Sebastiano Trevisani <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1.1 |
Built: | 2025-03-06 11:22:45 UTC |
Source: | https://github.com/strevisani/surfrough |
The input is represented by four rasters with the spatial variability index (e.g., MAD, variogram, etc.) computed in four directions (N-S, NE-SW, E-W, SE-NW)
anisoDir(N, NE, E, SE)
anisoDir(N, NE, E, SE)
N |
Spatial variability along N-S direction |
NE |
Spatial variability along NE-SW direction |
E |
Spatial variability along E-W direction |
SE |
Spatial variability along SE-NW direction |
A raster with the direction (in degrees, geographical) of maximum continuity
The input is represented by a list of rasters with the spatial variability index (e.g., MAD, variogram, etc.) computed in four directions (N-S, NE-SW, E-W, SE-NW)
anisoDirL(x)
anisoDirL(x)
x |
A list of rasters with the spatial variability along 4 directions (see function anisoDir()) |
A raster with the direction (in degrees, geographical) of maximum continuity
The input is represented by four rasters with the spatial variability index (e.g., MAD, variogram, etc.) computed in four directions (N-S, NE-SW, E-W, SE-NW)
anisoR(N, NE, E, SE)
anisoR(N, NE, E, SE)
N |
Spatial vairability along N-S direction |
NE |
Spatial vairability along NE-SW direction |
E |
Spatial vairability along E-W direction |
SE |
Spatial vairability along SE-NW direction |
A raster with the index of anisotropy (min=0 max=1)
The input is represented by a list of rasters with the spatial variability index (e.g., MAD, variogram, etc.) computed in four directions (N-S, NE-SW, E-W, SE-NW)
anisoRL(x)
anisoRL(x)
x |
A list of rasters with the spatial variability along 4 directions (see function anisoR()) |
A raster with the index of anisotropy (min=0 max=1)
With this you can compute variogram and madogram (but remember that for classical geostatistical indexes you need to divide the derived isotropic index by 2!)
CalcMeans(deltas, w, exponent)
CalcMeans(deltas, w, exponent)
deltas |
The values from which calculate the median of absolute values (i.e., directional differences of order K) |
w |
The moving window used (e.g. w=KernelCircular(3)) |
exponent |
The exponent: increasing the exponent increase the sensitivity to outliers. Set 2 for Variogram and 1 for Madogram. |
A raster with the mean of absolute values in the search window
Calculate the median of absolute values found in a search window for each raster in a list
CalcMedians(deltas, w)
CalcMedians(deltas, w)
deltas |
A list of rasters with the values from which calculate the median of absolute values (e.g., directional differences of order K) |
w |
The moving window used (e.g. w=KernelCircular(3)) |
A list of rasters with the median of absolute values in the search window
Compute circular variance of aspect (i.e. of the gradient vector)
circularDispersionGV(inraster, window)
circularDispersionGV(inraster, window)
inraster |
The DEM from which compute the index |
window |
The moving window adopted for computing the index |
The raster with the computed index
# Gradient vector dispersion using a circular search window of radius 3. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) roughGrad=circularDispersionGV(dem,w) plot(roughGrad)
# Gradient vector dispersion using a circular search window of radius 3. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) roughGrad=circularDispersionGV(dem,w) plot(roughGrad)
Compute circular variance of normal vectors to surface, using the resultant vector length
circularDispersionNV(inraster, window)
circularDispersionNV(inraster, window)
inraster |
The DEM from which compute the index |
window |
The moving window adopted for computing the index |
The raster with the computed index
# #Normal vector dispersion using a circular search window of radius 3. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) roughVDR=circularDispersionNV(dem,w) plot(roughVDR)
# #Normal vector dispersion using a circular search window of radius 3. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) roughVDR=circularDispersionNV(dem,w) plot(roughVDR)
Compute circular variance of normal vectors to surface, using the eigen values (only for testing, very slow)
circularEigenNV(inraster, window)
circularEigenNV(inraster, window)
inraster |
The DEM from which compute the index |
window |
The moving window adopted for computing the index |
The raster with the computed index
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k05ck2
k05ck2
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k1c
k1c
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k1ck2
k1ck2
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k2c
k2c
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k2ck2
k2ck2
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k4c
k4c
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k6c
k6c
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Kernels for computing directional differences for specific directions and lag distances. These have been constructed using bilinear interpolation for directions out of main axes. The kernels are intended to be used with "Terra" focal functions (i.e., convolution).
k8c
k8c
just matrices.
Sebastiano Trevisani
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
#to see kernels (each one is a list with 4 kernels) of order 1 #These should be used with a detrended "surface" #lag 1 pixel k1c #lag 2 pixels k2c #lag 4 pixels k4c #lag 6 pixels k6c #lag 8 pixels k8c #kernels of order 2 (differences of differences) #these can be applied directly without detrending #lag 05 pixel k05ck2 #lag 1 pixel k1ck2 #lag 2 pixels k2ck2
Build a circular moving window
KernelCircular(radius)
KernelCircular(radius)
radius |
The radius of the moving window |
A matrix with selected pixels
#A circular moving window with a radius of 3 pixels w=KernelCircular(3) w
#A circular moving window with a radius of 3 pixels w=KernelCircular(3) w
Build a rectangular kernel of size X x Y
KernelRectangular(lenx, leny)
KernelRectangular(lenx, leny)
lenx |
The size in pixels along x |
leny |
The size in pixels along y |
The matrix (square/rectangular) with the selected pixels
#A rectangular moving window 5x5 pixels w=KernelRectangular(5,5) w
#A rectangular moving window 5x5 pixels w=KernelRectangular(5,5) w
Calculate MAD basic indexes considering a specif lag and difference of order K. It computes 3 indexes of roughness/image texture: isotropic/omnidirectional; direction of maximum continuity; anisotropy index. The anisotropy index is based on vector dispersion approach: 0 minimum anisotropy; 1 maximum anisotropy. The direction of anisotropy is in degrees according to geographical convention.
Madscan(inRaster, kernels, w)
Madscan(inRaster, kernels, w)
inRaster |
The DEM/residual-dem from which to compute the indexes |
kernels |
The kernels to be used for computing the directional differences (e.g. order 1 or 2 for various lags) |
w |
The moving window adopted for computing the geostatistical index (i.e., MAD) |
A list of 3 rasters: 1)isotropic roughness; 2) direction of anisotropy;3)index of anisotropy.
Trevisani, S. & Rocca, M. 2015. MAD: Robust image texture analysis for applications in high resolution geomorphometry. Computers and Geosciences, vol. 81, pp. 78-92.
Trevisani, S. Teza, G., Guth, P., 2023. A simplified geostatistical approach for characterizing key aspects of short-range roughness. CATENA,Volume 223, ISSN 0341-8162,https://doi.org/10.1016/j.catena.2023.106927
# MAD for lag 2 with differences of order 2 using a circular search window of radius 3. # Using differences of order 1, you should # apply these on a detrended surface/image. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) rough2c=Madscan(dem,k2ck2, w) #Plot isotropic roughness plot(rough2c$IsoRough) #Plot anisotropy index/strenght plot(rough2c$AnisoR)
# MAD for lag 2 with differences of order 2 using a circular search window of radius 3. # Using differences of order 1, you should # apply these on a detrended surface/image. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) rough2c=Madscan(dem,k2ck2, w) #Plot isotropic roughness plot(rough2c$IsoRough) #Plot anisotropy index/strenght plot(rough2c$AnisoR)
With this you can compute variogram and madogram (but remember that for classical geostatistical indexes you need to divide the derived isotropic index by 2!). Moreover you can calibrate the exponent in order to filter or enhance hotspots and discontinuities
Meanscan(inRaster, kernels, w, exponent)
Meanscan(inRaster, kernels, w, exponent)
inRaster |
The DEM/residual-dem from which to compute the indexes |
kernels |
The kernels to be used for computing the directional differences (e.g. order 1 or 2 for various lags) |
w |
The moving window adopted for computing the geostatistical index (i.e., MAD) |
exponent |
The exponent: increasing the exponent increase the sensitivity to outliers. Set 2 for Variogram and 1 for Madogram. |
A SpatRaster with 3 layers: 1)isotropic roughness; 2) direction of anisotropy; 3)index of anisotropy.
#' Variogram-like for lag 2 with differences of order 2 using a circular search window of radius 3. # Using differences of order 1, you should # apply these on a detrended surface/image. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) rough2c=Meanscan(dem,k2ck2, w,2) #(divide by two if you need classical estimator) plot(rough2c$IsoRough)
#' Variogram-like for lag 2 with differences of order 2 using a circular search window of radius 3. # Using differences of order 1, you should # apply these on a detrended surface/image. library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w=KernelCircular(3) rough2c=Meanscan(dem,k2ck2, w,2) #(divide by two if you need classical estimator) plot(rough2c$IsoRough)
Modified TRI, based on increments of order 2 (reducing/removing slope dependence) and correcting for diagonal distance. RRI modifies TRI (topographic ruggedness index) using increments of order 2, symmetrical to the central pixel, so as to reduce/remove the effect of local slope. This version corrects for the diagonal distance using bilinear interpolation. It uses a 5x5 kernel, consequently 12 directional differences of order k (2) are used in the estimation. One could also use a 3x3 kernel using only the 4 differences centered on the central pixel but the metric would be very noisy. The input is the DEM (no need to detrend).
RRI(x, ...) ## S3 method for class 'numeric' RRI(x, ...) ## S3 method for class 'SpatRaster' RRI(x, ..., .method = c("rcpp", "r"))
RRI(x, ...) ## S3 method for class 'numeric' RRI(x, ...) ## S3 method for class 'SpatRaster' RRI(x, ..., .method = c("rcpp", "r"))
x |
A DEM 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 |
isotropic roughness (in the same units of input)
Riley, S. J., S. D. DeGloria, and R. Elliott. 1999. A terrain ruggedness index that quantifies topographic heterogeneity. Intermountain Journal of Science 5:23.
Wilson, M.F.J., O'Connell, B., Brown, C., Guinan, J.C. & Grehan, A.J. 2007. Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope". Marine Geodesy, vol. 30, no. 1-2, pp. 3-35.
Trevisani S., Teza G., Guth P.L., 2023. Hacking the topographic ruggedness index. Geomorphology https://doi.org/10.1016/j.geomorph.2023.108838
library(terra) dem= rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w <- matrix(1, nrow=5, ncol=5) roughRRI_v1=focal(dem, w=w, fun=RRI) roughRRI_v2=RRI(dem) plot(c(roughRRI_v1, roughRRI_v2))
library(terra) dem= rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w <- matrix(1, nrow=5, ncol=5) roughRRI_v1=focal(dem, w=w, fun=RRI) roughRRI_v2=RRI(dem) plot(c(roughRRI_v1, roughRRI_v2))
Extension of RRI using differences of order 3 Accordingly, this version filters out a trend of order 2, so it reduces still more the dependence on slope and partially on curvature. The input is the DEM (no need to detrend).
RRIK3(x, ...) ## S3 method for class 'numeric' RRIK3(x, ...) ## S3 method for class 'SpatRaster' RRIK3(x, ..., .method = c("rcpp", "r"))
RRIK3(x, ...) ## S3 method for class 'numeric' RRIK3(x, ...) ## S3 method for class 'SpatRaster' RRIK3(x, ..., .method = c("rcpp", "r"))
x |
A DEM 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 |
isotropic roughness (in the same units of input)
Trevisani S., Teza G., Guth P.L., 2023. Hacking the topographic ruggedness index. Geomorphology https://doi.org/10.1016/j.geomorph.2023.108838
library(terra) dem= rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) roughRRIK3=RRIK3(dem) plot(roughRRIK3)
library(terra) dem= rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) roughRRIK3=RRIK3(dem) plot(roughRRIK3)
It is essentially a radial roughness index. TRIk2 modifies TRI (topographic ruggedness index) using increments of order 2, symmetrical to central pixel, so as to remove/reduce the effect of local slope. This version does not correct for diagonal distance and therefore is mainly for testing/simulation purposes, so in practice the Radial Roughness Index calculated by the RRI function should be used instead. It uses a 5x5 kernel, consequently 12 directional differences of order k (2) are used in the estimation. One could also use a 3x3 kernel using only the 4 differences centered on the central pixel but the metric would be very noisy. The input is the DEM (no need to detrend).
Trik2(x)
Trik2(x)
x |
A DEM as a SpatRaster or a vector of numeric values from a focal window in a DEM from which to compute the index |
isotropic roughness (in the same units of input)
Riley, S. J., S. D. DeGloria, and R. Elliott. 1999. A terrain ruggedness index that quantifies topographic heterogeneity. Intermountain Journal of Science 5:23.
Wilson, M.F.J., O'Connell, B., Brown, C., Guinan, J.C. & Grehan, A.J. 2007. Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope". Marine Geodesy, vol. 30, no. 1-2, pp. 3-35.
Trevisani S., Teza G., Guth P.L., 2023. Hacking the topographic ruggedness index. Geomorphology https://doi.org/10.1016/j.geomorph.2023.108838
library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w <- matrix(1, nrow=5, ncol=5) roughTrik5x5_v1=focal(dem, w=w, fun=Trik2) roughTrik5x5_v2=Trik2(dem) plot(c(roughTrik5x5_v1,roughTrik5x5_v2))
library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w <- matrix(1, nrow=5, ncol=5) roughTrik5x5_v1=focal(dem, w=w, fun=Trik2) roughTrik5x5_v2=Trik2(dem) plot(c(roughTrik5x5_v1,roughTrik5x5_v2))
It is essentially a radial roughness index. TRIk2 modifies TRI (topographic ruggedness index) using increments of order 2, symmetrical to central pixel, so as to remove the effect of local slope. This version does not correct for diagonal distance and therefore is mainly for testing/simulation purposes, so in practice the Radial Roughness Index calculated by the RRI function should be used instead. It uses a 5x5 kernel, consequently 12 directional differences of order k (2) are used in the estimation. One could also use a 3x3 kernel using only the 4 differences centered on the central pixel but the metric would be very noisy. The input is the DEM (no need to detrend).
## S3 method for class 'numeric' Trik2(x)
## S3 method for class 'numeric' Trik2(x)
x |
A vector of numeric values from a focal window in a DEM from which to compute the index |
isotropic roughness (in the same units of input)
Riley, S. J., S. D. DeGloria, and R. Elliott. 1999. A terrain ruggedness index that quantifies topographic heterogeneity. Intermountain Journal of Science 5:23.
Wilson, M.F.J., O'Connell, B., Brown, C., Guinan, J.C. & Grehan, A.J. 2007. Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope". Marine Geodesy, vol. 30, no. 1-2, pp. 3-35.
Trevisani S., Teza G., Guth P.L., 2023. Hacking the topographic ruggedness index. Geomorphology https://doi.org/10.1016/j.geomorph.2023.108838
library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w <- matrix(1, nrow=5, ncol=5) roughTrik5x5=focal(dem, w=w, fun=Trik2) plot(roughTrik5x5)
library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) w <- matrix(1, nrow=5, ncol=5) roughTrik5x5=focal(dem, w=w, fun=Trik2) plot(roughTrik5x5)
It is essentially a radial roughness index. TRIk2 modifies TRI (topographic ruggedness index) using increments of order 2, symmetrical to central pixel, so as to reduce/remove the effect of local slope. This version does not correct for diagonal distance and therefore is mainly for testing/simulation purposes, so in practice the Radial Roughness Index calculated by the RRI function should be used instead. It uses a 5x5 kernel, consequently 12 directional differences of order k (2) are used in the estimation. One could also use a 3x3 kernel using only the 4 differences centered on the central pixel but the metric would be very noisy. The input is the DEM (no need to detrend).
## S3 method for class 'SpatRaster' Trik2(x)
## S3 method for class 'SpatRaster' Trik2(x)
x |
A DEM as a SpatRaster or a vector of numeric values from a focal window in a DEM from which to compute the index |
isotropic roughness (in the same units of input)
Riley, S. J., S. D. DeGloria, and R. Elliott. 1999. A terrain ruggedness index that quantifies topographic heterogeneity. Intermountain Journal of Science 5:23.
Wilson, M.F.J., O'Connell, B., Brown, C., Guinan, J.C. & Grehan, A.J. 2007. Multiscale terrain analysis of multibeam bathymetry data for habitat mapping on the continental slope". Marine Geodesy, vol. 30, no. 1-2, pp. 3-35.
Trevisani S., Teza G., Guth P.L., 2023. Hacking the topographic ruggedness index. Geomorphology https://doi.org/10.1016/j.geomorph.2023.108838
library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) roughTrik5x5=Trik2(dem) plot(roughTrik5x5)
library(terra) dem=rast(paste(system.file("extdata", package = "SurfRough"), "/trento1.tif",sep="")) roughTrik5x5=Trik2(dem) plot(roughTrik5x5)