Learn R Programming

geodiv

geodiv calculates gradient surface metrics in R. These metrics are applied to continuous spatial data (i.e., rasters or matrices) and represent spatial heterogeneity.

Installation

You can install the released version of geodiv from CRAN with:

install.packages("geodiv")

And the development version from GitHub with:

# install.packages("devtools")

# install from master branch
devtools::install_github("bioXgeo/geodiv")

# install from development branch
devtools::install_github("bioXgeo/geodiv",ref = "dev")

On Mac OS X, you may need to install the development tools here to get the package to install:

https://cran.r-project.org/bin/macosx/tools/

Example

This is a basic example which shows you how to calculate several metrics over an entire image. geodiv may also be applied with moving windows over an entire image using the ‘texture_image’ function. For a more complex example, see the vignette.

library(geodiv)

# import example raster
data(normforest)

# apply metrics
sa(normforest) # average surface roughness
#> [1] 0.0442945
svk(normforest) # reduced valley depth
#> [1] 0.5449867
ssc(normforest) # mean summit curvature
#> [1] -0.02192238

Copy Link

Version

Install

install.packages('geodiv')

Monthly Downloads

316

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Annie Smith

Last Published

October 5th, 2023

Functions in geodiv (1.1.0)

remove_plane

Removes the Best Fit Polynomial Surface
sdc

Height Intervals of the Bearing Area Curve
simpsons

Simpson's Rule Empirical Area Under a Curve
stxr

Estimate Texture Aspect Ratio
sdq6

Root Area Mean Square Slope of Surface
sk

Core Roughness Depth
sa

Calculates the Average Roughness of a Surface
orforest

NDVI for a portion of southwestern Oregon, USA.
sdr

Surface Area Ratio
std

Texture Direction Metrics
sdq

Root Mean Square Slope of Surface
ssk

Calculates the Skewness of Raster Values
ssc

Mean Summit Curvature
svi

Valley Fluid Retention Index
sbi

Surface Bearing Index
sci

Core Fluid Retention Index
sfd_

Calculate the fractal dimension of a raster (C function).
sds

Summit Density
svk

Reduced Valley Depth
sfd

Calculate the fractal dimension of a raster.
rotate

Rotates a matrix 180 degrees.
sku

Calculates the Kurtosis of Raster Values
slopemeans

Determines the Average Slope Along Larger Segments of the Bearing Area Curve
slopecalc

Determines the Slopes Along the Bearing Area Curve
sq

Calculates the Root Mean Square Roughness of a Surface
surface_area

Surface Area
sv

Calculates the Maximum Valley Depth of a Surface Image
smean

Calculates the Mean Peak Height of a Surface Image
height_ba

Value of the Bearing Area Curve at a Specified Value
normforest

NDVI errors for a portion of southwestern Oregon, USA.
srw

Radial Wavelength Metrics
zshift

Offset Raster or Matrix Values
plot_ba_curve

Plots the Bearing Area Curve
sph

Calculates the Maximum Peak Height of a Surface Image
spk

Reduced Peak Height
texture_image

Calculate Texture Metrics per Pixel
window_metric

Calculate Texture Metric for Single Pixel
pad_edges

Extend edges of a matrix.
.deg2rad

Degree to Radian Conversion
.calculate_met_focal

Calculate Texture Metric for Single Pixel
bestfitplane

Finds the Best Fit Polynomial Surface
.rad2deg

Radian to Degree Conversion
aacf

Estimate the Areal Autocorrelation Function
area_above

Area Above the Bearing Area Curve
bearing_area

Calculates the Rotated Bearing Area Curve
fftshift

Fourier Transform Shift
.mindist

Estimate Minimum Correlation Length
.maxdist

Estimate Maximum Correlation Length
find_flat

Finds the Flattest Part of the Bearing Area Curve
findpeaks

Find Local Peaks
focal_metrics

Calculate Texture Metrics per Pixel
fitplane

Calculate a Least Squares Polynomial Surface
findvalleys

Find Local Valleys
flatsa

Flattened Surface Area
scl

Calculate Correlation Length
orelevation

SRTM elevation for a portion of southwestern Oregon, USA.
s10z

Ten-Point Height