extract_gfc: Extracts GFC data for a given AOI

View source: R/extract_gfc.R

extract_gfcR Documentation

Extracts GFC data for a given AOI

Description

This function extracts a dataset for a given AOI from a series of pre-downloaded GFC tiles. The download_tiles function should be used beforehand in order to download the necessary data to the specified data_folder. Note that the output file format is fixed as GeoTIFF with LZW compression.

Usage

extract_gfc(
  aoi,
  data_folder,
  to_UTM = FALSE,
  stack = "change",
  dataset = "GFC-2022-v1.10",
  ...
)

Arguments

aoi

an Area of Interest (AOI) as a sf object. If the AOI is not in WGS 1984 (EPSG:4326), it will be reprojected to WGS84.

data_folder

folder where downloaded GFC product tiles are located (see download_tiles function.

to_UTM

if TRUE, then reproject the output into the UTM zone of the AOI centroid. If FALSE, retain the original WGS84 projection of the GFC tiles.

stack

the layers to extract from the GFC product. Defaults to "change". See Details.

dataset

which version of the Hansen data to use

...

additional arguments as for writeRaster, such as filename, or overwrite.

Details

The stack option can be "change" (the default), "first", or "last". When set to "change", the forest change layers (treecover2000, loss, gain, lossyear, and datamask) will be extracted for the given aoi. The "first" and "last" options will mosaic the 2000 or last year composite top of atmosphere (TOA) reflectance images (respectively).

Value

RasterStack with GFC layers

See Also

download_tiles, annual_stack, gfc_stats


gfcanalysis documentation built on Oct. 11, 2023, 5:15 p.m.