filter_deforestation_alerts: Filter deforestation alerts

Description Usage Arguments Value Examples

View source: R/filter_deforestation_alerts.R

Description

This function filters SATA deforestation alerts. It uses a shapefile of spatial units to generate plots and visualize some statistics of alerts by spatial units.

Usage

1
2
3
filter_deforestation_alerts(spatial_units_shp, column_units_name,
  deforestation_shp, column_date_name, column_area_name, min_area = NA,
  size_jpg = c(10, 10), output_folder)

Arguments

spatial_units_shp

Shapefile filename. This is the shapefile of spatial units to analyze with SATA alerts. It should be projected in UTM WGS84 coordinates system.

column_units_name

String. The name of the column indicating the names of the spatial units to analize. Case-sensitive applies.

deforestation_shp

Shapefile filename. The shapefile of deforestation alerts from SATA (as polygons).

column_date_name

String. The name of the column indicating the date of alerts. Case-sensitive applies.

column_area_name

String. The name of the column indicating the area of alerts. Case-sensitive applies.

min_area

Numeric. A value defining the minimun area in filtering. NA ignore filtering.

size_jpg

Numeric. Two values which define the width and height of boxplot (in cms).

output_folder

Foldername. A folder to use for store alerts filtered.

Value

Filtered alerts and plots are stored in: *output_folder*.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Defining variables from spatial units shapefile
spatial_units_shp <- "C:/DATA/GAF/demo/shp/unidades_espaciales/provincias.shp"
column_units_name <- "dpa_despro" #case sensitive

#Defining variables from deforestation shapefile
deforestation_shp <- "C:/DATA/GAF/demo/shp/alertas/deforestation_2016_2017.shp"
column_date_name <- "inicio" #case sensitive
column_area_name <- "<c3><a1>rea" #case sensitive
min_area <- 1 #with same units as area column but here ignored

#Defining variables of ouputs
size_jpg <- c(40,20) #first value defines width and second height
output_folder <- "C:/DATA/GAF/demo/estadisticas"

#running the function
filter_deforestation_alerts(spatial_units_shp = spatial_units_shp,
                            column_units_name = column_units_name,
                            deforestation_shp = deforestation_shp,
                            column_date_name = column_date_name,
                            column_area_name = column_area_name,
                            min_area = min_area,
                            size_jpg = size_jpg,
                            output_folder = output_folder)

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