sf_to_rast: sf to raster interpolation

View source: R/sf_to_rast.R

sf_to_rastR Documentation

sf to raster interpolation

Description

Function for computing a continuous raster map from a sf object by interpolating the sf values. For the interpolation Inverse Distance Weighting (IDW) is beeing used.

Usage

sf_to_rast(
  observer,
  v,
  aoi = NULL,
  max_distance = Inf,
  n = Inf,
  beta = 2,
  raster_res = NULL,
  spacing = raster_res,
  na_only = FALSE,
  cores = 1,
  progress = FALSE
)

Arguments

observer

object of class sf; Observer location(s) used for the interpolation. See ‘Details’ for valid sf geometry types

v

character; Name of a variable in observer which values are used for the interpolation

aoi

optional; object of class sf; Area of interest the raster map should me masked to. If NULL, the bounding box of observer will be used instead

max_distance

numeric; Only observer locations within the buffer distance from the prediction location are used for interpolation

n

numeric; Number of nearest observer locations that should be used for the interpolation

beta

numeric; Inverse istance power, β, determines the degree to which the nearer observer locations are preferred over more distant points

raster_res

numeric; Resolution of the interpolatet raster map that is returned

spacing

optional; numeric; Only if observer is a linestring (or polygon), points on the line (or on a grid) will be generated. The spacing parameter sets the distance in between the points on the line/grid

cores

numeric; The number of cores to use, i.e. at most how many child processes will be run simultaneously

progress

logical; Show progress bar?

Details

observer needs to be a geometry of type POINT, LINESTRING, MULTILINESTRING, POLYGON or MULTIPOLYGON. If observer is a LINESTRING or MULTILINESTRING, points will be generated along the line(s) every raster_res meters. If observer is a POLYGON or MULTIPOLYGON, a grid with resolution = raster_res will be generated as the obersver locations. The CRS (st_crs) needs to have a metric unit!

Value

object of class rast


STBrinkmann/GVI documentation built on March 11, 2024, 3:39 p.m.