View source: R/label_landcover.R
label_landcover | R Documentation |
Creates a CSV table with landcover codes and labels that can be imported into AccessMod. Requires processed landcover.
label_landcover(
mainPath,
location,
mostRecent,
overwrite = FALSE,
defaultLabels = TRUE
)
mainPath |
character; the parent directory of the location folder |
location |
character; the location folder name |
mostRecent |
logical; should the most recent processed landcover raster be selected? If FALSE and if there are multiple available inputs, the user is interactively asked to select the input based on file creation time. |
overwrite |
logical; in case it exists, should the output be overwritten? |
defaultLabels |
logical; should the Copernicus default labels be associated with the the landcover raster values. If FALSE, the user is interactively asked to enter the label names for each value. |
The function writes a CSV table with two columns (classes and labels) into the same folder as the processed landcover layer.
# Replace workDir with the actual path to your working directory
## Not run:
mainPath <- "workDir"
initiate_project(mainPath)
## End(Not run)
# Replace myLocation with the location name you are working on (workDir subfolder)
## Not run:
location <- "myLocation"
download_boundaries(mainPath, location, adminLevel = 1, type = "gbOpen", alwaysDownload = TRUE)
set_projection(mainPath, location, mostRecent = TRUE, alwaysSet = TRUE, bestCRS = TRUE) #required for processing the landcover
download_landcover(mainPath, location, alwaysDownload = TRUE, mostRecent = TRUE)
download_population(mainPath, location, alwaysDownload = TRUE) # required for processing the landcover
process_inputs(mainPath, location, "rLandcover", defaultMethods = TRUE, changeRes = FALSE, popCorrection = FALSE)
label_landcover(mainPath, location, mostRecent = TRUE, overwrite = TRUE, defaultLabels = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.