rfillspgaps: Close gaps of a grid or raster Layer data

View source: R/rfillspgaps.R

rfillspgapsR Documentation

Close gaps of a grid or raster Layer data

Description

The function close gaps of a raster data by using IDW.

Usage

rfillspgaps(rasterLayer,
            maskPol=NULL,
            nmax =50,
            zcol=1,
            ...)

Arguments

rasterLayer

SpatRaster-class, RasterLayer-class, SpatialGrid-class or SpatialPixels-class; Raster that contains NAs.

maskPol

sf-class, SpatVector-class, SpatialPolygons or SpatialPolygonsDataFrame; Area of interest to spatially fill rasterLayer missing values and to mask rasterLayer.

nmax

see krige, idw function.

zcol

integer or character; variable column name or number showing position of a variable in rasterLayer to be interpolated.

...

arguments passed to krige, idw function.

Value

raster object with NA replaced using IDW in rasterLayer format.

Author(s)

Milan Kilibarda kili@grf.bg.ac.rs

References

Kilibarda, M., T. Hengl, G. B. M. Heuvelink, B. Graeler, E. Pebesma, M. Percec Tadic, and B. Bajat (2014), Spatio-temporal interpolation of daily temperatures for global land areas at 1 km resolution, J. Geophys. Res. Atmos., 119, 2294-2313, doi:10.1002/2013JD020803;

Kilibarda M., M. Percec Tadic, T. Hengl, J. Lukovic, B. Bajat - Spatial Statistics (2015), Global geographic and feature space coverage of temperature data in the context of spatio-temporal interpolation, doi:10.1016/j.spasta.2015.04.005.

See Also

rfilltimegaps pred.strk

Examples

   library(terra)
   data(nlmodis20110712)
   data(NLpol)
   
   nlmodis20110712 <- terra::rast(nlmodis20110712)
   # SpaVector
   NLpol = vect(NLpol)
   crs(NLpol) <- "epsg:4326"
   # # sf
   # NLpol <- st_as_sf(NLpol) #, crs = st_crs(4326))
   
   # plot(nlmodis20110712)
   # fill spatial gaps
   r=rfillspgaps(nlmodis20110712,NLpol)
   # plot(r)
  

meteo documentation built on Oct. 14, 2023, 5:07 p.m.