The fusionwrapr package provides functions to construct command lines for some of the FUSION command line tools. FUSION is a package of programs that operate on LIDAR data. Use of the fusionwrapr package requires a working installation of FUSION. For installation details and FUSION documentation, go here.
To read LAZ format files, the LASzxip.dll and LASzip64.dll files must be copied from an installed version of LAStools into the FUSION install folder. Without these files, FUSION programs cannot read LAZ files.
The FUSION install folder should also be added to the PATH environment variable. The FUSION manual has links to instructions to do this. If you choose not to add the FUSION install folder to the PATH, you will need to call setFUSIONpath() with the name of the FUSION install folder early in your code so the FUSION executables can be found and run.
In addition to interfaces to FUSION command line tools, fusionwrapr provides some handy functions to simply tasks common when working with LIDAR data. There are function to read/write FUSION’s .dtm format and a function to read FUSION’s .lda point data format files.
~~You can install the released version of fusionwrapr from CRAN with:~~
fusionwrapr is distributed as a development version and is not available (yet) on CRAN.
#install.packages("fusionwrapr")
Install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("bmcgaughey1/fusionwrapr")
This is a basic example which shows you how to solve a common problem:
library(fusionwrapr)
## basic example code
# set FUSION install path...not needed if the FUSION install folder has been added to PATH
#setFUSIONpath("C:/FUSION")
# create ground model using class 2 points
GridSurfaceCreate("Test/test.dtm", 1.0, "M", "M", 1, 10, 2, 2, "Test/pts.laz", class = 2)
# normalize point data...takes advantage of defaults for min/max to process entire file
ClipData("Test/pts.laz", "Test/pts_normalized.laz", height= TRUE, ground = "Test/test.dtm")
# compute metrics using points above 2m
CloudMetrics("Test/pts_normalized.laz", "Test/metrics.csv", new = TRUE, minht = 2.0, above = 2.0)
# compute gridded metrics
GridMetrics("Test/test.dtm", 2, 5, "Test/gridded_metrics.csv", "Test/pts.laz", minht = 2)
# clip data for a plot
ClipPlot("Test/pts.laz", "Test/Plot_001.laz", 523650, 4667650, 15, 1, height= TRUE, ground = "Test/test.dtm")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.