Learn R Programming

⚠️There's a newer version (1.1.0) of this package.Take me there.

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

322

Version

1.0.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Annie Smith

Last Published

April 8th, 2022

Functions in geodiv (1.0.5)

height_ba

Value of the Bearing Area Curve at a Specified Value
ssk

Calculates the Skewness of Raster Values
plot_ba_curve

Plots the Bearing Area Curve
sk

Core Roughness Depth
pad_edges

Extend edges of a matrix.
simpsons

Simpson's Rule Empirical Area Under a Curve
ssc

Mean Summit Curvature
bestfitplane

Finds the Best Fit Polynomial Surface
normforest

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

NDVI for a portion of southwestern Oregon, USA.
orelevation

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

Calculate the fractal dimension of a raster.
sbi

Surface Bearing Index
focal_metrics

Calculate Texture Metrics per Pixel
flatsa

Flattened Surface Area
findpeaks

Find Local Peaks
rotate

Rotates a matrix 180 degrees.
find_flat

Finds the Flattest Part of the Bearing Area Curve
remove_plane

Removes the Best Fit Polynomial Surface
sdr

Surface Area Ratio
sph

Calculates the Maximum Peak Height of a Surface Image
svi

Valley Fluid Retention Index
sds

Summit Density
spk

Reduced Peak Height
svk

Reduced Valley Depth
s10z

Ten-Point Height
sci

Core Fluid Retention Index
sfd_

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

Determines the Slopes Along the Bearing Area Curve
sku

Calculates the Kurtosis of Raster Values
scl

Calculate Correlation Length
findvalleys

Find Local Valleys
sdq

Root Mean Square Slope of Surface
sdc

Height Intervals of the Bearing Area Curve
sdq6

Root Area Mean Square Slope of Surface
fitplane

Calculate a Least Squares Polynomial Surface
sa

Calculates the Average Roughness of a Surface
std

Texture Direction Metrics
sq

Calculates the Root Mean Square Roughness of a Surface
srw

Radial Wavelength Metrics
slopemeans

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

Calculate Texture Metric for Single Pixel
texture_image

Calculate Texture Metrics per Pixel
stxr

Estimate Texture Aspect Ratio
zshift

Offset Raster or Matrix Values
smean

Calculates the Mean Peak Height of a Surface Image
sv

Calculates the Maximum Valley Depth of a Surface Image
surface_area

Surface Area
.calculate_met_focal

Calculate Texture Metric for Single Pixel
.mindist

Estimate Minimum Correlation Length
.deg2rad

Degree to Radian Conversion
area_above

Area Above the Bearing Area Curve
aacf

Estimate the Areal Autocorrelation Function
bearing_area

Calculates the Rotated Bearing Area Curve
.rad2deg

Radian to Degree Conversion
.maxdist

Estimate Maximum Correlation Length
fftshift

Fourier Transform Shift