extract {GSIF} | R Documentation |
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.
## 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, ...)
x |
object of class |
y |
character; list of files that can be read using the |
path |
optional working directory where the files are stored |
ID |
character; column name for the unique identifier (if object is of class |
method |
character; resampling method (see |
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 |
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.
Tomislav Hengl
raster::extract
, warp