diff --git a/404.html b/404.html index b2d451f47..9a80cc5cb 100644 --- a/404.html +++ b/404.html @@ -32,7 +32,7 @@
diff --git a/LICENSE-text.html b/LICENSE-text.html index fba230f13..e43704bc3 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -17,7 +17,7 @@ diff --git a/articles/datasets.html b/articles/datasets.html index 189be9796..7e515eef4 100644 --- a/articles/datasets.html +++ b/articles/datasets.html @@ -33,7 +33,7 @@ diff --git a/articles/demo.html b/articles/demo.html index 94c9a9431..2267a874e 100644 --- a/articles/demo.html +++ b/articles/demo.html @@ -33,7 +33,7 @@ @@ -161,7 +161,7 @@
library(terra)
-#> terra 1.7.49
+#> terra 1.7.60
library(whitebox)
# DEMO: calculate slope with WhiteboxTools and raster
@@ -216,7 +216,7 @@ Working with Raster Data
# the SpatRaster retains a reference to the input file name
terra::sources(outputras)
-#> [1] "/tmp/RtmpSJEAgR/slope.tif"
For more info see: ?wbt_breach_depressions
These wbt_*_tool_name_*()
functions are wrappers around
the wbt_run_tool()
function that does the
@@ -422,7 +422,7 @@
The above method of creating
wbt_breach_depressions(dem = ..., output = ...)
to handle
wbt_run_tool("BreachDepressions", args = ...)
makes it easy
@@ -452,7 +452,7 @@
wbt_breach_
# run breach_depressions tool
wbt_breach_depressions(dem = input, output = output)
-#> breach_depressions - Elapsed Time (excluding I/O): 0.8s
+#> breach_depressions - Elapsed Time (excluding I/O): 0.7s
terra
@@ -520,7 +520,7 @@ This is just an example of the wealth of tool options made available by the WhiteboxTools platform.
Whether a system call succeeds or fails the parameters that were passed to the WhiteboxTools executable and references to any output file paths that were specified are returned. If output files reference @@ -163,7 +163,7 @@
When a call fails an informative error message issued, and the error @@ -182,8 +182,8 @@
str(wbt("slope", dem = dem, output = file.path(tempdir(), "slope.tif")), max.level = 1)
#> List of 6
#> $ tool : chr "Slope"
-#> $ args : chr "--dem=/home/runner/work/_temp/Library/whitebox/extdata/DEM.tif --output=/tmp/RtmpkuumGv/slope.tif"
-#> $ stdout : chr "Slope - Elapsed Time (excluding I/O): 0.12s"
+#> $ args : chr "--dem=/home/runner/work/_temp/Library/whitebox/extdata/DEM.tif --output=/tmp/RtmpNwFzga/slope.tif"
+#> $ stdout : chr "Slope - Elapsed Time (excluding I/O): 0.8s"
#> $ crs : chr ""
#> ..- attr(*, "package")= Named chr ""
#> .. ..- attr(*, "names")= chr "dem"
@@ -254,14 +254,6 @@ Compare ras
class(r1$result$output)
}
#> Loading required namespace: raster
-#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
-#> which was just loaded, will retire in October 2023.
-#> Please refer to R-spatial evolution reports for details, especially
-#> https://r-spatial.org/r/2023/05/15/evolution4.html.
-#> It may be desirable to make the sf package available;
-#> package maintainers should consider adding sf to Suggests:.
-#> The sp package is now running under evolution status 2
-#> (status 2 uses the sf package in place of rgdal)
#> [1] "RasterLayer"
#> attr(,"package")
#> [1] "raster"
@@ -273,8 +265,8 @@ Compare ras
t1
#> <wbt_result>
#> --- PARAMETERS (Slope) ---
-#> dem : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40792c975be9.tif'
-#> output : '/tmp/RtmpkuumGv/slope.tif'
+#> dem : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40b5600a0d09.tif'
+#> output : '/tmp/RtmpNwFzga/slope.tif'
#> --- RESULT ---
#> $output
#> class : SpatRaster
@@ -322,7 +314,7 @@
via wbt_source()
. The result is a SpatVectorProxy.
library(terra)
-#> terra 1.7.49
+#> terra 1.7.60
shp <- system.file("ex/lux.shp", package = "terra")
x <- wbt_source(shp)
x
@@ -353,7 +345,7 @@
# create a GeoPackage
terra::writeVector(x2, filename = file.path(tempdir(), "lux.gpkg"), overwrite = TRUE)
#> Warning in x@cpp$write(filename, layer, filetype, insert[1], overwrite[1], :
-#> GDAL Message 6: dataset /tmp/RtmpkuumGv/lux.gpkg does not support layer
+#> GDAL Message 6: dataset /tmp/RtmpNwFzga/lux.gpkg does not support layer
#> creation option ENCODING
# now the source is a temporary .shp
@@ -362,15 +354,15 @@
wbt("polygon_area", input = x3)
#> <wbt_result>
#> --- PARAMETERS (PolygonArea) ---
-#> input : '/tmp/RtmpkuumGv/lux.gpkg_file407911809ed.shp'
+#> input : '/tmp/RtmpNwFzga/lux.gpkg_file40b511298923.shp'
#> --- RESULT ---
#> $output
#> class : SpatVectorProxy
#> geometry : polygons
#> dimensions : 12, 6 (geometries, attributes)
#> extent : 5.826232, 6.16085, 49.94611, 50.18162 (xmin, xmax, ymin, ymax)
-#> source : lux.gpkg_file407911809ed.shp
-#> layer : lux.gpkg_file407911809ed
+#> source : lux.gpkg_file40b511298923.shp
+#> layer : lux.gpkg_file40b511298923
#> coord. ref. : lon/lat WGS 84 (EPSG:4326)
#> names : ID_1 NAME_1 ID_2 NAME_2 POP AREA
#> type : <num> <chr> <num> <chr> <int> <num>
@@ -413,11 +405,11 @@ Using pipesx2
#> <wbt_result>
#> --- PARAMETERS (Slope) ---
-#> dem : '//tmp/RtmpkuumGv/slope.tif'
-#> output : '/tmp/RtmpkuumGv/curvature.tif'
+#> dem : '//tmp/RtmpNwFzga/slope.tif'
+#> output : '/tmp/RtmpNwFzga/curvature.tif'
#> --- RESULT ---
#> $output
-#> File result: //tmp/RtmpkuumGv/curvature.tif exists (Last modified: 2023-10-03 14:16:12.584033)
+#> File result: //tmp/RtmpNwFzga/curvature.tif exists (Last modified: 2023-11-17 05:21:56.943561)
#> --- HISTORY ---
#> Prior results (n=1) for: Slope
#> - Slope (output<character>)
@@ -426,7 +418,7 @@ Using pipes
str(wbt_result(x2), max.level = 1)
-#> chr [1:2] "//tmp/RtmpkuumGv/slope.tif" "//tmp/RtmpkuumGv/curvature.tif"
+#> chr [1:2] "//tmp/RtmpNwFzga/slope.tif" "//tmp/RtmpNwFzga/curvature.tif"
The $history
element is a list of the
wbt_result
from individual runs.
@@ -458,7 +450,7 @@Using pipes#> - [ ] units -- Units of output raster; options include 'degrees', 'radians', 'percent' #> <wbt_result> #> --- PARAMETERS (Slope) --- -#> output : '/tmp/RtmpkuumGv/foo.tif' +#> output : '/tmp/RtmpNwFzga/foo.tif' #> #> Slope ERROR: 'dem' required #> --- HISTORY --- @@ -512,8 +504,8 @@
Setting the CRSwbt("slope", dem = araster, output = file.path(tempdir(), "foo.tif")) #> <wbt_result> #> --- PARAMETERS (Slope) --- -#> dem : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file4079522beb49.tif' -#> output : '/tmp/RtmpkuumGv/foo.tif' +#> dem : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40b572422259.tif' +#> output : '/tmp/RtmpNwFzga/foo.tif' #> --- RESULT --- #> $output #> class : SpatRaster @@ -531,8 +523,8 @@
Setting the CRSwbt("slope", dem = terra::rast(dem), crs = "EPSG:26918", output = file.path(tempdir(), "foo.tif")) #> <wbt_result> #> --- PARAMETERS (Slope) --- -#> dem : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file407920bdbf20.tif' -#> output : '/tmp/RtmpkuumGv/foo.tif' +#> dem : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40b52f610c9.tif' +#> output : '/tmp/RtmpNwFzga/foo.tif' #> --- RESULT --- #> $output #> class : SpatRaster @@ -561,9 +553,9 @@
Setting the CRS#> NOTE: Input CRS do not match. #> <wbt_result> #> --- PARAMETERS (Add) --- -#> input1 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file407953c783b2.tif' -#> input2 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40794fd192a2.tif' -#> output : '/tmp/RtmpkuumGv/foo.tif' +#> input1 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40b53744c645.tif' +#> input2 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40b553485021.tif' +#> output : '/tmp/RtmpNwFzga/foo.tif' #> --- RESULT --- #> $output #> class : SpatRaster @@ -586,9 +578,9 @@
Setting the CRS ) #> <wbt_result> #> --- PARAMETERS (Add) --- -#> input1 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file4079f8189ae.tif' -#> input2 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file4079746bcdd3.tif' -#> output : '/tmp/RtmpkuumGv/foo.tif' +#> input1 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40b577265204.tif' +#> input2 : '/home/runner/work/whiteboxR/whiteboxR/vignettes/file40b57a2901ba.tif' +#> output : '/tmp/RtmpNwFzga/foo.tif' #> --- RESULT --- #> $output #> class : SpatRaster diff --git a/authors.html b/authors.html index 42803c169..14dc0b18d 100644 --- a/authors.html +++ b/authors.html @@ -17,7 +17,7 @@
NEWS.md
+ wbt_file_path()
, a function previously used internally for creating safe, expanded, quoted, paths for building WhiteboxTools commands.The default values for compress_rasters
and verbose_mode
have been set to NULL to better reflect that they are derived from the WhiteboxTools settings.json file.
The default values for compress_rasters
and verbose_mode
have been set to NULL
to better reflect that they are derived from the WhiteboxTools settings.json file.
wbt_options()
for more details. If the user specifies these arguments in a wbt_*()
function call then the flag will be passed in the command line call. Otherwise the default NULL
value is ignored. Links to the corresponding option-setting functions have been added to the documentation for all wbt_*()
tool functions.Activate 'WhiteboxTools' Extensions
Prepare File Paths for WhiteboxTools Commands
Performs path expansion with path.expand()
and shell quotes with shQuote()
the input paths.
wbt_file_path(x, shell_quote = TRUE, delimiter = ",", check_exists = FALSE)
character. Vector of file paths or strings of file paths for passing as arguments to WhiteboxTools.
logical. Shell quotes around result? Default: TRUE
character. Either ","
(default) or ";"
allowed by WhiteboxTools.
logical. Check if file(s) in x exist? Useful for input values. Default: FALSE
character. Length 1. A safe input string for use in WhiteboxTools commands, with paths expanded and concatenated, if necessary, and optionally shell quoted.
+If an input vector contains ";"
or ","
this is considered, path expansion is performed on the substrings. If the input vector has length greater than 1
, the vector is concatenated with ","
or ";"
to create a single output string.
+wbt_file_path("./abc.tif")
+#> [1] "'./abc.tif'"
+
+wbt_file_path("./abc.tif;./def.tif")
+#> [1] "'./abc.tif,./def.tif'"
+
+wbt_file_path("./abc.tif,./def.tif")
+#> [1] "'./abc.tif,./def.tif'"
+
+wbt_file_path(c("./abc.tif", "./def.tif"))
+#> [1] "'./abc.tif,./def.tif'"
+
+wbt_file_path("~/abc.tif", shell_quote = FALSE)
+#> [1] "/home/runner/abc.tif"
+
+wbt_file_path(c("~/abc.tif", "~/def.tif"))
+#> [1] "'/home/runner/abc.tif,/home/runner/def.tif'"
+
+