Description Usage Arguments Value Author(s) Examples
Function used to extract values of a single- or multi- band raster for pixels corresponding to the features of a vector (Polygon, Point or Line)
1 2 3 4 5 |
in_rast |
input raster. Can be wither:
|
in_vect |
input vector object containing zones from which data has to be extracted. Can be either:
|
selbands |
|
rastres |
|
id_field |
|
summ_data |
|
full_data |
|
comp_quant |
|
long |
|
FUN |
|
small |
|
na.rm |
|
maxchunk |
Maximum chunk size (provisional), Default: 5e+06 |
addfeat |
|
addgeom |
|
keep_null |
|
verbose |
|
ncores |
|
out_list list
containing two tibbles: out_list$summ_data
contains summary statitstics,
while out_list$alldata
contains the data of all pixels extracted (see examples).
Lorenzo Busetto, phD (2017) lbusett@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
library(sprawl)
library(sprawl.data)
library(raster)
library(tibble)
in_polys <- read_vect(system.file("extdata","lc_polys.shp", package = "sprawl.data"),
stringsAsFactors = T)
in_rast <- raster::stack(system.file("extdata", "sprawl_EVItest.tif", package = "sprawl.data"))
in_rast <- raster::setZ(in_rast, doytodate(seq(1,366, by = 8), year = 2013))
out <- extract_rast(in_rast, in_polys, verbose = FALSE)
as_tibble(out$stats)
as_tibble(out$alldata)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.