Interpolate ground points and return the elevation at the position of interest given by the
user. The interpolation can be done using 3 methods: "knnidw"
,
"akima"
or "kriging"
(see details). The algorithm uses the points classified as "ground" to
compute the interpolation.
lasterrain(.las, coord, method, k = 6L, linear = TRUE,
model = gstat::vgm(0.59, "Sph", 874))
LAS objet
data.frame containing the coordinates of interest in columns X and Y
character can be "knnidw"
, "akima"
or "kriging"
(see details)
numeric. number of k nearest neibourgh when selected method is "knnidw"
logical indicating wether linear or spline interpolation should be used
when selected method is "akima"
a variogram model computed with vgm when selected method is
"kriging"
Numeric. The predicted elevations.
knnidw
Interpolation is done using a k-nearest neighbour (KNN) approach with an inverse distance weighting (IDW). This is a very fast but also basic method for spatial data interpolation.
akima
Interpolation depends on the interp function from
package akima
. This method is relatively fast and more advanced than knnidw
and provides
good digital terrain models. Notice that with this method no extrapolation is done outside of
the convex hull determined by the ground points.
kriging
Interpolation is done by universal kriging using krige function. This method is very slow and very difficult to manipulate but it is also the most regognized method to interpolate spatial data.