Interpolate points to raster using Inverse-Distance Weighting (IDW)
Source:R/analyze.R
pts_to_rast_idw.RdInterpolate from points to raster using inverse-distance weighting
(terra::interpIDW()). The further the input point from the destination pixel
in the output raster, the less its value is applied. The dimensions of the
output raster are automatically calculated based on approaching 100 pixels in
the maximum dimension (of longitude or latitude) based on the extent of the
area of interest.
Usage
pts_to_rast_idw(
pts,
fld,
aoi,
radius = 1.5,
power = 1.3,
smooth = 0.2,
maxPoints = Inf,
minPoints = 1,
near = FALSE,
fill = NA,
out_tif = NULL,
verbose = F
)Arguments
- pts
input points as simple features
sf::sf- fld
quoted string of field from
ptswith z-value to interpolate- aoi
area of interest as simple features
sf::sf- radius
argument for
terra::interpIDW(); default =1.5- power
argument for
terra::interpIDW(); default =1.3- smooth
argument for
terra::interpIDW(); default =0.2- maxPoints
argument for
terra::interpIDW(); default =Inf- minPoints
argument for
terra::interpIDW(); default =1- near
argument for
terra::interpIDW(); default =FALSE- fill
argument for
terra::interpIDW(); default =NA- out_tif
output path to write raster tif using
terra::writeRaster(); default =NULL- verbose
show messages of all variables used; default = FALSE
Value
terra::rast() object