How it works
Getting WhiteboxTools
Whitebox.jl depends on the WhiteboxTools_jll.jl package to provide a build of WhiteboxTools.
The WhiteboxTools_jll.jl repo says:
"This is an autogenerated package constructed using BinaryBuilder.jl. The originating build_tarballs.jl script can be found on Yggdrasil, the community build tree. If you have any issue, please report it to the Yggdrasil bug tracker.
For more details about JLL packages and how to use them, see BinaryBuilder.jl documentation."
Setting defaults
Loading the Whitebox.jl package will automatically create an object containing info about default parameters, the working directory, and location of WhiteboxTools.
This object is called wbt_info
, and it is a struct of type WhiteboxTools.
Users can use dump
to view all its info:
dump(wbt.wbt_info)
# Whitebox.WhiteboxTools
# exe_name: String "whitebox_tools"
# exe_path: String "/Users/.../bin/whitebox_tools"
# work_dir: String "/Users/...your_wd"
# verbose: Bool true
# cancel_op: Bool false
# default_callback: default_callback (function of type typeof(Whitebox.default_callback))
# start_minimized: Bool false
# __compress_rasters: Bool false
Every function in the Whitebox.jl package requires an object of type WhiteboxTools, and every function uses the wbt_info
object as the default.
To change the default settings of the WhiteboxTools program for your session, you should change them using the provided functions.
For example:
wbt.set_verbose_mode(false)
Generating functions
Most of the functions in this package were generated using the included whitebox_plugin_generator.py
. This file was adapted from the file of the same name in the WhiteboxTools repo
Using a python script was intentional so that future updates or added functions could be generated from the Python package.
Some additional changes to the generated functions were required:
wbt.multiscale_topographic_position_image
: changedlocal
input argument references tolocalrast
.local
is a reserved word for Julia.wbt.conditional_evaluation
:true
andfalse
input arguments were changed toTrue
andFalse
.