rsMove (version 0.2.1)

imgInt: imgInt

Description

Temporal linear interpolation of raster data.

Usage

imgInt(img = NULL, rd = rd, td = td, bs = NULL, xy = NULL,
  edata = NULL)

Arguments

img

Object of class RasterStack or RasterBrick.

rd

Raster dates. Object of class Date.

td

Target dates. Object of class Date.

bs

wo element vector with temporal search buffer (expressed in days).

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

edata

Object of class data frame or matrix with remote sensing data.

Value

A RasterBrick or a data frame.

Details

Performs a pixel-wise linear interpolation over a raster for a given set of dates (td). A teporal buffer (bs) is required to limit the search for reference data points (rd). bs is defined by a two element vector which limits the search of images in the past and future. If xy is provided the function only considers the pixels that overlap with the these sample points. Otherwise, a RasterBrick is provided. However, if edata is provided, xy and img are ignored. and a data frame is provided.

See Also

@seealso dataQuery timeDir spaceDir moveSeg

Examples

Run this code
# NOT RUN {
{
 
 require(raster)
 
 #'  # read raster data
 file <- list.files(system.file('extdata', '', package="rsMove"), 'tc.*tif', full.names=TRUE)
 rsStk <- stack(file)
 rsStk <- stack(rsStk, rsStk, rsStk) # dummy files for the example
 
 # read movement data
 moveData <- read.csv(system.file('extdata', 'konstanz_20130805-20130811.csv', package="rsMove"))
 moveData <- SpatialPointsDataFrame(moveData[1:10,1:2], moveData[1:10,], proj4string=crs(rsStk))
 
 # raster dates
 rd = seq.Date(as.Date("2012-01-01"), as.Date("2012-12-31"), 45)
 
 # target dates
 td = as.Date("2012-04-01")
 
 # interpolate raster data to target dates
 i.img <- imgInt(img=rsStk, rd=rd, td=td, bs=c(60,60), xy=moveData)
 
}
# }

Run the code above in your browser using DataCamp Workspace