This function is used to calculate the estimate and a p-value of a trend through a raster cube time series.

trend_cube(
  files = NULL,
  bands = NULL,
  times = NULL,
  dx = NULL,
  dy = NULL,
  dt = NULL,
  srs = NULL,
  after = NULL,
  before = NULL,
  bbox = NULL,
  aggregation = "median",
  resampling = "bilinear",
  trend_function = NULL,
  filter_p = NULL,
  chunking = c(1, 256, 256),
  threads = 1,
  outdir = ".",
  label = NULL,
  verbose = T
)

Arguments

files

A character vector with the filepaths to the raster files for which gap-filling and a smoothing function shall be applied.

bands

A character vector indicating the names of the bands in each of the raster files specified in the files argument. (see create_image_collection)

times

A character vector indicating the date of each raster file specified in the files argument in the form of " (see create_image_collection)

dx

The spatial resolution of the outcome raster files in the x dimension in the units of the coordinate reference system specified witht the srs argument. (see cube_view)

dy

The spatial resolution of the outcome raster files in the y dimension in the units of the coordinate reference system specified witht the srs argument. (see cube_view)

dt

The temporal resolution of the outcome raster files. (see cube_view)

srs

Target spatial reference system as a string; can be a proj4 definition, WKT, or in the form "EPSG:XXXX" (see cube_view)

after

A length one character vector in the form " the earliest date (inclusive) included in the temporal extent.

before

A length one character vector in the form " the latest date (inclusive) included in the temporal extent.

bbox

A numeric vector of lenght four indicating the spatial bounding box of the query (xmin, ymin, xmax, ymax) in geographic coordinates. Defaults to `NULL` which will set the spatial extent to global, i.e. c(-180, -90, 180, 90).

aggregation

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

resampling

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 and cube_view)

trend_function

Defaults to NULL which means that mk.test with its standard parametrization is applied. Can be substituted by a function. This function is applied across the time dimension of the data cube and imputes NA's. The return vector must be of equal length to the time dimension, must return one row for each band in the data cube and must not include any NA's. See the example for the standard function which is applied when the smoothing_function is omitted.

filter_p

Defaults to FALSE, that means pixels are not filtered based on the p-value. Can be set to a numeric value below 1 to mask keep all values with a p-value smaller p.

chunking

Vector of length 3 defining the size of data cube chunks in the order time, y, x. (see raster_cube)

threads

Number of threads used to process data cubes (see link[gdalcubes]{gdalcubes_options})

outdir

A character vector pointing to an existing directory where the output rasters are written to.

label

A character vector which is used as a prefix to the output filenames.

verbose

A logical indicating the verbosity.

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