This function create all the unique ecosystem derived

create_unique_ecosystem_from_scratch(
  dsn,
  vri_dsn = dsn,
  bem_dsn = dsn,
  rivers_dsn = dsn,
  wetlands_dsn = dsn,
  layers_names_list = list(vri = "VEG_R1_PLY_polygon", bem = "BEM", rivers =
    "FWA_RIVERS_POLY", wetlands = "FWA_WETLANDS_POLY"),
  beu_bec_csv = "csv/Allowed_BEC_BEUs_NE_ALL.csv",
  beu_wetland_update_csv = "csv/beu_wetland_updates.csv",
  clear_site_ma = TRUE,
  use_ifelse = TRUE,
  wkt_filter = character(0),
  n_iterations = 1,
  verbose = TRUE
)

Arguments

dsn

data source name (interpretation varies by driver - for some drivers, dsn is a file name, but may also be a folder, or contain the name and access credentials of a database); in case of GeoJSON, dsn may be the character string holding the geojson data. It can also be an open database connection.

vri_dsn

dsn for vri layer, default to dsn if empty

bem_dsn

dsn for bem layer, default to dsn if empty

rivers_dsn

dsn for rivers layer, default to dsn if empty

wetlands_dsn

dsn for wetlands layer, default to dsn if empty

layers_names_list

named list that contains the layer name for the vri, bem, rivers and wetlands layers

beu_bec_csv

dsn for beu bec csv

beu_wetland_update_csv

dsn for wetlands correction csv

clear_site_ma

boolean, if TRUE variable SITE_M1A, SITE_M2A will be cleared

use_ifelse

boolean, if TRUE correction done after the combine_duplicated_BEUMC will only be applied on rows that were not affected by the correction of duplicated BEUMC

wkt_filter

character; WKT representation of a spatial filter (may be used as bounding box, selecting overlapping geometries)

n_iterations

integer number of iterations, usefull when running out of RAM to load smaller areas and iterate over them one at a time

verbose

boolean , if TRUE function will return message to indicate progress throughout the function execution

Value

data.table that contains the frequency of each unique ecosystem and generates the following empty column to be feed later on:

  • Forested (Y/N),

  • Strict_Climax,

  • Stand_Climax,

  • Stand_Age_0-15, Stand_Age_16-30, Stand_Age_31-50, Stand_Age_51-80, Stand_Age_80+,

  • Struct_Age_0-3, Struct_Age_4-10, Struct_Age_11-30, Struct_Age_31-40, Struct_Age_41-60, Struct_Age_61-80, Struct_Age_81-139, Struct_Age_140_249, Struct_Age_250+,

  • Snow_code