GapChangeDec: Forest Gaps Change Detection

Description Usage Arguments Value Author(s) Examples

View source: R/GapsChangesDec.R

Description

This function detects forest canopy gap changes across two forest gap RasterLayer (raster) objects

Usage

1
GapChangeDec(gap_layer1,gap_layer2)

Arguments

gap_layer1

ALS-derived gap as an RasterLayer (raster) object at time 1. (output of getForestGaps function).

gap_layer2

ALS-derived gap as an RasterLayer (raster) object at time 2. (output of getForestGaps function).

Value

A RasterLayer (raster) object representing forest gap change area

Author(s)

Carlos Alberto Silva.

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
## Not run: 
#Loading raster and viridis libraries
library(raster)
library(viridis)

# ALS-derived CHM from Fazenda Cauxi - Brazilian tropical forest
data(ALS_CHM_CAU_2012)
data(ALS_CHM_CAU_2014)

# set height thresholds (e.g. 10 meters)
threshold<-10
size<-c(1,10^4) # m2

# Detecting forest gaps
gaps_cau2012<-getForestGaps(chm_layer=ALS_CHM_CAU_2012, threshold=threshold, size=size)
gaps_cau2014<-getForestGaps(chm_layer=ALS_CHM_CAU_2014, threshold=threshold, size=size)

# Detecting forest gaps changes
Gap_changes<-GapChangeDec(gap_layer1=gaps_cau2012,gap_layer2=gaps_cau2014)

# Plotting ALS-derived CHM and forest gaps
par(mfrow=c(1,3))
plot(ALS_CHM_CAU_2012, main="Forest Canopy Gap - 2012", col=viridis(10))
plot(gaps_cau2012, add=TRUE, col="red", legend=FALSE)

plot(ALS_CHM_CAU_2014,  main="Forest Canopy Gap - 2014", col=viridis(10))
plot(gaps_cau2014, add=TRUE,col="red", legend=FALSE)

plot(ALS_CHM_CAU_2014,main="Forest Gap Changes Detected",col=viridis(10))
plot(Gap_changes, add=TRUE, col="orange", legend=FALSE)

## End(Not run)

ForestGapR documentation built on May 2, 2019, 1:26 a.m.