When I try to perform the conditional tools "wbt_conditional_evaluation" in R, I get this message error :
Error running WhiteboxTools (conditional_evaluation)
whitebox.exe_path: "C:/R/R-4.1.1/library/whitebox/WBT/whitebox_tools.exe"; File exists? TRUE
Arguments: --run=conditional_evaluation --input="./acc_mean_mod_bol.tif" --output="./acc_mean_R_max.tif" --statement=value == 1 --true=./acc_mean_R_mod.tif --false=./acc_mean_R.tif --compress_rasters=FALSE -v --max_procs=-1
System command had status 101
conditional_evaluation - Elapsed Time: NA [did not run] "
Here the parameters :
wbt_conditional_evaluation(input = "./acc_mean_mod_bol.tif",
statement = "value == 1",
true = "./acc_mean_R_mod.tif",
false = "./acc_mean_R.tif",
output = "./acc_mean_R_max.tif")
The true and false inputs are flow accumulation rasters.
I use this tool to create the bolean raster (acc_mean_mod_bol.tif)
wbt_greater_than(input1 = "./acc_mean_R_mod.tif",
input2 = "./acc_mean_R.tif",
output = "./acc_mean_R_mod_bol.tif")
Does anyone know what I'm doing wrong? And is there a way to summarise these two operations by only using the function "wbt_raster_calculator". I'm trying to do this equivalent operation in ArcGIS raster calculator:
Con("acc_mean_R_mod.tif" > "acc_mean_R.tif","acc_mean_R_mod.tif","acc_mean_R.tif")
--statement=value == 1
in the command. Can you try it withstatement = "value==1"
in the R call (that is, no spaces inside the quotation marks)? If that works I'll write up an answer, if it doesn't work you might need to make a reproducible example.whitebox
R package from github and let it get the WBT tools package it wanted. Still failed. If you can edit the reproducible example into your Q its probably worth posting an issue to their issue tracker: github.com/giswqs/whiteboxR/issues