Comments (2)
I am guessing you may be using Whitebox via the R package based on the syntax/function names
when I donβt specify the argument, the output rasters seem to lineup to the compress_rasters=TRUE output
I think this is because WhiteboxTools ships with a settings.json file that sets compress_rasters=TRUE
. The R package behavior is to not add most "missing" arguments. This is to allow users to utilize settings.json and package options to control these settings (verbosity, working directory, compression, cores).
You can set the R package up to automatically supply --compress_rasters=FALSE
(and update settings.json) by calling wbt_compress_rasters(FALSE)
The documentation for the R package and the default values of arguments would suggest that some tools have FALSE as default, but ultimately if the argument is not passed to the R function then it is not considered in constructing the command, so Whitebox then uses values existing in settings.json.
While there is some documentation of this behavior in the R package, the individual functions do not reference the possibility that their defaults may be overridden by other settings. I have recently been thinking about some ways to improve the R package documentation detail, and some better explanation about how arguments to functions v.s. whiteboxtools options may be warranted there. If you are having issues with the R documentation, could you please post an issue on that repository? https://github.com/opengeos/whiteboxR/issues/
Consider this example:
library(whitebox)
settings_json <- file.path(dirname(wbt_exe_path(shell_quote = FALSE)), "settings.json")
file.remove(settings_json)
#> [1] TRUE
# fresh install of whitebox
install_whitebox()
#> Performing one-time download of WhiteboxTools binary from
#> https://www.whiteboxgeo.com/WBT_Linux/WhiteboxTools_linux_amd64.zip
#> (This could take a few minutes, please be patient...)
#> WhiteboxTools binary is located here: /home/andrew/.local/share/R/whitebox/WBT/whitebox_tools
#> You can now start using whitebox
#> library(whitebox)
#> wbt_version()
# default compress_rasters=TRUE
settings_json |>
jsonlite::read_json()
#> $verbose_mode
#> [1] TRUE
#>
#> $working_directory
#> [1] ""
#>
#> $compress_rasters
#> [1] TRUE
#>
#> $max_procs
#> [1] -1
wbt_slope(sample_dem_data(), "before.tif")
# set R package to pass --compress_rasters=FALSE
wbt_compress_rasters(FALSE)
wbt_slope(sample_dem_data(), "after.tif")
# now "after.tif" is not compressed, and no compress_rasters argument is passed to wbt_slope()
file.size("before.tif")
#> [1] 171274
file.size("after.tif")
#> [1] 180172
# as wbt_slope runs with the new compress_rasters option, the settings.json file is updated
settings_json |>
jsonlite::read_json()
#> $verbose_mode
#> [1] TRUE
#>
#> $working_directory
#> [1] ""
#>
#> $compress_rasters
#> [1] FALSE
#>
#> $max_procs
#> [1] -1
from whitebox-tools.
Thanks @brownag, I'll take a look at the json settings. You are correct, I was using the R package for whiteboxtools. Apologies for posting in the general repository, if I have any follow ups I'll follow up in the whiteboxR repo
from whitebox-tools.
Related Issues (20)
- Bug with IndividualTreeDetection detecting trees very close together HOT 5
- ClipLidarToPolygon is modifying retained point data HOT 1
- Geomorphons - edge effects and difficulties in geographic coordinates
- WhiteboxWorkflows: kernel dies if file not found
- whitebox.Runner() urllib.error.URLError: <urlopen error unknown url type: https> HOT 1
- whitebox_tools 'Unrecognized tool name NormalizeLidar' HOT 16
- Whitebox-Worflows: Erroneous results when using raster files in NAD83 projection HOT 1
- DTM outputs have a shift between tiles HOT 3
- lidar_digital_surface_model extent changed HOT 1
- Feature Requests: lidar_digital_surface_model HOT 2
- FlowAccumulationFullWorkflow gracefully exits without writing all 3 results
- documentation of PercentElevRange
- [feature request] add option to use D-infinity pointer grid in ElevationAboveStream
- "extract_by_attribute" tool missing from "whitebox_tools.py" (?) HOT 3
- TimeInDayLight - error when calculating local almanac
- WhiteboxWorkflows: Filters based on DEM reading not working
- Arc::try_unwrap fails intermittently during breach_depressions_least_cost
- LidarThinHighDensity throw "panicked at 'index out of bounds:'" depending on the resolution
- Unable to instance WhiteBoxTools in 2.3.1 HOT 7
- Vector Stream Network Analysis argument mismatch in documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whitebox-tools.