validate_alerts: Create plots for facilitate validation of SATA alerts

Description Usage Arguments Value Examples

View source: R/validate_alerts.R

Description

This function creates from GEE preprocessing outputs, a series of plots which aims to help to validate SATA alerts.

Usage

1
2
3
4
validate_alerts(alerts_shp, column_dates_name, red_channel_GEE_ts,
  green_channel_GEE_ts, blue_channel_GEE_ts, observations_evaluate = 5,
  buffer_distance, stretch_perc = 5, size_jpg = 1000, ncores = 1,
  output_folder)

Arguments

alerts_shp

Shapefile filename. This is the shapefile of alerts generated by SATA. This could be fire or deforestation alerts as always it is a point shapefile with a column indicating alert dates in the format 'YYYY-MM-DD'. It should be projected in UTM WGS84 coordinates system.

column_dates_name

String. The name of the column indicating alerts dates should be specified here. Case-sensitive applies.

red_channel_GEE_ts

GEE time series filename. The GEE time series to assign to the red channel in plots generation. It should be projected in UTM WGS84 coordinates system.

green_channel_GEE_ts

GEE time series filename. The GEE time series to assign to the green channel in plots generation. It should be projected in UTM WGS84 coordinates system.

blue_channel_GEE_ts

GEE time series filename. The GEE time series to assign to the blue channel in plots generation. It should be projected in UTM WGS84 coordinates system.

observations_evaluate

Numeric. A number defining the obsevations to plot (options: 1-5)

buffer_distance

Numeric. A buffer distance from alerts to visualize in plots (in meters)

stretch_perc

Numeric. A value to enhance visualization in plots (range: 0-100)

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*. Among them: 1) plots foreach SATA alert; and 2) a shapefile of the alerts that intesected GEE time series.

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
#Defining variables for alerts shapefile
alerts_shp <- "C:/DATA/GAF/demo/estadisticas/DEFORESTATION_alerts.shp"
column_dates_name <- "start" #case sensitive!

#Defining variables for GEE ts files (normally as a TIF). Take into account that should exist in the same folder its version as CSV (dates files)
red_channel_GEE_ts <- "C:/DATA/GAF/demo/sentinel1/gee_outputs/coca_S1_ts_VV_P50_I14.tif"
green_channel_GEE_ts <- "C:/DATA/GAF/demo/sentinel1/gee_outputs/coca_S1_ts_VH_P50_I14.tif"
blue_channel_GEE_ts <- "C:/DATA/GAF/demo/sentinel1/gee_outputs/coca_S1_ts_VV_P50_I14.tif"

#other variables required
observations_evaluate <- 5 #could be less if processing is slow
buffer_distance <- 500 #consider that is in meters and measured from the alert point
stretch_perc <- 5 #recommendable if plots do not have good contrast
size_jpg <- 1000 #in pixels
ncores <- 3 #modify if your resources are less than this

#output folder to save plots
output_folder <- "C:/DATA/GAF/demo/test"

#running the function
validate_alerts(alerts_shp = alerts_shp,
                column_dates_name = column_dates_name,
                red_channel_GEE_ts = red_channel_GEE_ts,
                green_channel_GEE_ts = green_channel_GEE_ts,
                blue_channel_GEE_ts = blue_channel_GEE_ts,
                observations_evaluate = observations_evaluate,
                buffer_distance = buffer_distance,
                stretch_perc = stretch_perc,
                size_jpg = size_jpg,
                ncores = ncores,
                output_folder = output_folder)

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