extract: Extracts values at points from a list of files

Description Usage Arguments Note Author(s) See Also

Description

Overlays and extracts values at points from a list of raster layers defined as file names (e.g. GeoTiffs). Extends the extract function from the raster package. Especially suitable for extracting values of a large list of rasters that have not been organized into a mosaick (a virtual stack), for example a list of Landsat scenes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'SpatialPoints,character'
extract(x, y, 
   path=".", ID = "SOURCEID", 
   method = "simple", is.pattern = FALSE, force.projection = TRUE, 
   NAflag = "", show.progress=TRUE, isFactor=FALSE, ...)
## S4 method for signature 'SpatialPointsDataFrame,character'
extract(x, y, 
   path = ".", ID = "SOURCEID", 
   method = "simple", is.pattern = FALSE, force.projection = TRUE, 
   NAflag = "", show.progress=TRUE, isFactor=FALSE, ...)

Arguments

x

object of class "SpatialPoints*"

y

character; list of files that can be read using the raster function

path

optional working directory where the files are stored

ID

character; column name for the unique identifier (if object is of class "SpatialPoints" "SOURCEID" column is automatically generated)

method

character; resampling method (see raster::extract)

is.pattern

logical; specifies whether the list is a pattern

force.projection

logical; specifies whether the reprojection should be ignored

NAflag

character; missing value flag (all missing values are removed by default)

show.progress

logical; specifies whether to display the progress bar

isFactor

logical; turns aggregation on off for factor type variable

...

additional arguments that can be passed to the raster::extract function

Note

The method will try to reproject the values to the native coordinate system, hence it is highly advisible to embed the proj4 string into the GeoTiffs. If both x and y are in the same coordinate system, then reprojection can be turned off by setting force.projection = FALSE. In the case is.pattern = TRUE (search by pattern), missing values are removed by default and if multiple rasters covering the same area are found, values are aggregated to the mean value.

Author(s)

Tomislav Hengl

See Also

raster::extract, warp


GSIF documentation built on May 2, 2019, 5:44 p.m.

Related to extract in GSIF...