knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>", echo = T, message = T, warning = F, cache = F
)

The different stages of Reduced Impact Logging (RIL) described by the ONF (Office National des Forêts) of French Guiana

1) Definition of the area to be logged 2) The layout of the main skidding trails 3) Tree selection 4) Selection of trees by the logger 5) The layout of secondary skidding trails 6) Felling of the tree 7) Adjustment of secondary skidding trails in the case of Fuel Wood Exploitation (FWE) 8) Moving the bole

Load LoggingLab and datasets

Install LoggingLab

install.packages("LoggingLab")
# devtools::install_github("VincyaneBadouard/LoggingLab", build_vignettes = TRUE) # Development version

Load the package

library(LoggingLab)
library(knitr)
library(kableExtra)
library(ggplot2)
library(raster)
library(dplyr)

Load the data stored in the package

# 2016 inventory of Paracou (French Guiana) plot 6
data(Paracou6_2016)
# Table of species exploitability criteria
data(SpeciesCriteria)
# Volume parameters table
data(ForestZoneVolumeParametersTable)
# Crown diameter allometry parameters table
data(ParamCrownDiameterAllometry)
# Digital terrain model (DTM) of the inventoried plot (1m resolution)
data(DTMParacou)
# Mask of the inventoried plot (1m resolution)
data(PlotMask)
# Relative (vertical and horizontal) distances from nearest channel network, of the inventoried plot
data(CreekDistances)
distvert <- as.data.frame(CreekDistances$distvert, xy = TRUE) %>%
  na.omit() %>%
  dplyr::rename('distvert' = 'file9e98702b30f5')


ggplot() + 
  geom_raster(data = distvert, aes(x = x, y = y, fill = distvert)) +
  scale_fill_gradientn(name = "Relative elevation to the creek (m)",
                       colors = hcl.colors(25, "Blues"),
                       na.value="white") +
  ggtitle("Paracou P6: Relative elevation to the creek") + 
  theme_classic() +
  coord_sf()

disthorz <- as.data.frame(CreekDistances$disthorz, xy = TRUE) %>%
  na.omit() %>%
  dplyr::rename('disthorz' = 'file9e985b5916bd')


ggplot() + 
  geom_raster(data = disthorz, aes(x = x, y = y, fill = disthorz)) +
  scale_fill_gradientn(name = "Relative horizontal distance to the creek (m)",
                       colors = hcl.colors(25, "Blues"),
                       na.value="white") +
  ggtitle("Paracou P6: Relative elevation to the creek") + 
  theme_classic() +
  coord_sf()

Required format of the inventory

\code{\link{Paracou6_2016}}

The columns required for the package are: - Forest (to apply the corresponding volume formula) - idTree - Xutm and Yutm - CodeAlive - Family, Genus, Species - CircCorr The columns optional for the package are: - Plot (1 value) - CensusYear (1 value)

# inventory class
class(Paracou6_2016)
#The name and class of all the data variables
lapply(Paracou6_2016, class)

Paracou6_2016 %>%
  dplyr::slice(1:10) %>% 
  kable() %>%
  kable_styling(font_size = 10, latex_options = "scale_down")

Required format of the species exploitability criteria

\code{\link{SpeciesCriteria}}

# speciescriteria class
class(SpeciesCriteria)
#The name and class of all the data variables
lapply(SpeciesCriteria, class)
kable(SpeciesCriteria)

Required format of the volume parameters

\code{\link{ForestZoneVolumeParametersTable}}

# volumeparameters class
class(ForestZoneVolumeParametersTable)
#The name and class of all the data variables
lapply(ForestZoneVolumeParametersTable, class)
kable(ForestZoneVolumeParametersTable)

Required format of the crown diameter allometry parameters

\code{\link{ParamCrownDiameterAllometry}}

# crowndiameterparameters class
class(ParamCrownDiameterAllometry)
#The name and class of all the data variables
lapply(ParamCrownDiameterAllometry, class)
kable(dplyr::slice_sample(ParamCrownDiameterAllometry, n=15))

All the functions of the package

loggingsimulation
loggingparameters
scenariosparameters
inventorycheckformat
addtreedim
treeselection
commercialcriteriajoin
harvestable
selected
futurereserve
treefelling
createcanopy
treefromthesky
directionalfellingsuccessdef
felling1tree
rotatepolygon
getgeometry
timberharvestedvolume
harvestablefuelwood

Arguments presentation

The scenarios

\code{\link{ScenariosTable}}

data(ScenariosTable)
kable(ScenariosTable)

Advanced logging parameters

\code{\link{loggingparameters}}

Default values

Numeric values

Models

Paying attention to inputs - important source of error

Common error sources:
- no crs
- crs with accent
- topography and plotmask do not match
- topography import as R Worspace (you must import it as a .tif file)
- Forest name of the inventory doesn't match with the Forest name in volumeparameters table

Harvest in 1 function

Description: Simulates a timber and fuel wood exploitation on a forest plot, in the way of Reduced Impact Logging (RIL). It covers: harvestable zones definition, tree selection, secondary skidding trails layout, tree felling, timber harvested, fuel wood volume and short-term damages quantification. This simulator is individual-centred, spatialised, and takes into account the topography and the hydrographic network.

Rslt <- loggingsimulation1(Paracou6_2016,
                           plotmask = PlotMask, topography = DTMParacou,
                           creekverticaldistance = CreekDistances$distvert,
                           creekhorizontaldistance = CreekDistances$disthorz,
                           speciescriteria = SpeciesCriteria,
                           volumeparameters = ForestZoneVolumeParametersTable,
                           scenario = "manual", objective = 20,
                           fuel = "2", winching = "2", directionalfelling = "2", 
                           diversification = TRUE, specieslax = FALSE, objectivelax = TRUE,
                           crowndiameterparameters = ParamCrownDiameterAllometry,
                           advancedloggingparameters = loggingparameters())

With the ability to iterate and parallelize:

Rslt_iter <- loggingsimulation(Paracou6_2016,
                               plotmask = PlotMask, topography = DTMParacou,
                               creekverticaldistance = CreekDistances$distvert,
                               creekhorizontaldistance = CreekDistances$disthorz,
                               speciescriteria = SpeciesCriteria,
                               volumeparameters = ForestZoneVolumeParametersTable,
                               scenario = "manual", objective = 20,
                               fuel = "2", winching = "2", directionalfelling = "2", 
                               diversification = TRUE, specieslax = FALSE,
                               objectivelax = TRUE,
                               crowndiameterparameters = ParamCrownDiameterAllometry,
                               advancedloggingparameters = loggingparameters(),
                               iter = 2, cores = 2)

The harvestable volume may change from one simulation to another because the identification of defect trees contains a random component.

SimulTime <- microbenchmark::microbenchmark(

  loggingsimulation1(
    inventory = Paracou6_2016,
    plotmask = PlotMask, topography = DTMParacou,
    creekverticaldistance = CreekDistances$distvert,
    creekhorizontaldistance = CreekDistances$disthorz, 
    speciescriteria = SpeciesCriteria,
    volumeparameters = ForestZoneVolumeParametersTable,
    scenario = "RIL3",
    objectivelax = TRUE,
    crowndiameterparameters = ParamCrownDiameterAllometry), # 2005.819 s

  loggingsimulation(
    inventory = Paracou6_2016,
    plotmask = PlotMask, topography = DTMParacou,
    creekverticaldistance = CreekDistances$distvert,
    creekhorizontaldistance = CreekDistances$disthorz, 
    speciescriteria = SpeciesCriteria,
    volumeparameters = ForestZoneVolumeParametersTable,
    scenario = "RIL3", objectivelax = TRUE,
    crowndiameterparameters = ParamCrownDiameterAllometry, # 1632.843   s
    iter = 2, cores = 2), times = 1L
)
# RIL1_Rslt <- loggingsimulation(Paracou6_2016,
#                                topography = DTMParacou, verticalcreekheight  = DTMParacou,
#                                speciescriteria = SpeciesCriteria,
#                                volumeparameters = ForestZoneVolumeParametersTable,
#                                scenario = "RIL1", specieslax = FALSE, objectivelax = TRUE,
#                                crowndiameterparameters = ParamCrownDiameterAllometry,
#                                advancedloggingparameters = loggingparameters(), iter = 1, cores = 1)
# loggingsummary1(RIL1_Rslt)
# # Without diversification the harvestable volume is too poor
# RIL2broken_Rslt <- loggingsimulation(Paracou6_2016,
#                                      topography = DTMParacou, verticalcreekheight  = DTMParacou,
#                                      speciescriteria = SpeciesCriteria,
#                                      volumeparameters = ForestZoneVolumeParametersTable,
#                                      scenario = "RIL2broken", specieslax = FALSE, objectivelax = TRUE,
#                                      crowndiameterparameters = ParamCrownDiameterAllometry,
#                                      advancedloggingparameters = loggingparameters(), iter = 1, cores = 1)
# loggingsummary1(RIL2broken_Rslt)
# RIL2broken_inventory <- RIL2broken_Rslt$inventory
# # Without diversification the harvestable volume is too poor
# # Not all harvestable trees are always harvested because they are eventually probed hollow, and there is not always a harvestable tree to replace them.
# RIL2_Rslt <- loggingsimulation(Paracou6_2016,
#                                topography = DTMParacou, verticalcreekheight  = DTMParacou,
#                                speciescriteria = SpeciesCriteria,
#                                volumeparameters = ForestZoneVolumeParametersTable,
#                                scenario = "RIL2", specieslax = FALSE, objectivelax = TRUE,
#                                crowndiameterparameters = ParamCrownDiameterAllometry,
#                                advancedloggingparameters = loggingparameters(), iter = 1, cores = 1)
# loggingsummary1(RIL2_Rslt)
# # Without diversification the harvestable volume is too poor
# RIL3_Rslt <- loggingsimulation(Paracou6_2016,
#                                topography = DTMParacou, verticalcreekheight  = DTMParacou,
#                                speciescriteria = SpeciesCriteria,
#                                volumeparameters = ForestZoneVolumeParametersTable,
#                                scenario = "RIL3", specieslax = FALSE, objectivelax = TRUE,
#                                crowndiameterparameters = ParamCrownDiameterAllometry,
#                                advancedloggingparameters = loggingparameters(), iter = 1, cores = 1)
# 
# RIL3_inventory <- RIL3_Rslt$inventory
# loggingsummary1(RIL3_Rslt)
# # With diversification the harvestable volume is much higher
# # but 30m3/ha is a too high objective for this plot size
# # Not all harvestable trees are always harvested because they are eventually probed hollow, and there is not always a harvestable tree to replace them.
# RIL3fuel_Rslt <- loggingsimulation(Paracou6_2016,
#                                    topography = DTMParacou, verticalcreekheight  = DTMParacou,
#                                    speciescriteria = SpeciesCriteria,
#                                    volumeparameters = ForestZoneVolumeParametersTable,
#                                    scenario = "RIL3fuel", specieslax = FALSE, objectivelax = TRUE,
#                                    crowndiameterparameters = ParamCrownDiameterAllometry,
#                                    advancedloggingparameters = loggingparameters(), iter = 1, cores = 1)
# loggingsummary1(RIL3fuel_Rslt)
# # Not all harvestable trees are always harvested because they are eventually probed hollow, and there is not always a harvestable tree to replace them.
# RIL3fuelhollow_Rslt <- loggingsimulation(Paracou6_2016,
#                                          topography = DTMParacou, verticalcreekheight  = DTMParacou,
#                                          speciescriteria = SpeciesCriteria,
#                                          volumeparameters = ForestZoneVolumeParametersTable,
#                                          scenario = "RIL3fuelhollow",
#                                          specieslax = FALSE, objectivelax = TRUE,
#                                          crowndiameterparameters = ParamCrownDiameterAllometry,
#                                          advancedloggingparameters = loggingparameters(),
#                                          iter = 1, cores = 1)
# RIL3fuelhollow_inventory <- RIL3fuelhollow_Rslt$inventory
# # loggingsummary1(RIL3fuelhollow_Rslt)

Results summary

Description: Returns a summary of the outputs of the loggingsimulation function (console display): a reminder of the inputs and the iterations statistics (mean, standard deviation, quantiles) of the outgoing figures.

data(LoggingSimulationOutputs) # Outputs of one logging simulation
data(LoggingSimulationOutputs_iter) # Outputs of one logging simulation (2 iterations and 2 cores)
loggingsummary1(LoggingSimulationOutputs)
loggingsummary(LoggingSimulationOutputs_iter) # Outputs of one logging simulation (2 iterations and 2 cores))

Decomposed harvesting

Check & format input inventory data for the "LoggingLab" package

Description: inventorycheckformat() checks if the input inventory data is compatible with the ‘LoggingLab’ package and returns the inventory if the inventory is in the required format or stop the function if the format is not the one required. cleaninventory()returns the inventory with only alive trees within the inventoried plot.

inventory <- inventorycheckformat(Paracou6_2016)
inventory <- cleaninventory(inventory, PlotMask, loggingparameters())

Compute tree dimensions

Description: Compute tree dimensions (tree, trunk and crown height, crown diameter, harvestable volume, wood density, and AGB)

inventory <- addtreedim(inventory, volumeparameters = ForestZoneVolumeParametersTable)

Main skidding trails opening

Description: Generates the main trail of the inventoried plot, as lines at the edge and outside of the plot.

MainTrails <- maintrailextract(DTMParacou)

# # To map a raster with ggplot : https://erinbecker.github.io/r-raster-vector-geospatial/02-raster-plot/index.html
# ## convert to a df for plotting in two steps,
# ## First, to a SpatialPointsDataFrame
# DTMParacou_pts <- rasterToPoints(DTMParacou, spatial = TRUE)
# ## Then to a 'conventional' dataframe
# DTMParacou_df  <- data.frame(DTMParacou_pts)


plot(DTMParacou)
plot(MainTrails, add = T)

Harvestable area definition

Description: Defines harvestable zones and machine-accessible zones within the plot.

By default, a prospecting unit is an area connected to a truck trail or a main skid trail, with a slope of less than 27%, avoiding lowlands and the water system (30 m buffer).

HarvestableAreaOutputs <- harvestableareadefinition(
  topography = DTMParacou,
  creekverticaldistance = CreekDistances$distvert,
  creekhorizontaldistance = CreekDistances$disthorz,
  maintrails = MainTrails,
  plotmask = PlotMask,
  scenario = "manual", winching = "1", # with an zone for cable only
  advancedloggingparameters = loggingparameters()
)
HarvestablePolygons <- HarvestableAreaOutputs$HarvestablePolygons
PlotSlope <- HarvestableAreaOutputs$PlotSlope
HarvestableArea <- HarvestableAreaOutputs$HarvestableArea
MachinePolygons <- HarvestableAreaOutputs$MachinePolygons

library(sf)
ggplot() +
  # Harvestable zones
  geom_sf(data = HarvestablePolygons,
          fill = "olivedrab", alpha = 0.1) +
  geom_sf(data = MachinePolygons,
          fill = "olivedrab", alpha = 0.5) +
  labs(alpha = "Harvestable") +
  labs(title = "Paracou P6 - Harvestable zones") +
  scale_colour_manual(values = c("Harvestable area" = "olivedrab"))

Tree selection

Description: Selects trees to harvest, and future and reserve trees.

Trees with visible defects are identified ('VisiblyDefectModel' in 'advancedloggingparameters' argument) and therefore not designated.

(Objective volume: If the user has chosen not to harvest hollow probed trees for energy ('RottenModel' in 'advancedloggingparameters' argument), 20-30% will be added to the objective volume in order to compensate for these designated hollow trees. If the user has chosen to harvest the hollow probed trees as fuel wood, he will harvest strictly his target volume, without bonus.)

Trees will be designated as "harvestable" if they: - belonging to species of 1st economic rank or more if diversification - DBH between the MinFD and the MaxFD. - not isolated ( >100m ('IsolateTreeMinDistance' in \code{\link{loggingparameters}})) from other individuals of the same species in the aggregative species case (\code{\link{SpeciesCriteria}}, 'Aggregative' column). - on slopes < 22% ('TreeMaxSlope'in \code{\link{loggingparameters}}) - off the main trails.

If the harvestable volume is higher than the objective volume, and that diversification was not chosen, MinFD of the 1st economic rank species only is increased. If the diversification is allowed, MinFD of 1st and 2nd economic level species is increased. Then, the trees to be harvested are chosen in decreasing order of volume, until the objective volume is reached.

If the harvestable volume is too low, diversification can be applied if it was not already applied ('specieslax') (trees of all commercial ranks are selected in decreasing order of volume until the objective volume is reached), or harvesting can continue despite an unreached objective volume, or be abandoned ('objectivelax')

Future trees will be: - species of 1st economic rank - DBH between 35cm ('FutureTreesMinDiameter') and the species MinFD or UpMinFD if it has been raised for its species. - in the harvestable zones

Reserve trees will be: - future trees - in the same number as trees to be harvested.

In 1 function

treeselectionoutputs <- treeselection(inventory,
                                      topography = DTMParacou,
                                      speciescriteria = SpeciesCriteria,
                                      scenario ="manual", objective = 20,
                                      fuel = "2", winching = "2",
                                      diversification = FALSE, specieslax = FALSE,
                                      objectivelax = TRUE,
                                      harvestablearea = HarvestableArea,
                                      plotslope = PlotSlope,maintrails = MainTrails,
                                      harvestablepolygons = HarvestablePolygons,
                                      advancedloggingparameters = loggingparameters())

Decomposed tree selection

Joins commercial criteria table

inventory <- commercialcriteriajoin(inventory, SpeciesCriteria)

Harvestable trees identification

Description: identifies harvestable trees among species of commercial interest, with exploitable diameters, then according to criteria of slope, distance to other conspecific individuals if the species is aggregative, and the absence of visible defects.

harvestableOutputs <- harvestable(inventory, topography = DTMParacou,
                                  diversification = TRUE, specieslax = FALSE,
                                  plotslope = PlotSlope,maintrails = MainTrails,
                                  harvestablepolygons = HarvestablePolygons,
                                  scenario = "manual", winching = "0",
                                  advancedloggingparameters = loggingparameters())
inventory <- harvestableOutputs$inventory
HVinit <- harvestableOutputs$HVinit

Trees to be exploited selection

Description: selects the trees to log among the exploitable trees, according to the objective volume and the exploitable volume on the plot.

inventory <- selected(inventory, topography = DTMParacou,
                      scenario = "manual", fuel = "2", diversification = TRUE,
                      VO = 125, HVinit = HVinit, specieslax = FALSE, objectivelax = TRUE,
                      advancedloggingparameters = loggingparameters())$inventory

Future & reserve trees designation

Description: designates which trees will be harvested in future seasons: "future trees", and which should be protected as seed trees: "reserve trees".

inventory <- futurereserve(inventory, SpeciesCriteria)

Secondary skidding trails layout

Description: Starting from the main skidding trails, draw secondary skidding trails on the zones accessible to the machines, allowing to collect the selected trees with the chosen machines ("winching" argument). The layout is optimised to reduce the distance covered while respecting topographical constraints and avoiding trees to protect.

Skidding trail (main, secondary): allows wood to be transported from the parcel to truck routes.

The secondary skidding trails are: - 4 m width ('ScndTrailWidth') - 22% maximum slope in length ('MaxTrailCenterlineSlope') - 4% maximum side slope (taken into account in the presence of LIDAR). ('MaxTrailCrossSlope') They avoid : - the trees to be logged - the trees with a DBH of more than 50 cm ('BigTrees') - the reserve trees. They join in priority: 1: groups in decreasing order of tree abundance 2: those with the shortest distance to the nearest track 3: avoiding future trees 4: minimising slopes in length and width.

RIL1/RIL2broken: trails go to the base of trees RIL2: cable only: trails go up to a maximum of 40 m ('CableLength') from trees. RIL3/RIL3 including fuel: grapple (trails with longitudinal slope <20% ('GrappleMaxslope')) (trails go up to 6 m ('GrappleLength') from the trees), and cable (trails go up to 40 m ('CableLength') from the trees) is used only when the longitudinal slope is greater than 20% or when the tree to be skidded is isolated from other trees to be exploited, from 6 to 40 m. If the crown is not accessible, it will not be harvested, only the trunk can be used in fuel wood.

If the number of trees connected to a secondary trail exceeds 20 (''), the secondary trail will take the characteristics (width) of a main trail.

Damage : - on the trail - on the edge of the trail: neglected.

ScndTrailOutputs <- secondtrailsopening(topography = DTMParacou,
                                        plotmask = PlotMask,
                                        maintrails = MainTrails,
                                        plotslope = HarvestableAreaOutputsCable$PlotSlope,
                                        harvestablepolygons = HarvestableAreaOutputsCable$HarvestablePolygons,
                                        machinepolygons = HarvestableAreaOutputsCable$MachinePolygons,
                                        treeselectionoutputs = treeselectionoutputs,
                                        scenario = "manual",
                                        winching = "2",
                                        fuel = "2",
                                        advancedloggingparameters = loggingparameters())

inventory <- ScndTrailOutputs$inventory
SmoothedTrails <- ScndTrailOutputs$SmoothedTrails
MainTrailsAccess <- ScndTrailOutputs$MainTrailsAccess
TrailsDensity <- ScndTrailOutputs$TrailsDensity
TrailsIdentity <- ScndTrailOutputs$TrailsIdentity
RawSecondTrails <- ScndTrailOutputs$RawSecondTrails
CostRasterAgg <- ScndTrailOutputs$CostRasterAgg


# pol1 <- list(matrix(c(286503, 582925,
#                       286503, 583240,
#                       286507, 583240,
#                       286507, 582925,
#                       286503, 582925) # the return
#                     ,ncol=2, byrow=TRUE))
# pol2 <- list(matrix(c(286650, 582925,
#                       286650, 583240,
#                       286654, 583240,
#                       286654, 582925,
#                       286650, 582925) # the return
#                     ,ncol=2, byrow=TRUE))
# 
# PolList = list(pol1,pol2) #list of lists of numeric matrices
# ScndTrail <- sf::st_as_sf(sf::st_sfc(sf::st_multipolygon(PolList)))
# ScndTrail <- sf::st_set_crs(ScndTrail, sf::st_crs(MainTrails))

Tree felling

Description: Simulates the tree felling, with the success or failure of the direction of the tree fall, foot to the trail, with an angle to the trail and avoiding the trees to protect, as desired. If FWE, the tree will be directed with its crown towards the trail (if the orientation is successful) if it can be retrieved with a grapple.

The felling of the tree creates a tree (including crown) on the ground, with dimensions calculated with specific allometries ('advancedloggingparameters').

RIL1/RIL2broken/RIL2: - at 40%: random fall - at 60% ('TreefallSuccessProportion'): base of the tree towards the nearest trail (main or 2ndary)

RIL3/RIL3 timber + fuel wood: - at 40%: random fall - at 60% ('TreefallSuccessProportion'): if RIL3 + fuel & trees < 6 m from the trail and slope <20% (grapple use): - no particular angle to orientate to the trail, only to orient the tree crown* as close as possible to the trail - priority 1: avoid futures and reserves, - priority 2: conformation allowing skidding back to the main trail

Damage: Secondary windfall: Not all trees under the felled tree (timber or energy) will be considered dead. The probability of a tree dying under a felled tree is estimated by the model 'Treefall2ndDeathModel', according to the DBH of the tree whose probability of dying is estimated.

In 1 function

inventory <- treefelling(inventory, scenario = "manual", fuel = "2",
                         winching = "2", directionalfelling = "2",
                         maintrailsaccess = MainTrailsAccess,
                         scndtrail = SmoothedTrails,
                         advancedloggingparameters = loggingparameters())

Adjusted secondary skidding trails layout (for fuel wood harvesting only (fuel = "1" or "2"))

Description: In the FWE (Fuel Wood Exploitation) case, the layout of the skidding trails is redefined to favour the recovery of trees through the crown (only with a grapple) in order to use the crowns for fuel wood.

ScndTrailAdjustOutputs <- secondtrailsadjusted(inventory = inventory,
                                               topography = DTMParacou,
                                               plotmask = PlotMask,
                                               maintrails = MainTrails,
                                               plotslope = PlotSlope,
                                               harvestablepolygons = HarvestablePolygons,
                                               machinepolygons = MachinePolygons,
                                               maintrailsaccess = MainTrailsAccess,
                                               scenario = "manual",
                                               winching = "2",
                                               advancedloggingparameters = loggingparameters())

inventory <- ScndTrailAdjustOutputs$inventory
AdjustSmoothedTrails <- ScndTrailAdjustOutputs$SmoothedTrails
AdjustTrailsDensity <- ScndTrailAdjustOutputs$TrailsDensity
AdjustTrailsIdentity <- ScndTrailAdjustOutputs$TrailsIdentity
AdjustRawSecondTrails <- ScndTrailAdjustOutputs$RawSecondTrails

Quantify the volumes achieved

By default, within a hollow tree, 2/3 of the log will be usable as timber, 1/3 as fuel wood ('TreeHollowPartForFuel'). For dead trees from the operation (skidding trails, secondary windfall), the whole trunk will be exploitable as fuel wood.

Compute the timber harvested volume

Description: Computes the timber harvested volume in healthy trees exploited for timber, and in the hollow trees if they are also harvested for fuel wood.

TimberV <- timberharvestedvolume(inventory, scenario = "manual", fuel = "2",
                                 advancedloggingparameters = loggingparameters())
inventory <- TimberV$inventory
TimberLoggedVolume <- TimberV$TimberLoggedVolume
NoHollowTimberLoggedVolume <- TimberV$NoHollowTimberLoggedVolume

Compute the exploitable fuel wood volume

Description: Computes the harvestable fuel wood biomass in healthy trees exploited for timber (their unused part), in the hollow trees and in the damage trees (caused by trails, secondary windfall). Computes also the the unused degraded tree biomass.

FuelV <- harvestablefuelwood(inventory, scenario = "manual", fuel = "2",
                             TimberLoggedVolume = TimberLoggedVolume,
                             NoHollowTimberLoggedVolume = NoHollowTimberLoggedVolume,
                             advancedloggingparameters = loggingparameters())
inventory <- FuelV$inventory
LoggingResidualBiomass <- FuelV$LoggingResidualBiomass
FuelWoodBiomass <- FuelV$FuelWoodBiomass

Outputs

Format: A large list of 39 elements

Numeric values:

Spatial objects:

POINTS:

INPUTS reminder:

Tool functions

'inventorycheckformat' check if the input inventory data is compatible with the "LoggingLab" package (see 'Required format of the inventory' section of the vignette)

'addtreedim' compute tree dimensions with the 'advancedloggingparameters' argument:
- Tree height (in m) ('TreeHeightAllometry')
- Tree Harvestable Volume (m^3) ('TreeHarvestableVolumeAllometry')
- Trunk height (in m) ('TrunkHeightAllometry')
- Crown height (in m)
- Crown diameter (in m) ('CrownDiameterAllometry')
- Wood density (g/cm^3) (by BIOMASS package)
- Tree above-ground biomass (AGB) (in Mg) (by BIOMASS package)

inventory <- addtreedim(inventorycheckformat(Paracou6_2016),
                        volumeparameters = ForestZoneVolumeParametersTable)

Get geometry

Converts a dataframe with a column of characters, which contains the WKT encoded geometries, into an sf object. The column is converted to sfc.

Create the canopy

'createcanopy' function return a dataframe with a column 'Crowns' containing the ellipses (sfc_POLYGON) as trees crown, with their diameter filled in, representing trees from the sky.

canopy <- createcanopy(inventory)

# The small ones first so that they are behind the big ones on the plot
canopy <- dplyr::arrange(canopy, TreeHeight)
ggplot() +
  geom_sf(data = getgeometry(canopy, Crowns),
          aes(alpha = TreeHeight),
          fill = "forestgreen") +
  labs(alpha = "Tree height")

1 tree from the sky

'createcanopy' function return an ellipse (sfc_POLYGON) as a crown, with its diameter filled in, representing the tree from the sky.

dat <- inventory %>% 
  filter(CrownDiameter == max(CrownDiameter))

Crown <- treefromthesky(dat)

ggplot() +
  geom_sf(data = sf::st_as_sf(inventory, coords = c("Xutm", "Yutm"))) +
  geom_sf(data = Crown, fill = "forestgreen") # trees polygons

directionalfellingsuccessdef felling1tree

Rotate a polygon

Rotate the input polygon with a given angle and around a fix point.

With: p a polygon (POLYGON or sfc_POLYGON) angle the angle in degrees in the clockwise direction (numeric) fixed a fix point around which the polygon will be rotated (POINT)

Function adapted from Jeffrey Evans' 'rotate.polygon' function: https://github.com/jeffreyevans/spatialEco/blob/master/R/rotate.polygon.R

NotAPol <- matrix(c(286503, 583134,
                    286503, 583240,
                    286507, 583240,
                    286507, 583134,
                    286503, 583134)
                  ,ncol=2, byrow=TRUE)
Pol <- sf::st_polygon(list(NotAPol))

Point <- sf::st_point(c(286505,583134))

Rslt <- rotatepolygon(p = Pol, angle = 10, fixed = Point)
plot(Rslt)

References



VincyaneBadouard/LoggingLab documentation built on Oct. 16, 2024, 9:42 p.m.