treefelling: Tree felling

Description Usage Arguments Details Value Examples

View source: R/treefelling.R

Description

Tree felling

Usage

1
2
3
4
5
6
7
8
9
treefelling(
  inventory,
  scenario,
  fuel = NULL,
  directionalfelling = NULL,
  MainTrail,
  ScndTrail,
  advancedloggingparameters = loggingparameters()
)

Arguments

inventory

Input inventory (see the inputs formats and metadata in the vignette) (data.frame)

scenario

Logging scenario: "RIL1", "RIL2broken", "RIL2", "RIL3", "RIL3fuel", "RIL3fuelhollow" or "manual"(character) (see the vignette)

fuel

Fuel wood exploitation: no exploitation = "0", exploitation of damage and unused part of logged trees for fuel = "1", exploitation of hollow trees, damage and and unused part of the log for fuel = "2"

directionalfelling

Directional felling = "0" (absent), "1" (only to avoid damage to future and reserve trees), "2" (to avoid damage to future and reserve trees and to position the log relative to the track)

MainTrail

Main trail (sfg)

ScndTrail

Secondary trails (sfg)

advancedloggingparameters

Other parameters of the logging simulator loggingparameters (list)

Details

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

RIL1: random fall

RIL2broken/RIL2:

RIL3/RIL3 timber + fuel wood:

Damage: Secondary windfall: all trees under the felled tree (timber or energy) will be considered dead.

Value

Input inventory with new columns:

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
## Not run: 
MainTrail <- sf::st_linestring(matrix(c(286400, 583130,
                                        286400, 583250,
                                        286655, 583250,
                                        286655, 583130,
                                        286400, 583130) # the return
                                     ,ncol=2, byrow=TRUE))

pol1 <- list(matrix(c(286503, 583134,
                      286503, 583240,
                      286507, 583240,
                      286507, 583134,
                      286503, 583134) # the return
                   ,ncol=2, byrow=TRUE))
pol2 <- list(matrix(c(286650, 583134,
                      286650, 583240,
                      286654, 583240,
                      286654, 583134,
                      286650, 583134) # the return
                   ,ncol=2, byrow=TRUE))

PolList = list(pol1,pol2) #list of lists of numeric matrices
ScndTrail <- sf::st_multipolygon(PolList)

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

inventory <- suppressMessages(treeselection(inventory, objective = 20,
 scenario ="manual", fuel = "2", diversification = TRUE, specieslax = FALSE,
 objectivelax = TRUE, topography = DTMParacou, plotslope = PlotSlope,
 speciescriteria = SpeciesCriteria,
 advancedloggingparameters = loggingparameters())$inventory)

NewInventory <- treefelling(inventory, scenario = "manual", fuel = "0",
directionalfelling = "2", MainTrail = MainTrail, ScndTrail = ScndTrail,
advancedloggingparameters = loggingparameters())

Treefall <- NewInventory %>%
   dplyr::filter(DeathCause == "treefall2nd")

NonHarvestable <- sf::st_as_sf(
dplyr::filter(NewInventory, LoggingStatus == "non-harvestable"),
coords = c("Xutm", "Yutm"))

Harvestable <- sf::st_as_sf(
dplyr::filter(NewInventory, LoggingStatus == "harvestable"),
coords = c("Xutm", "Yutm"))

HarvestableUp <- sf::st_as_sf(
dplyr::filter(NewInventory, LoggingStatus == "harvestableUp"),
coords = c("Xutm", "Yutm"))

Selected <- sf::st_as_sf(
dplyr::filter(NewInventory, Selected == "1"), coords = c("Xutm", "Yutm"))

Reserve <- sf::st_as_sf(
dplyr::filter(NewInventory, LoggingStatus == "reserve"),
coords = c("Xutm", "Yutm"))

Future <- sf::st_as_sf(
dplyr::filter(NewInventory, LoggingStatus == "future"),
coords = c("Xutm", "Yutm"))

ProbedHollow <- sf::st_as_sf(
dplyr::filter(NewInventory, ProbedHollow == "1"), coords = c("Xutm", "Yutm"))

VisibleDefect <- sf::st_as_sf(
dplyr::filter(NewInventory, VisibleDefect == "1"), coords = c("Xutm", "Yutm"))

library(ggplot2)
ggplot() +
  geom_sf(data = sf::st_as_sf(NewInventory, coords = c("Xutm", "Yutm"))) +
  geom_sf(data = NonHarvestable,
  aes(colour = "Non-harvestable"), show.legend = "point") +
  geom_sf(data = VisibleDefect,
  aes(colour = "Visible defect"), show.legend = "point") +
  geom_sf(data = Future,
  aes(colour = "Future"), show.legend = "point", size = 4) +
  geom_sf(data = Reserve,
  aes(colour = "Reserve"), show.legend = "point", size = 4) +
  geom_sf(data = Harvestable,
  aes(colour = "Harvestable"), show.legend = "point", size = 4) +
  geom_sf(data = HarvestableUp,
  aes(colour = "HarvestableUp"), show.legend = "point", size = 4) +
  geom_sf(data = getgeometry (NewInventory, TreePolygon), # cuted trees
  alpha = 0.5, fill = "red") +
  geom_sf(data = Selected, aes(colour = "Selected"), show.legend = "point") +
  geom_sf(data = ProbedHollow,
  aes(colour = "Probed hollow"), show.legend = "point") +

  scale_colour_manual(values = c("Non-harvestable" = "grey",
  "Visible defect" = "pink", "Harvestable" = "skyblue",
  "HarvestableUp" = "blue", "Selected" = "red", "Future" = "orange",
  "Reserve" = "purple", "Probed hollow" = "forestgreen")) +
  labs(color = "Logging status")


sf::st_intersection( # trees under the fallen trees
  getgeometry (inventory, TreePolygon),
  sf::st_as_sf(inventory, coords = c("Xutm", "Yutm"))
) %>%
  ggplot() +
  geom_sf()

## End(Not run)

thomasgaquiere/Maria documentation built on Dec. 24, 2021, 1:20 a.m.