TIN.raster: Function to interpolate a TIN to a raster.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/TIN.raster.R

Description

This function transforms irregular-spaced data into a grid-spaced form, i.e. a raster object. Currently there are two interpolation methods available: linear interpolation and thin plate spline interpolation (see below).

Usage

1
TIN.raster(TIN, resolution, method = "lin", theta)

Arguments

TIN

(numeric matrix) TIN, created by read.TIN, i.e. a matrix with m nodes, each represented by its x-y-z-coordinate.

resolution

(numeric scalar) Target resolution of the raster data set to be created. If not specified, the mean node spacing is used.

method

(character scalar) Interpolation method, currently one out of "lin" (linear interpolation), "cub" (cubic spline interpolation) and "tps" (thin plate spline interpolation), default is "lin".

theta

Optional value for TPS-mode, specifies tapering range. Default value is 10 times the target resolution.

Value

A raster object with interpolated elevation data.

Author(s)

Michael Dietze

References

CSDMS website. http://csdms.colorado.edu/wiki/Model:CHILD.
Tucker, GE. 2010. CHILD Users Guide for version R9.4.1. http://csdms.colorado.edu/mediawiki/images/Child_users_guide.pdf
Tucker, GE., Lancaster, ST., Gasparini, NM., Bras, RL. 2001. The Channel-Hillslope Integrated Landscape Development (CHILD) Model. In Harmon, RS., Doe, W.W. III (eds). Landscape Erosion and Evolution Modeling. Kluwer Academic/Plenum Publishers, pp. 349-388.

See Also

read.TIN, write.raster

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# load example data set
data(hillslope1)

# extract TIN of timestep 10 and show first 5 elements
TIN10 <- read.TIN(hillslope1, timestep = 10)
TIN10[1:5,]

# interpolate TIN to raster by different methods
DEM10lin <- TIN.raster(TIN10, resolution = 5)
DEM10tps <- TIN.raster(TIN10, resolution = 5, method = "tps")

# plot differences between data sets
DEM10diff <- DEM10lin - DEM10tps
plot(DEM10diff)

coffeemuggler/RCHILD documentation built on Dec. 31, 2020, 10:05 p.m.