{"id":23948490,"url":"https://github.com/atsyplenkov/wbw","last_synced_at":"2025-04-22T18:51:29.084Z","repository":{"id":270676874,"uuid":"907628634","full_name":"atsyplenkov/wbw","owner":"atsyplenkov","description":"Whitebox Workflows for R","archived":false,"fork":false,"pushed_at":"2025-01-14T05:07:58.000Z","size":10807,"stargazers_count":31,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T08:13:00.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wbw.anatolii.nz","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atsyplenkov.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-24T03:04:04.000Z","updated_at":"2025-03-27T16:05:29.000Z","dependencies_parsed_at":"2025-02-24T08:14:47.229Z","dependency_job_id":"6ad95fc0-8f0f-4afa-b334-a9779254da13","html_url":"https://github.com/atsyplenkov/wbw","commit_stats":null,"previous_names":["atsyplenkov/wbw"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fwbw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fwbw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fwbw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fwbw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atsyplenkov","download_url":"https://codeload.github.com/atsyplenkov/wbw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250303686,"owners_count":21408648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-06T10:16:19.022Z","updated_at":"2025-04-22T18:51:29.077Z","avatar_url":"https://github.com/atsyplenkov.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Don't forget to update pkgdown/index.md --\u003e\n\n# Whitebox Workflows for R `{wbw}` \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"135\" alt=\"\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Project Status: WIP – Initial development is in progress, but there\nhas not yet been a stable, usable release suitable for the\npublic.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n[![WBW\nFunctions](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/atsyplenkov/0c46250def94614c4a3ef8b4de7460e6/raw/wbw-progress.json)](https://github.com/atsyplenkov/wbw/issues/1)\n[![R-CMD-check](https://github.com/atsyplenkov/wbw/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/atsyplenkov/wbw/actions/workflows/R-CMD-check.yaml)\n[![Codecov test\ncoverage](https://codecov.io/gh/atsyplenkov/wbw/graph/badge.svg)](https://app.codecov.io/gh/atsyplenkov/wbw)\n![GitHub last\ncommit](https://img.shields.io/github/last-commit/atsyplenkov/wbw)\n\u003c!-- badges: end --\u003e\n\n---\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://wbw.anatolii.nz/articles/FAQ.html\"\u003e\u003cbig\u003e\u003cb\u003eFAQ\u003c/b\u003e\u003c/big\u003e\u003c/a\u003e ◽ \u003ca href=\"https://wbw.anatolii.nz/articles/tutorials.html\"\u003e\u003cbig\u003e\u003cb\u003eTutorials\u003c/b\u003e\u003c/big\u003e\u003c/a\u003e ◽ \u003ca href=\"https://wbw.anatolii.nz/articles/benchmarks.html\"\u003e\u003cbig\u003e\u003cb\u003eBenchmarks\u003c/b\u003e\u003c/big\u003e\u003c/a\u003e ◽ \u003ca href=\"https://github.com/atsyplenkov/wbw?tab=readme-ov-file#installation\"\u003e\u003cbig\u003e\u003cb\u003eInstallation\u003c/b\u003e\u003c/big\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n\u003e [!NOTE]\n\u003e `{wbw}` is currently in alpha. Expect breaking changes both in the API and in outputs.\n\nThe `{wbw}` package provides R bindings for the [Whitebox Workflows for Python](https://www.whiteboxgeo.com/whitebox-workflows-for-python/) — a powerful and fast library for advanced geoprocessing, with focus on hydrological, geomorphometric and remote sensing analysis of raster, vector and LiDAR data.\n\n## Basic workflow\n\nThe `{wbw}` R package introduces several new S7 classes, including\n`WhiteboxRaster` and `WhiteboxVector` which serves as a bridge between\nPython and R.\n\n``` r\nlibrary(wbw)\n\nraster_path \u003c- system.file(\"extdata/dem.tif\", package = \"wbw\")\ndem \u003c- wbw_read_raster(raster_path)\ndem\n#\u003e +------------------------------------------+ \n#\u003e | WhiteboxRaster                           |\n#\u003e | dem.tif                                  |\n#\u003e |..........................................| \n#\u003e | bands       : 1                          |\n#\u003e | dimensions  : 726, 800  (nrow, ncol)     |\n#\u003e | resolution  : 5.002392, 5.000243  (x, y) |\n#\u003e | EPSG        : 2193  (Linear_Meter)       |\n#\u003e | min value   : 63.698193                  |\n#\u003e | max value   : 361.020721                 |\n#\u003e +------------------------------------------+\n```\n\nThe true power of `{wbw}` unleashes when there’s a need to run several\noperations sequentially, i.e., in a pipeline. Unlike the original\nWhitebox Tools, WbW [stores files in\nmemory](https://www.whiteboxgeo.com/manual/wbw-user-manual/book/introduction.html#how-does-wbw-compare-with-related-whitebox-products),\nreducing the amount of intermediate I/O operations.\n\nFor example, a DEM can be smoothed (or filtered), and then the slope can\nbe estimated as follows:\n\n``` r\ndem |\u003e\n  wbw_mean_filter() |\u003e \n  wbw_slope(units = \"d\")\n#\u003e +------------------------------------------+ \n#\u003e | WhiteboxRaster                           |\n#\u003e | Slope (degrees)                          |\n#\u003e |..........................................| \n#\u003e | bands       : 1                          |\n#\u003e | dimensions  : 726, 800  (nrow, ncol)     |\n#\u003e | resolution  : 5.002392, 5.000243  (x, y) |\n#\u003e | EPSG        : 2193  (Linear_Meter)       |\n#\u003e | min value   : 0.005972                   |\n#\u003e | max value   : 50.069439                  |\n#\u003e +------------------------------------------+\n```\n\n## Yet Another RSpatial Package? Why?\n\nThe above example may remind you of the `{terra}` package, and it is not\na coincidence. The `{wbw}` package is designed to be fully compatible\nwith `{terra}`, and the conversion between `WhiteboxRaster` and\n`SpatRaster` objects happens in milliseconds (well, depending on the\nraster size, of course).\n\n``` r\nlibrary(terra)\n\nwbw_read_raster(raster_path) |\u003e \n  wbw_gaussian_filter(sigma = 1.5) |\u003e \n  wbw_aspect() |\u003e \n  as_rast() |\u003e # Conversion to SpatRaster\n  plot(main = \"Aspect\")\n```\n\n\u003cimg src=\"man/figures/README-terra-1.png\" width=\"75%\" alt =\"Aspect calculated via wbw and plotted using terra R package\"/\u003e\n\nThe `{wbw}` package is quite fast; you can see the detailed benchmarks [here](https://wbw.anatolii.nz/articles/benchmarks.html). In most cases, it is as fast as `terra`, while excelling in some more complex tasks (such as hillshading and filtering). Additionally, `wbw` outperforms the original `{whitebox}` by 2 to 3 times, as the amount of I/O operations is reduced to a minimum.\n\n![](https://wbw.anatolii.nz/articles/benchmarks_files/figure-html/hill_bench_plot-1.png)\n\n## Installation\n\nYou can install the development version of `{wbw}` from\n[GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"pak\")\npak::pak(\"atsyplenkov/wbw\")\n```\n\u003e [!TIP]\n\u003e The `{wbw}` package requires the `whitebox-workflows` Python library\n\u003e v1.3.3+. However, you should not worry about it, as the package\n\u003e is designed to install all dependencies automatically on the first run.\n\nYour machine should have **Python 3.8+** installed with `pip` and `venv` configured. Usually, these requirements are met on all modern computers. However, clean Debian installs may require the installation of system dependencies:\n\n```bash\napt update\napt install python3 python3-pip python3-venv -y\n```\n\n## Contributing\n\nContributions are welcome! Please see our [contributing\nguidelines](CONTRIBUTING.md) for details. There is an open issue for the\n`{wbw}` package [here](https://github.com/atsyplenkov/wbw/issues/1) that\ncontains a list of functions yet to be implemented. This is a good place\nto start.\n\n## See also\n\nGeomorphometric and hydrological analysis in R can be also done with:\n\n- [`{whitebox}`](https://github.com/opengeos/whiteboxR) — An R frontend for the [WhiteboxTools](https://www.whiteboxgeo.com) standalone runner. \u003cbr\u003e\n- [`{traudem}`](https://github.com/lucarraro/traudem/) — R bindings to [TauDEM](https://hydrology.usu.edu/taudem/taudem5/) (Terrain Analysis Using Digital Elevation Models) command-line interface. \u003cbr\u003e\n- [`{RSagacmd}`](https://github.com/stevenpawley/Rsagacmd/) and [`{RSAGA}`](https://github.com/r-spatial/RSAGA) — Links R with [SAGA GIS](https://sourceforge.net/projects/saga-gis/). \u003cbr\u003e\n- [`{rivnet}`](https://github.com/lucarraro/rivnet) — river network extraction from DEM using TauDEM.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsyplenkov%2Fwbw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatsyplenkov%2Fwbw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsyplenkov%2Fwbw/lists"}