extractRasterLayer: extractRasterLayer

Description Usage Arguments Value Examples

Description

extractRasterLayer extracts data from a raster layer with a given polygon shape. It support multicore processing through the parallel package and clustering with a default cellsize of 100 meters.

Usage

1
2
extractRasterLayer(raster, shape, multicore = TRUE, gsize = 100,
  showMessages = TRUE, fun = stats2perform, as.shape = FALSE)

Arguments

raster

Raster. Raster to be extracted

shape

Shapefile. Shape which define the polygon to be extracted

multicore

Optional. Logical. If TRUE means multicore processing. By default is TRUE

gsize

Optional. Numeric. Size of each cell in meters. 100 m by default

showMessages

Optional. Logical. If TRUE all processing messages will be shown

fun

Optional. Function. Function to summarize the values (e.g. mean). By default stats2perform is used.

as.shape

Optional. Logical. If as.shape=TRUE, it returns a shape instead of a data.frame. By default is FALSE

Value

a data.frame or a Spatial object.

Examples

1
2
3
4
## Not run: 
shape.extracted <- extractRasterLayer(raster, shape, as.shape = T)

## End(Not run)

ahornero/rsensing documentation built on May 8, 2019, 1:37 a.m.