detect_breakpoints: Detect breakpoints from a GEE ts

Description Usage Arguments Value Examples

View source: R/detect_breakpoints.R

Description

This function detects breakpoints from GEE ts, detecting them and giving as output a shapefile with the correspondent dates of change. To calibrate the algorithm, it is possible to create a series of plots which aims to help to define its parameters (ie. change_threshold and segment_size). OSGeo4W is required to be installed and 'OSGeo4W.bat' declared as enviroment variable for its proper working.

Usage

1
2
3
detect_breakpoints(GEE_ts, change_threshold, segment_size, min_area = 4,
  calibration_mode = F, samples_shp, column_id_name, size_jpg = 1000,
  ncores = 1, output_folder)

Arguments

GEE_ts

GEE time series filename. The GEE time series to analyze and detect breakpoints. It should be projected in UTM WGS84 coordinates system.

change_threshold

Numerical. A breakpoint detection change threshold based in the standard deviation from mean of GEE ts. Values can vary from 0.001 (more sensibility to changes) to > 1 (less sensibility)

segment_size

Numerical. The minimun segment size to consider in brakepoint detection. Depends of the number of observations in the GEE ts.

min_area

Numerical. The minimun area of change areas detected by the algorithm

calibration_mode

Logical. Activates the calibration mode of the algorithm. This generates a series of plots of breakpoints based in samples points (requires a points based shapefile of samples).

samples_shp

Shapefile filename. A set of samples for evaluate calibration settings of the algorithm.

column_id_name

String. The name of the column of the unique identifier of each sample.

size_jpg

Numeric. A value which defines the size of plots (in pixels). Plots are based in an square, so one dimension defines its size.

ncores

Numeric. A number defining how many cores will be used in processing.

output_folder

Foldername. A folder to use for store plots.

Value

Plots outputs are stored in: *output_folder*. If calibration_mode is TRUE, a series of plots are create, otherwise a shapefile of detected breakpoints is generated.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#Defining variables for breakpoint detection
GEE_ts <- "C:/DATA/GAF/demo/sentinel1/gee_outputs/coca_S1_ts_VH_P50_I14.tif"
change_threshold <- 10
segment_size <- 3
min_area <- 4

#For calibration mode
samples_shp <- "C:/DATA/GAF/demo/sentinel1/samples/muestras.shp"
column_id_name <- "clase"
size_jpg <- 3000

#Variables for processing and outputs
ncores <- 3
output_folder <- "C:/DATA/GAF/demo/sentinel1/breakpoints"

#running the function in CALIBRATION mode
detect_breakpoints(GEE_ts = GEE_ts,
                   change_threshold = change_threshold,
                   segment_size = segment_size,
                   min_area = min_area,
                   calibration_mode = T,
                   samples_shp = samples_shp,
                   column_id_name = column_id_name,
                   size_jpg = size_jpg,
                   ncores = ncores,
                   output_folder = output_folder)

#running the function in PROCESSING mode
detect_breakpoints(GEE_ts = GEE_ts,
                   change_threshold = change_threshold,
                   segment_size = segment_size,
                   min_area = min_area,
                   calibration_mode = F,
                   column_id_name = column_id_name,
                   ncores = ncores,
                   output_folder = output_folder)

FSantosCodes/SATAtools documentation built on May 5, 2019, 11:06 p.m.