If we want to train a model or predict with a trained model we will need input data. ForestForesight has created a lot of features that can be used as input. To use the ff_sync function, you'll need to have R installed along with the ForestForesight package. Here's how to use it:
library(ForestForesight)# this will load the FF library and the variables in the config.yml file # Make sure you have DATA_FOLDER in config.yml in your working directory download_folder <- Sys.getenv("DATA_FOLDER") # Choose an identifier (country code, tile ID, or SpatVector). # ONLY RUN 1 OF THE FOLLOWING TWO LINES identifier <- "LAO" # Example: Peru identifier <- vect(file.choose()) # Make sure this is a valid SpatVector object. # Part 1: Download only predictions ff_sync( ff_folder = download_folder, identifier = identifier, download_data = FALSE, # Don't download input data download_groundtruth = FALSE, # Don't download ground truth download_predictions = TRUE # Only download predictions start_date = "2023-01-01" # Only download data since 2023 ) # Part 2: Download complete dataset ff_sync( ff_folder = download_folder, identifier = identifier, features = "Model", # Download model-related features download_data = TRUE, # Download input data download_groundtruth = TRUE, # Download ground truth download_predictions = FALSE, # Download predictions download_model = TRUE # Download the model start_date = "2023-01-01" # Only download data since 2023 ) # check all the other available options of ff_sync ?ff_sync
For more information about the config file please refer to the configuration page here Open-Source Contribution .
This will download the preprocessed data, model, and predictions for Laos or for the shape that you selected earlier in Loading the Area Of Interest (AOI) to the specified folder.
In the image below we explain the folder structure that was created.
Remember that the ForestForesight dataset is large, so downloading might take a while depending on your internet connection and how much data you're fetching.
Add Comment