diff --git a/R/data_glc.R b/R/data_glc.R new file mode 100644 index 0000000..7b92984 --- /dev/null +++ b/R/data_glc.R @@ -0,0 +1,486 @@ +#------------------------------------------------------------------------------ +# FUNCTION 1: +#------------------------------------------------------------------------------ +#' Read and Unpack Global Landcover (GLC-FCS30 v2) Source Files +#' +#' Retrieves and prepares raw Global Landcover (GLC-FCS30 v2) data tiles for analysis. +#' This function locates, optionally unzips, and lists all annual raster files +#' (.tif format) from the ESA GLC-FCS30 v2 dataset. It supports partial loading for +#' testing or memory-constrained environments. +#' +#' @details +#' The function automates the initial ingestion and unpacking of the GLC-FCS30 dataset: +#' \enumerate{ +#' \item Uses \code{get_pgfile()} to identify the local or network dataset directory +#' for the specified GLC version (currently \code{"GLC_FCS30"} v2). +#' \item Lists all available \code{.zip} archives within the dataset directory. +#' \item Optionally limits the number of archives processed when \code{beta_test = TRUE} +#' or when \code{foldersize} is specified. +#' \item Extracts each \code{.zip} archive into a matching folder if not already unzipped. +#' \item Collects paths to all valid annual \code{.tif} raster files, excluding +#' 5-year composites (filenames containing "5years"). +#' } +#' +#' This prepares the raster file list required for downstream preprocessing via +#' \code{\link{prepare_glc_layers()}} and aggregation using +#' \code{\link{glc_landcover()}} or \code{\link{robust_glc_landcover()}}. +#' +#' @note +#' - The function assumes a consistent directory structure produced by ESA GLC-FCS30 v2. +#' - Existing unzipped folders are skipped to avoid redundant extraction. +#' - Only annual layers are returned; 5-year composite rasters are excluded automatically. +#' - If \code{beta_test = TRUE}, the function processes only the first \code{foldersize} +#' ZIP archives, allowing rapid functional testing on limited subsets. +#' +#' @param beta_test Logical; if TRUE, activates test mode by restricting the number +#' of ZIP files unzipped and processed. +#' @param foldersize Optional integer defining how many ZIP folders to include. +#' Defaults to all available archives. +#' +#' @return A character vector of file paths pointing to annual \code{.tif} raster files +#' from the unzipped GLC-FCS30 v2 dataset. +#' +#' @seealso +#' \code{\link{get_pgfile}} for dataset path retrieval, +#' \code{\link{prepare_glc_layers}} for temporal filtering and naming, +#' \code{\link{glc_landcover}} and \code{\link{robust_glc_landcover}} for aggregation. +#' +#' @examples +#' # Example 1: Load all available GLC-FCS30 v2 tiles +#' # tif_files <- read_glc_v2() +#' +#' # Example 2: Beta test mode (first 2 ZIP files) +#' # tif_files <- read_glc_v2(beta_test = TRUE, foldersize = 2) +#' +#' @export +read_glc_v2 <- function(beta_test = FALSE, foldersize = NULL) { + + # Base dataset directory + #f <- file.path( + # "/Volumes/T7/PRIOGRID", + # "GLC_FCS30", + # "v2", + # "7f03a296-4329-4458-8b62-83c3d27530af" + #) + + + + f <- get_pgfile(source_name = "GLC_FCS30", + source_version = "v2", + id = "7f03a296-4329-4458-8b62-83c3d27530af") + + dir <- dirname(f[1]) # just grab the directory of the first file + zips <- list.files(dir, pattern = "\\.zip$", full.names = TRUE) + + # Default foldersize = all zip files + if (is.null(foldersize)) foldersize <- length(zips) + + # Optional beta test subset + if (beta_test) { + message("Running in beta test mode: limiting to first ", foldersize, " zip file(s).") + zips <- head(zips, foldersize) + } + + # ---- Unzip only if not already unzipped ---- + unzipped_dirs <- vapply(zips, function(z) { + target_dir <- sub("\\.zip$", "", z) + if (!dir.exists(target_dir)) { + message("Unzipping ", basename(z)) + unzip(z, exdir = target_dir) + } else { + message("Skipping (already unzipped): ", basename(z)) + } + return(target_dir) + }, FUN.VALUE = character(1)) + + # ---- Gather all annual (not 5-year) TIFFs ---- + tif_files <- list.files( + unzipped_dirs, + pattern = "\\.tif$", + full.names = TRUE, + recursive = TRUE + ) + tif_files <- tif_files[!grepl("5years", basename(tif_files), ignore.case = TRUE)] + + return(tif_files) + +} + +#------------------------------------------------------------------------------ +# FUNCTION 2: +#------------------------------------------------------------------------------ +#' Prepare Global Landcover (GLC) Raster Layers for PRIO-GRID Aggregation +#' +#' Reads, filters, and renames high-resolution Global Landcover (GLC) raster tiles +#' prior to aggregation. Each 5×5° tile typically contains multiple annual layers +#' (e.g., 1992–2020 composites). This function standardizes their naming conventions, +#' aligns their temporal coverage with PRIO-GRID reference years, and outputs a +#' list of cleaned \code{SpatRaster} objects ready for spatial aggregation. +#' +#' @details +#' The function automates several preprocessing steps: +#' \enumerate{ +#' \item Reads all available GLC TIFF tiles using \code{read_glc_v2()}. +#' \item Optionally limits the number of tiles loaded via \code{n_tifs} for testing. +#' \item Extracts year ranges from file names and safely renames layers. +#' \item Filters layers to match the temporal range defined by \code{pg_dates()}. +#' \item Converts layer names to standardized ISO date format (\code{YYYY-MM-DD}) +#' for interoperability with time-series analysis workflows. +#' } +#' +#' This function ensures that only temporally valid and correctly named raster layers +#' are passed to \code{glc_landcover()} or \code{robust_glc_landcover()}. It is designed +#' to minimize memory use and provide clear diagnostics on mismatched years. +#' +#' @param beta_test Logical; if TRUE, enables a lightweight test mode that restricts +#' processing to a filtered subset of GLC folders. This option is useful for quick +#' diagnostics or verifying code functionality without loading the full dataset. +#' +#' @param foldersize Optional integer specifying the number of GLC folders (each +#' corresponding to a subglobal 5×5° tile group) to include in a batch. This +#' parameter controls how many folder-level batches are processed and can be +#' adjusted to balance performance and memory constraints during large-scale runs. +#' +#' @param n_tifs Optional integer specifying the total number of individual TIFF +#' files (subtiles) to process across all selected folders. While \code{beta_test} +#' limits the number of folders processed and \code{foldersize} controls the batch +#' size of those folders, \code{n_tifs} restricts the number of individual TIFFs +#' loaded within them. This enables granular testing on smaller subsets of the full +#' GLC catalog—comprising 36 folders with 32 TIFFs per folder—where each TIFF +#' contains over 30 years of landcover layers. Setting this parameter can +#' substantially reduce memory use and speed up development or validation runs. +#' +#' @return A named list of filtered \code{SpatRaster} objects. Each raster contains +#' annual layers with standardized names corresponding to valid PRIO-GRID years. +#' +#' @seealso +#' \code{\link{read_glc_v2}} for retrieving raw GLC files, +#' \code{\link{glc_landcover}} and \code{\link{robust_glc_landcover}} for aggregation. +#' +#' @examples +#' # Load and filter ESA GLC raster tiles (test mode) +#' # rasters <- prepare_glc_layers(beta_test = TRUE, n_tifs = 2) +#' +#' # Example: Extract layer years from the first tile +#' # names(rasters[[1]]) +#' +#' @export +prepare_glc_layers <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + + # ---- Step 1: Read TIFF files from GLC folders ---- + tif_files <- read_glc_v2(beta_test = beta_test, foldersize = foldersize) + + message("Found ", length(tif_files), " TIFF files to process.\n") + + # ---- Optional Step: Limit to first N TIFFs ---- + if (!is.null(n_tifs)) { + if (n_tifs < length(tif_files)) { + message("Limiting to first ", n_tifs, " TIFF files for testing.") + tif_files <- head(tif_files, n_tifs) + } else { + message("Requested n_tifs (", n_tifs, ") >= total available TIFFs; using all files.") + } + } + + # ---- Load and rename rasters by year range ---- + ras_list <- vector("list", length(tif_files)) + + for (i in seq_along(tif_files)) { + r_i <- terra::rast(tif_files[i]) + fname <- basename(tif_files[i]) + + # Parse start and end years from filename + start_year <- as.numeric(sub(".*_(\\d{4})\\d{4}.*", "\\1", fname)) + end_year <- as.numeric(sub(".*_(\\d{8}).*", "\\1", fname)) + end_year <- as.numeric(substr(end_year, 5, 8)) + + # Build the sequence of years + years <- seq(start_year, end_year) + + # Rename layers safely + names(r_i) <- years[seq_len(min(length(years), terra::nlyr(r_i)))] + + ras_list[[i]] <- r_i + } + + # ---- Step 2: Filter layers by PRIO-GRID years ---- + years_to_keep <- lubridate::year(pg_dates()) |> unique() + + ras_list_filtered <- lapply(ras_list, function(r) { + raw_names <- names(r) + layer_years <- suppressWarnings(as.numeric(gsub("\\D", "", raw_names))) + keep_layers <- layer_years %in% years_to_keep + + if (any(keep_layers)) { + r <- r[[keep_layers]] + names(r) <- layer_years[keep_layers] + } else { + warning("No matching years found for raster: ", terra::sources(r)) + r <- NULL + } + return(r) + }) + + # Remove NULL rasters + ras_list_filtered <- Filter(Negate(is.null), ras_list_filtered) + + # ---- Step 3: Rename to full YYYY-MM-DD format ---- + month_to_use <- lubridate::month(pg_dates()) |> max() + day_to_use <- lubridate::day(pg_dates()) |> max() + + ras_list_filtered <- lapply(ras_list_filtered, function(r) { + yrs <- as.numeric(names(r)) + names(r) <- as.Date(paste(yrs, month_to_use, day_to_use, sep = "-")) + return(r) + }) + + # ---- Return processed rasters ---- + message("Layer preparation complete. Returning filtered raster list.") + return(ras_list_filtered) +} +#------------------------------------------------------------------------------ +# FUNCTION 3: +#------------------------------------------------------------------------------ +#' Robust Landcover Aggregation Function +#' +#' GLC land cover class codes (for stable categories): +#' \itemize{ +#' \item 00: Ocean +#' \item 11: Urban +#' \item 22: Cropland +#' \item 33: Pasture/rangeland +#' \item 44: Forest +#' \item 55: Unmanaged grass/shrubland +#' \item 66: Sparse/no vegetation +#' \item 77: Water +#' \item 99: No data +#' } +#' +#' Aggregates high-resolution Global Landcover (GLC) tiles into PRIO-GRID scale rasters. +#' Each 5×5° tile is processed independently, layer-by-layer, using a robust and memory-safe +#' transformation that automatically aligns PRIO-GRID extents with the tile extent. +#' +#' @details +#' This function extends \code{glc_landcover()} by incorporating additional error handling +#' and memory management features. It is particularly suitable for large-scale or distributed +#' processing tasks, where tile extents may vary slightly or where raster alignment mismatches +#' could cause resampling artifacts. The internal use of \code{tiled = TRUE} ensures each +#' PRIO-GRID cell is aggregated only within the spatial footprint of its corresponding GLC tile. +#' +#' @note +#' Input rasters are expected to use ESA WorldCover classification codes (0–250). +#' Filled values (0, 250) are ignored during aggregation. The function assumes +#' all tiles share the same CRS and pixel alignment as defined in \code{prepare_glc_layers()}. +#' +#' @seealso +#' \code{\link{glc_landcover}}, \code{\link{prepare_glc_layers}}, \code{\link{robust_transformation}} +#' +#' @param landcovertype Integer or vector of integer GLC codes representing the landcover +#' classes of interest (e.g., cropland = c(10, 11, 12)). +#' @inheritParams prepare_glc_layers +#' @return A SpatRaster of PRIO-GRID aggregated landcover fractions (0–1) per cell. +#' @export +#' +#' @examples +#' Example: Compute shrubland coverage +#' shrubland <- robust_glc_landcover(c(120, 121, 122, 150, 152)) +#' +robust_glc_landcover <- function(landcovertype, beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + # ------------------------------------------------------------------------- + # STEP 1: Prepare and load GLC raster tiles + # ------------------------------------------------------------------------- + # Each tile typically covers a 5×5° geographic area. + # The prepare_glc_layers() function returns a list of SpatRaster objects, + # where each tile contains multiple time layers (e.g., annual composites). + # ------------------------------------------------------------------------- + ras_list_filtered <- prepare_glc_layers(beta_test, foldersize, n_tifs) + # ------------------------------------------------------------------------- + # STEP 2: Define block-level aggregation function + # ------------------------------------------------------------------------- + # The block_fun determines how the fine-resolution pixels (30m) + # are summarized into a single PRIO-GRID cell (~55km). + # + # - Each "block" corresponds to one PRIO cell footprint. + # - The function calculates the proportion of pixels that match + # the target landcover type(s) defined in `landcovertype`. + # + # The result for each PRIO cell will be a number between 0 and 1. + # ------------------------------------------------------------------------- + block_fun <- function(x) { + if (length(x) == 0 || all(is.na(x))) return(NA_real_) + mean(x %in% landcovertype, na.rm = TRUE) + } + # ------------------------------------------------------------------------- + # STEP 3: Process each raster tile independently + # ------------------------------------------------------------------------- + # Each tile is processed layer-by-layer (typically one layer per year). + # The function robust_transformation() handles the heavy lifting: + # it performs aggregation to PRIO-GRID scale and ensures numerical stability. + # + # The key improvement here is `tiled = TRUE`, which instructs + # robust_transformation() to crop PRIO-GRID to match the tile extent. + # This avoids global resampling and prevents extent/alignment errors. + # ------------------------------------------------------------------------- + results <- lapply(seq_along(ras_list_filtered), function(i) { + tile <- ras_list_filtered[[i]] + tile_name <- names(ras_list_filtered)[i] %||% paste0("Tile_", i) + + message("\n Processing ", tile_name) + + # --------------------------------------------------------------------- + # STEP 3a: Process each time layer within the current tile + # --------------------------------------------------------------------- + per_year <- lapply(seq_len(terra::nlyr(tile)), function(k) { + lyr <- tile[[k]] + message(" ├─ Layer ", k, ": ", names(tile)[k]) + + # Perform robust aggregation to PRIO scale + # Note: tiled = TRUE ensures localized cropping of PRIO-GRID + robust_transformation(lyr, block_fun, tiled = TRUE) + }) + + # --------------------------------------------------------------------- + # STEP 3b: Stack valid layers back into a multi-layer raster + # --------------------------------------------------------------------- + # Layers that failed to process (NULL) are removed before stacking. + # --------------------------------------------------------------------- + per_year <- Filter(Negate(is.null), per_year) + if (length(per_year) > 0) terra::rast(per_year) else NULL + }) + + + # ------------------------------------------------------------------------- + # STEP 4: Merge processed tiles into a single raster + # ------------------------------------------------------------------------- + # After all tiles have been processed independently, they are merged + # spatially into a single continuous PRIO-aligned SpatRaster. + # If only one tile exists, that raster is returned directly. + # ------------------------------------------------------------------------- + results <- Filter(Negate(is.null), results) + if (length(results) > 1) { + message("\n Merging ", length(results), " aggregated tiles into final raster...") + do.call(terra::merge, results) + } else { + results[[1]] + } +} +#' Generate Cropland Raster Layers +#' +#' Aggregates rainfed, herbaceous, tree/orchard, and irrigated croplands (LC ids 10, 11, 12, 20) +#' into a unified cropland class. These represent actively cultivated areas used for agriculture, +#' distinguishing between different vegetation covers and irrigation practices. +#' +#' @inheritParams prepare_glc_layers +#' @return Aggregated cropland raster. +#' @export +gen_glc_cropland <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + glc_landcover( + landcovertype = c(10, 11, 12, 20), + beta_test = beta_test, + foldersize = foldersize, + n_tifs = n_tifs + ) +} +#' Generate Forest Raster Layers +#' +#' Aggregates all broadleaved, needle-leaved, and mixed-leaf forests (LC ids 51–92), +#' both open and closed canopy types. This grouping captures the range of forested +#' ecosystems from evergreen to deciduous forms, unified by dense perennial vegetation +#' cover exceeding typical shrub or grassland canopy thresholds. +#' +#' @inheritParams prepare_glc_layers +#' @return Aggregated forest raster. +#' @export +gen_glc_forest <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + glc_landcover( + landcovertype = c(51, 52, 61, 62, 71, 72, 81, 82, 91, 92), + beta_test = beta_test, + foldersize = foldersize, + n_tifs = n_tifs + ) +} +#' Generate Shrubland Raster Layers +#' +#' Combines evergreen, deciduous, and sparse shrublands (LC ids 120, 121, 122, 150, 152) +#' into a unified shrubland class. These classes represent areas dominated by woody +#' perennials shorter than trees, often found in semi-arid regions and ecotones between +#' grassland and forest ecosystems. +#' +#' @inheritParams prepare_glc_layers +#' @return Aggregated shrubland raster. +#' @export +gen_glc_shrubland <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + robust_glc_landcover( + landcovertype = c(120, 121, 122, 150, 152), + beta_test = beta_test, + foldersize = foldersize, + n_tifs = n_tifs + ) +} +#' Generate Grassland Raster Layers +#' +#' Merges open herbaceous and sparse grass-dominated areas (LC ids 130, 153) +#' into a single grassland class. These correspond to regions with continuous or +#' patchy coverage of grasses and herbaceous vegetation, typically maintained by +#' climate, fire, or grazing pressure. +#' +#' @inheritParams prepare_glc_layers +#' @return Aggregated grassland raster. +#' @export +gen_glc_grassland <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + glc_landcover( + landcovertype = c(130, 153), + beta_test = beta_test, + foldersize = foldersize, + n_tifs = n_tifs + ) +} +#' Generate Wetland Raster Layers +#' +#' Groups swamp, marsh, flooded, saline, mangrove, and tidal flats (LC ids 181–187) +#' into a unified wetland class. These represent permanently or seasonally waterlogged +#' ecosystems characterized by saturated soils, distinct hydrology, and vegetation adapted +#' to anaerobic conditions. +#' +#' @inheritParams prepare_glc_layers +#' @return Aggregated wetland raster. +#' @export +gen_glc_wetland <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + glc_landcover( + landcovertype = c(181, 182, 183, 184, 185, 186, 187), + beta_test = beta_test, + foldersize = foldersize, + n_tifs = n_tifs + ) +} +#' Generate Built-up / Urban Raster Layers +#' +#' Captures impervious or constructed surfaces (LC id 190) corresponding to built-up or +#' urban areas. These include settlements, infrastructure, and other human-made structures +#' with minimal vegetative cover. +#' +#' @inheritParams prepare_glc_layers +#' @return Aggregated built-up raster. +#' @export +gen_glc_builtup <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + glc_landcover( + landcovertype = 190, + beta_test = beta_test + ) +} +#' Generate Water Body Raster Layers +#' +#' Represents inland and coastal water bodies (LC id 210), including lakes, reservoirs, +#' and rivers. This grouping excludes wetlands (181–187), focusing solely on standing or +#' flowing open water. +#' +#' @inheritParams prepare_glc_layers +#' @return Aggregated water body raster. +#' @export +gen_glc_water <- function(beta_test = FALSE, foldersize = NULL, n_tifs = NULL) { + glc_landcover( + landcovertype = 210, + beta_test = beta_test + ) +} + diff --git a/R/utility.R b/R/utility.R index 4630267..a0d695d 100644 --- a/R/utility.R +++ b/R/utility.R @@ -236,8 +236,13 @@ rast_to_df <- function(rast, static = TRUE, varname = NULL){ #' \code{\link[terra]{aggregate}}, \code{\link[terra]{disagg}}, \code{\link[terra]{resample}} #' #' @export -robust_transformation <- function(r, agg_fun, disagg_method = "near", ...){ +robust_transformation <- function(r, agg_fun, disagg_method = "near", tiled = FALSE, ...){ pg <- prio_blank_grid() + + if(tiled){ + pg <- terra::crop(pg, r) + } + temporary_directory <- file.path(pgoptions$get_rawfolder(), "tmp", tempdir() |> basename()) dir.create(temporary_directory) diff --git a/data/pgsources.rda b/data/pgsources.rda index 67c2496..1fb01ee 100644 Binary files a/data/pgsources.rda and b/data/pgsources.rda differ diff --git a/data_raw/pgsources.R b/data_raw/pgsources.R index f271622..8e8a398 100644 --- a/data_raw/pgsources.R +++ b/data_raw/pgsources.R @@ -4,4 +4,4 @@ if(length(pgsources$id) != length(unique(pgsources$id))){ stop("Non-unique IDs. Double check sources.csv") } -usethis::use_data(pgsources, overwrite = TRUE) +usethis::use_data(pgsources, overwrite = FALSE) diff --git a/data_raw/sources.csv b/data_raw/sources.csv index f76aa3c..9db41f8 100644 --- a/data_raw/sources.csv +++ b/data_raw/sources.csv @@ -44,3 +44,5 @@ e703f38e-5f1c-47c8-b798-e749ec503e98 World Bank Subnational Doing Business Repor ea215b4a-56b6-48d2-a6ae-fd32a9c4fc77 GHSL GHS-DUC R2023 CC BY 4.0 schiavinaGHSDUCR2023AGHS2023 NA NA NA https://human-settlement.emergency.copernicus.eu/ghs_duc2023.php demographic, urbanization World Less than yearly florioEstimatingGeographicAccess2023 NA TRUE TRUE NA 2024-12-03 14:20:41 ec3eea2e-6bec-40d5-a09c-e9c6ff2f8b6b ETH ICR cShapes 2.0 CC BY-NC-SA 4.0 schvitzMappingInternationalSystem2022 NA NA https://icr.ethz.ch/data/cshapes/CShapes-2.0.geojson https://icr.ethz.ch/data/cshapes/ boundary, international system, political unit World Higher than monthly weidmannGeographyInternationalSystem2010; gleditschRevisedListIndependent1999 NA TRUE TRUE NA 2024-12-03 13:39:59 f37f3b1c-3b16-48e4-8aa3-7162b35a8096 GHSL GHS Settlement Model Grid R2023 CC BY 4.0 schiavinaGHSSMODR2023AGHS2023 NA NA urls/f37f3b1c-3b16-48e4-8aa3-7162b35a8096.txt https://human-settlement.emergency.copernicus.eu/download.php?ds=smod demographic, population, urbanization World Less than yearly melchiorriUnveiling25Years2018 NA NA TRUE NA 2024-12-05 11:06:50 +0313d990-b4f8-42ad-9553-6d25d23ae01a GLC_FCS30 v1 CC BY 4.0 zhang_glc_fcs30_2021 NA NA urls/0313d990-b4f8-42ad-9553-6d25d23ae01a.txt https://zenodo.org/records/8239305 landcover World Yearly NA NA TRUE TRUE FALSE 2025-09-25 11:51:45 +7f03a296-4329-4458-8b62-83c3d27530af GLC_FCS30 v2 CC BY 4.0 NA NA urls/7f03a296-4329-4458-8b62-83c3d27530af.txt https://zenodo.org/records/15063683 landcover World Yearly NA NA FALSE FALSE FALSE 2025-10-09 13:56:02 diff --git a/inst/REFERENCES.bib b/inst/REFERENCES.bib index 8bb830f..836ad67 100644 --- a/inst/REFERENCES.bib +++ b/inst/REFERENCES.bib @@ -952,3 +952,34 @@ @article{harrisVersion4CRU2020 doi = {10.1038/s41597-020-0453-3}, abstract = {CRU TS (Climatic Research Unit gridded Time Series) is a widely used climate dataset on a 0.5{$^\circ$} latitude by 0.5{$^\circ$} longitude grid over all land domains of the world except Antarctica. It is derived by the interpolation of monthly climate anomalies from extensive networks of weather station observations. Here we describe the construction of a major new version, CRU TS v4. It is updated to span 1901--2018 by the inclusion of additional station observations, and it will be updated annually. The interpolation process has been changed to use angular-distance weighting (ADW), and the production of secondary variables has been revised to better suit this approach. This implementation of ADW provides improved traceability between each gridded value and the input observations, and allows more informative diagnostics that dataset users can utilise to assess how dataset quality might vary geographically.} } + +@article{zhang_glc_fcs30_2021, + title = {{GLC}\_FCS30: global land-cover product with fine classification system at 30\ m using time-series {Landsat} imagery}, + volume = {13}, + issn = {1866-3508}, + shorttitle = {{GLC}\_FCS30}, + url = {https://essd.copernicus.org/articles/13/2753/2021/}, + doi = {10.5194/essd-13-2753-2021}, + abstract = {Over past decades, a lot of global land-cover products have been released; however, these still lack a global land-cover map with a fine classification system and spatial resolution simultaneously. In this study, a novel global 30 m land-cover classification with a fine classification system for the year 2015 (GLC\_FCS30-2015) was produced by combining time series of Landsat imagery and high-quality training data from the GSPECLib (Global Spatial Temporal Spectra Library) on the Google Earth Engine computing platform. First, the global training data from the GSPECLib were developed by applying a series of rigorous filters to the CCI\_LC (Climate Change Initiative Global Land Cover) land-cover and MCD43A4 NBAR products (MODIS Nadir Bidirectional Reflectance Distribution Function-Adjusted Reflectance). Secondly, a local adaptive random forest model was built for each 5∘×5∘ geographical tile by using the multi-temporal Landsat spectral and texture features and the corresponding training data, and the GLC\_FCS30-2015 land-cover product containing 30 land-cover types was generated for each tile. Lastly, the GLC\_FCS30-2015 was validated using three different validation systems (containing different land-cover details) using 44 043 validation samples. The validation results indicated that the GLC\_FCS30-2015 achieved an overall accuracy of 82.5 \% and a kappa coefficient of 0.784 for the level-0 validation system (9 basic land-cover types), an overall accuracy of 71.4 \% and kappa coefficient of 0.686 for the UN-LCCS (United Nations Land Cover Classification System) level-1 system (16 LCCS land-cover types), and an overall accuracy of 68.7 \% and kappa coefficient of 0.662 for the UN-LCCS level-2 system (24 fine land-cover types). The comparisons against other land-cover products (CCI\_LC, MCD12Q1, FROM\_GLC, and GlobeLand30) indicated that GLC\_FCS30-2015 provides more spatial details than CCI\_LC-2015 and MCD12Q1-2015 and a greater diversity of land-cover types than FROM\_GLC-2015 and GlobeLand30-2010. They also showed that GLC\_FCS30-2015 achieved the best overall accuracy of 82.5 \% against FROM\_GLC-2015 of 59.1 \% and GlobeLand30-2010 of 75.9 \%. Therefore, it is concluded that the GLC\_FCS30-2015 product is the first global land-cover dataset that provides a fine classification system (containing 16 global LCCS land-cover types as well as 14 detailed and regional land-cover types) with high classification accuracy at 30 m. The GLC\_FCS30-2015 global land-cover products produced in this paper are free access at https://doi.org/10.5281/zenodo.3986872 (Liu et al., 2020).}, + language = {English}, + number = {6}, + urldate = {2025-09-25}, + journal = {Earth System Science Data}, + author = {Zhang, Xiao and Liu, Liangyun and Chen, Xidong and Gao, Yuan and Xie, Shuai and Mi, Jun}, + month = jun, + year = {2021}, + pages = {2753--2776}, +} + +@article{Liu_glc_fcs30_v2_2022, + title = {Algorithm, Progresses, Datasets and Validation of GLC_FCS30D: the first global 30 m land-cover dynamic product with fine classification system from 1985 to 2022}, + volume = {2}, + shorttitle = {{GLC}\_FCS30\_v2}, + url = {https://isprs-annals.copernicus.org/articles/X-2-2024/137/2024/}, + doi = {10.5194/isprs-annals-X-2-2024-137-2024}, + language = {English}, + journal = {ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences}, + author = {Liu, L. and Zhang, X.} + year = {2024}, + pages = {137-143}, +} diff --git a/inst/extdata/urls/0313d990-b4f8-42ad-9553-6d25d23ae01a.txt b/inst/extdata/urls/0313d990-b4f8-42ad-9553-6d25d23ae01a.txt new file mode 100644 index 0000000..8e5eb6d --- /dev/null +++ b/inst/extdata/urls/0313d990-b4f8-42ad-9553-6d25d23ae01a.txt @@ -0,0 +1,38 @@ +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E0-E5.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E10-E15.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E100-E105.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E110-E115.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E120-E125.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E130-E135.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E140-E145.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E150-E155.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E160-E165.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E170-E175.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E20-E25.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E30-E35.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E40-E45.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E50-E55.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E60-E65.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E70-E75.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E70-E75.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E80-E85.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E90-E95.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W105-W110.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W115-W120.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W125-W130.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W135-W140.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W145-W150.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W15-W20.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W155-W160.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W155-W160.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W165-W170.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W175-W180.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W25-W30.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W35-W40.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W45-W50.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W5-W10.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W55-W60.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W65-W70.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W75-W80.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W85-W90.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W95-W100.zip?download=1 diff --git a/inst/extdata/urls/7f03a296-4329-4458-8b62-83c3d27530af.txt b/inst/extdata/urls/7f03a296-4329-4458-8b62-83c3d27530af.txt new file mode 100644 index 0000000..07003d3 --- /dev/null +++ b/inst/extdata/urls/7f03a296-4329-4458-8b62-83c3d27530af.txt @@ -0,0 +1,36 @@ +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E0-E5.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E10-E15.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E100-E105.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E110-E115.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E120-E125.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E130-E135.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E140-E145.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E150-E155.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E160-E165.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E170-E175.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E20-E25.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E30-E35.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E40-E45.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E50-E55.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E60-E65.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E70-E75.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E80-E85.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_E90-E95.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W105-W110.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W115-W120.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W125-W130.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W135-W140.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W145-W150.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W15-W20.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W155-W160.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W165-W170.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W175-W180.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W25-W30.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W35-W40.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W45-W50.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W5-W10.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W55-W60.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W65-W70.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W75-W80.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W85-W90.zip?download=1 +https://zenodo.org/records/15063683/files/GLC_FCS30D_19852022maps_W95-W100.zip?download=1