Calculate Zonal statistics with gdalcubes

extract_zonalstats(
  aoi = NULL,
  idcol = NULL,
  files = NULL,
  times,
  bands,
  zonalfuns,
  bbox,
  after,
  before,
  srs,
  dx,
  dy,
  dt,
  aggregation,
  resampling,
  outpath = NULL,
  threads = 1,
  ...
)

Arguments

aoi

A sf object with polygons / multipolygons

idcol

A column name of the aoi object uniquely identifying the polygons. The values found in this columns will be appended to the resulting sf object to allow feature identification.

files

Input raster files

times

Input dates

bands

Input band names

zonalfuns

A named list with functions for zonal statistics as elements

bbox

Bounding Box

after

Date after

before

Date before

srs

target spatial reference system as a string; can be a proj4 definition, WKT, or in the form "EPSG:XXXX"

dx

resolution x

dy

resolution y

dt

resoltion time

aggregation

aggregation method as string, defining how to deal with pixels containing data from multiple images, can be "min", "max", "mean", "median", or "first"

resampling

method used in gdalwarp when images are read, can be "near", "bilinear", "bicubic" or others as supported by gdalwarp (see https://gdal.org/programs/gdalwarp.html)

outpath

Path for the output GeoPakackage

threads

Number of threads

...

Additional arguments to st_write

Value

A sf object in long format with columns for the specified zonal statistics, and rows for each feature and input time.

Author

Darius Görgen (MapTailor Geospatial Consulting GbR) info@maptailor.net
Maintainer: MAPME-Initiative contact@mapme-initiative.org
Contact Person: Dr. Johannes Schielein
Copyright: MAPME-Initiative
License: GPL-3