ForestGapR

ForestGapR: An R Package for Airborne Laser Scanning-derived Tropical Forest Gaps Analysis

https://github.com/carlos-alberto-silva/ForestGapR

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    3 of 7 committers (42.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

ForestGapR: An R Package for Airborne Laser Scanning-derived Tropical Forest Gaps Analysis

Basic Info
  • Host: GitHub
  • Owner: carlos-alberto-silva
  • Language: R
  • Default Branch: master
  • Size: 7.2 MB
Statistics
  • Stars: 30
  • Watchers: 6
  • Forks: 18
  • Open Issues: 5
  • Releases: 1
Created over 7 years ago · Last pushed over 2 years ago
Metadata Files
Readme

README.md


Github Github Rdoc licence R_Forge Downloads

ForestGapR: An R Package for Airborne Laser Scanning-derived Tropical Forest Gaps Analysis

Authors: Carlos Alberto, Ekena Rangel, Midhun Mohan, Danilo Roberti Alves de Almeida, Eben North Broadbent, Wan Shafrina Wan Mohd Jaafar, Adrian Cardil, Ruben Valbuena, Toby Jackson, Carine Klauberg, Caio Hamamura and Lucy Beese.

The GapForestR package provides functions to i) automate canopy gaps detection, ii) compute a series of forest canopy gap statistics, including gap-size frequency distributions and spatial distribution, iii) map gap dynamics (when multi-temporal ALS data are available), and iv) convert the data among spatial formats.

Installation

```r

The development version:

library(devtools) devtools::install_github("carlos-alberto-silva/ForestGapR")

The CRAN version:

install.packages("ForestGapR") ```

Getting Started

Forest Canopy Gap Detection

```r

Loading terra and viridis library

library(terra) library(viridis)

ALS-derived CHM over Adolpho Ducke Forest Reserve - Brazilian tropical forest

data(ALSCHMDUC)

Plotting chm

plot(ALSCHMDUC, col=viridis(10))

Setting height thresholds (e.g. 10 meters)

threshold<-10 size<-c(1,1000) # m2

Detecting forest gaps

gapsduc<-getForestGaps(chmlayer=ALSCHMDUC, threshold=threshold, size=size)

Plotting gaps

plot(gaps_duc, col="red", add=TRUE, main="Forest Canopy Gap", legend=FALSE) ```

Forest Canopy Gaps Stats

This function computes a series of forest canopy gap statistics

List of forest gaps statistics: #gapid: gap id; #gaparea - area of gap (m2); #chmmax - Maximum canopy height (m) within gap boundary; #chmmin - Minimum canopy height (m) within gap boundary; #chmmean - Mean canopy height (m) within gap boundary; #chmsd - Standard Deviation of canopy height (m) within gap boundary; #chm_range - Range of canopy height (m) within gap boundary

```r

Loading terra library

library(terra)

ALS-derived CHM over Adolpho Ducke Forest Reserve - Brazilian tropical forest

data(ALSCHMDUC)

Setting height thresholds (e.g. 10 meters)

threshold<-10 size<-c(5,1000) # m2

Detecting forest gaps

gapsduc<-getForestGaps(chmlayer=ALSCHMDUC, threshold=threshold, size=size)

Computing basic statistis of forest gap

gapsstats<-GapStats(gaplayer=gapsduc, chmlayer=ALSCHMDUC) ``` ## gapid gaparea chmmax chmmin chmmean chmsd chmgini chmrange ## 1 1 34 9.22 1.09 5.12 2.61 0.30 8.13 ## 2 2 6 8.17 6.06 7.40 0.74 0.06 2.11 ## 3 3 5 9.96 7.42 8.85 1.23 0.08 2.54 ## 4 4 32 9.91 4.42 8.12 1.69 0.12 5.49 ## 5 5 11 9.83 6.23 8.48 1.09 0.07 3.60 ## 6 6 44 9.72 1.92 7.31 1.60 0.12 7.80 ## 7 7 6 9.88 8.81 9.49 0.40 0.02 1.07 ## 8 8 6 9.07 3.10 7.02 2.96 0.22 5.97 ## 9 9 10 9.52 2.86 8.03 2.22 0.13 6.66 ## 10 10 18 9.90 2.74 5.06 2.18 0.23 7.16 ## 11 11 13 9.91 1.75 5.47 2.94 0.31 8.16 ## 12 12 10 9.92 3.75 7.77 2.27 0.16 6.17 ## 13 13 66 9.94 0.99 5.31 2.91 0.32 8.95 ## 14 14 7 10.00 5.83 7.41 1.53 0.12 4.17 ## 15 15 12 9.65 5.61 7.97 1.43 0.10 4.04 ## 16 16 7 8.64 5.64 7.67 0.97 0.07 3.00 ## 17 17 21 8.42 0.40 6.02 2.23 0.20 8.02 ## 18 18 6 7.39 3.37 5.03 1.82 0.21 4.02 ## 19 19 5 9.07 4.91 7.74 1.65 0.12 4.16 ## 20 20 36 9.90 2.10 6.62 2.45 0.21 7.80 ## 21 21 5 9.71 8.43 9.19 0.57 0.04 1.28 ## 22 22 12 9.83 7.42 8.39 0.85 0.06 2.41 ## 23 23 15 9.25 7.81 8.56 0.48 0.03 1.44 ## 24 24 27 9.43 0.26 2.37 2.55 0.56 9.17 ## 25 25 5 4.54 2.43 3.78 0.80 0.12 2.11 ## 26 26 7 9.98 6.34 8.40 1.07 0.07 3.64 ## 27 27 25 9.76 3.78 7.67 1.13 0.07 5.98 ## 28 28 6 9.49 4.92 7.23 1.56 0.13 4.57 ## 29 29 22 9.76 3.78 5.96 1.97 0.18 5.98 ## 30 30 6 5.73 2.69 4.46 1.28 0.17 3.04 ## 31 31 7 9.41 7.72 8.44 0.56 0.04 1.69 ## 32 32 57 9.89 1.97 5.70 2.62 0.26 7.92 ## 33 33 38 9.68 0.25 4.58 2.07 0.24 9.43 ## 34 34 8 9.83 4.88 6.55 1.54 0.13 4.95 ## 35 35 6 9.66 8.26 9.16 0.48 0.03 1.40

Forest Canopy Gap-size Frequency Distributions

```r

Loading terra library

library(terra)

ALS-derived CHM over Adolpho Ducke Forest Reserve - Brazilian tropical forest

data(ALSCHMDUC)

set height thresholds (e.g. 10 meters)

threshold<-10 size<-c(1,1000) # m2

Detecting forest gaps

gapsduc<-getForestGaps(chmlayer=ALSCHMDUC, threshold=threshold, size=size)

Computing basic statistis of forest gap

gapsstats<-GapStats(gaplayer=gapsduc, chmlayer=ALSCHMDUC)

Gap-size Frequency Distributions

GapSizeFDist(gapsstats=gapsstats, method="Hanel_2017", col="forestgreen", pch=16, cex=1, axes=FALSE,ylab="Gap Frequency",xlab=as.expression(bquote("Gap Size" ~ (m^2) ))) axis(1);axis(2) grid(4,4) ```

Forest Canopy Gaps as Spatial Polygons

```r

Loading terra and viridis libraries

library(terra) library(viridis)

ALS-derived CHM over Adolpho Ducke Forest Reserve - Brazilian tropical forest

data(ALSCHMDUC)

set height thresholds (e.g. 10 meters)

threshold<-10 size<-c(4,1000) # m2

Detecting forest gaps

gapsduc<-getForestGaps(chmlayer=ALSCHMDUC, threshold=threshold, size=size)

Converting SpatRaster layer to SpatialPolygonsDataFrame

gapsspdf<-GapSPDF(gaplayer=gaps_duc)

Plotting ALS-derived CHM and forest gaps

plot(ALSCHMDUC, col=viridis(10), xlim=c(173025,173125), ylim=c(9673100,96731200)) plot(gaps_spdf, add=TRUE, border="red", lwd=2) ```

```r

Populating the attribute table of Gaps_spdf with gaps statistics

gapsstats<-GapStats(gaplayer=gapsduc, chmlayer=ALSCHMDUC) gapsspdf<-merge(gapsspdf,gapsstats, by="gapid") head(gapsspdf@data) ``` ## gapid x y gaparea chmmax chmmin chmmean chmsd chmgini chm_range ## 1 1 173088.7 9673197 34 9.22 1.09 5.12 2.61 0.30 8.13 ## 10 10 173044.2 9673143 18 9.90 2.74 5.06 2.18 0.23 7.16 ## 11 11 173038.7 9673143 13 9.91 1.75 5.47 2.94 0.31 8.16 ## 12 12 173182.0 9673138 10 9.92 3.75 7.77 2.27 0.16 6.17 ## 13 13 173067.7 9673121 66 9.94 0.99 5.31 2.91 0.32 8.95 ## 14 14 173179.9 9673132 7 10.00 5.83 7.41 1.53 0.12 4.17

Forest Gap Change Detection

```r

Loading terra and viridis libraries

library(terra) library(viridis)

ALS-derived CHM from Fazenda Cauxi - Brazilian tropical forest

data(ALSCHMCAU2012) data(ALSCHMCAU2014)

set height thresholds (e.g. 10 meters)

threshold<-10 size<-c(1,1000) # m2

Detecting forest gaps

gapscau2012<-getForestGaps(chmlayer=ALSCHMCAU2012, threshold=threshold, size=size) gapscau2014<-getForestGaps(chmlayer=ALSCHMCAU2014, threshold=threshold, size=size)

Detecting forest gaps changes

Gapchanges<-GapChangeDec(gaplayer1=gapscau2012,gaplayer2=gaps_cau2014)

Plotting ALS-derived CHM and forest gaps

par(mfrow=c(1,3)) plot(ALSCHMCAU2012, main="Forest Canopy Gap - 2012", col=viridis(10)) plot(gapscau2012, add=TRUE, col="red", legend=FALSE)

plot(ALSCHMCAU2014, main="Forest Canopy Gap - 2014", col=viridis(10)) plot(gapscau2014, add=TRUE,col="blue", legend=FALSE)

plot(ALSCHMCAU2014,main="Forest Gaps Changes Detection",col=viridis(10)) plot(Gapchanges, add=TRUE, col="yellow", legend=FALSE) ```

Spatial Pattern of Forest Canopy Gaps

```r

Loading terra and viridis libraries

library(terra) library(viridis)

ALS-derived CHM from Fazenda Cauxi - Brazilian tropical forest

data(ALSCHMCAU2012) data(ALSCHMCAU2014)

set height thresholds (e.g. 10 meters)

threshold <- 10 size <- c(1,1000) # m2

Detecting forest gaps

gapscau2012 <- getForestGaps(chmlayer = ALSCHMCAU2012, threshold=threshold, size=size) gapscau2014 <- getForestGaps(chmlayer = ALSCHMCAU2014, threshold=threshold, size=size)

Converting raster layers to SpatialPolygonsDataFrame

gapscau2012spdf <- GapSPDF(gaplayer = gapscau2012) gapscau2014spdf <- GapSPDF(gaplayer = gapscau2014)

Spatial pattern analysis of each year

gapscau2012SpatPattern <- GapsSpatPattern(gapscau2012spdf, ALSCHMCAU2012) gapscau2014SpatPattern <- GapsSpatPattern(gapscau2014spdf, ALSCHMCAU2014) ```

Spatial Pattern in 2012

Clark-Evans test
No edge correction
Z-test

data:  P
R = 0.89312, p-value = 0.001022
alternative hypothesis: two-sided

Spatial Pattern in 2014

Clark-Evans test
No edge correction
Z-test

data:  P
R = 1.0596, p-value = 0.2688
alternative hypothesis: two-sided

References

Silva, C.A., Pinage,E., Mohan, M., Valbuena, R., Almeida, D., Broadbent,E., Jaafar, W., Papa, D., Cardil, A., Klauberg, C.2019. ForestGapR: An R Package for Airborne Laser Scanning-derived Tropical Forest Gaps Analysis. Methods Ecol Evolution. 10, 1347-1356 https://doi.org/10.1111/2041-210X.13211

Hanel,R., Corominas-Murtra, B., Liu, B., Thurner, S. Fitting power-laws in empirical data with estimators that work for all exponents,PloS one, vol. 12, no. 2, p. e0170920, 2017.https://doi.org/10.1371/journal.pone.0170920

Asner, G.P., Kellner, J.R., Kennedy-Bowdoin, T., Knapp, D.E., Anderson, C. & Martin, R.E. 2013. Forest canopy gap distributions in the Southern Peruvian Amazon. PLoS One, 8, e60875. https://doi.org/10.1371/journal.pone.0060875

White, E.P, Enquist, B.J, Green, J.L. (2008) On estimating the exponent of powerlaw frequency distributions. Ecology 89,905-912. https://doi.org/10.1890/07-1288.1

Sustainable Landscape Brazil. 2018. https://www.paisagenslidar.cnptia.embrapa.br/webgis/. (accessed in August 2018).

Acknowledgements

ALS data from Adolfo Ducke (ALSCHMDUC) Forest Reserve and Cauaxi Forest (ALSCHMCAU2012 and ALSCHMCAU2014) used as exemple datasets were acquired by the Sustainable Landscapes Brazil project supported by the Brazilian Agricultural Research Corporation (EMBRAPA), the US Forest Service, USAID, and the US Department of State.

Owner

  • Name: Carlos Alberto Silva
  • Login: carlos-alberto-silva
  • Kind: user
  • Company: University of Florida

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 174
  • Total Committers: 7
  • Avg Commits per committer: 24.857
  • Development Distribution Score (DDS): 0.46
Past Year
  • Commits: 48
  • Committers: 3
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.104
Top Committers
Name Email Commits
Carlos Alberto Silva c****l@o****m 94
Lucy Beese 1****e 43
Caio Hamamura c****a@g****m 21
rubenvalpue r****4@c****k 7
atkinsjeff j****6@v****u 4
Rubén Valbuena r****a@b****k 4
Attilio Benini a****i@g****t 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 4
  • Total pull requests: 23
  • Average time to close issues: 23 days
  • Average time to close pull requests: 12 days
  • Total issue authors: 4
  • Total pull request authors: 5
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.22
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mcgregorian1 (1)
  • spono (1)
  • FloFranz (1)
  • niekkoelewijn (1)
Pull Request Authors
  • rubenvalpue (11)
  • lucybeese (7)
  • a-benini (5)
  • atkinsjeff (2)
  • rubak (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads: unknown
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 16
proxy.golang.org: github.com/carlos-alberto-silva/ForestGapR
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 10 months ago
proxy.golang.org: github.com/carlos-alberto-silva/forestgapr
  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4.0 depends
  • VGAM * imports
  • graphics * imports
  • igraph * imports
  • poweRlaw * imports
  • raster * imports
  • sp * imports
  • spatstat.explore * imports
  • spatstat.geom * imports
  • stats * imports
  • viridis * imports