extractRasterTrack: Extracts corresponding raster values for GPS tracks.

Description Usage Arguments Value See Also Examples

View source: R/extractRasterTrack.R

Description

extractRasterTrack is the extract method in order to extract values from Raster* objects for an object of class Track. Different options are available.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
extractRasterTrack(
  x,
  y,
  datetime = NULL,
  method = "simple",
  buffer = 0,
  small = TRUE,
  fun = NULL,
  na.rm = TRUE,
  fixedlocationcoords = FALSE
)

Arguments

x

A Raster* object. x must either have one layer or the number of layers of x has to be the same as the number of data values in y. If a multi-layer object is provided, it is automatically assumed that this is the case.

y

A Track object. Depending on other parameters set, there may be certain variables required.

datetime

A POSIXct vector with a date (day) for each layer in x.

method

A character value. "simple" or "bilinear". If "simple" values for the cell a point falls in are returned. If "bilinear" the returned values are interpolated from the values of the four nearest raster cells.

buffer

A numeric value indicating the radius of the buffer around each point that should be considered during extraction of the raster values. If the data are not projected (latitude/longitude), the unit should be meters. Otherwise it should be in map-units (typically also meters).

small

logical. If TRUE and a buffer argument is used, the function always returns a number, also when the buffer does not include the center of a single cell. The value of the cell in which the point falls is returned if no cell center is within the buffer.

fun

function to summarize the values (e.g. mean). The function should take a single numeric vector as argument and return a single value and accept a na.rm argument.

na.rm

logical. Only useful when an argument fun is supplied. If na.rm = TRUE (the default value), NA values are removed before fun is applied. This argument may be ignored if the function used has a ... argument and ignores an additional na.rm argument.

fixedlocationcoords

A logical value indicating if for each location in y the same position is assumed for all data values. In this case, computation can be speed up by setting location = TRUE and the function uses simply the coordinates of the first value for each location.

Value

A vector with a value for each data value of currenttrack. If a value of raster cannot be assigned to a respective data value, NA is returned for the respective data value.

See Also

extractPolygonsTrack, extractRasterTracks.

Examples

1
#

henningte/herdersTA documentation built on Jan. 22, 2020, 5:16 a.m.