Package: whitebox
whitebox-pythonImportant NoteThis repository is related to the WhiteboxTools Python Frontend only. You can report issues to this repo if you have problems installing this Python package. If you encounter any tool functioning specific errors, pleaseopen an issueon Dr. John Lindsay’sWhiteboxToolsrepo.LinksAuthors: Dr. John Lindsay (https://jblindsay.github.io/ghrg/index.html)Contributors: Dr. Qiusheng Wu (https://wetlands.io)GitHub repo:https://github.com/giswqs/whitebox-pythonWhiteboxTools:https://github.com/jblindsay/whitebox-toolsUser Manual:https://www.whiteboxgeo.com/manual/wbt_book/intro.htmlPyPI:https://pypi.org/project/whitebox/conda-forge:https://anaconda.org/conda-forge/whiteboxDocumentation:https://whitebox.readthedocs.ioBinder:https://gishub.org/whitebox-cloudFree software:MIT licenseContentsDescriptionInstallationwhitebox Tutorialswhitebox GUIAvailable ToolsSupported Data FormatsContributingLicenseReporting BugsCreditsDescriptionThewhiteboxPython package is built onWhiteboxTools, an advanced geospatial data analysis platform developed by Prof. John Lindsay (webpage;jblindsay) at the University of Guelph’sGeomorphometry and Hydrogeomatics Research Group.WhiteboxToolscan be used to perform common geographical information systems (GIS) analysis operations, such as cost-distance analysis, distance buffering, and raster reclassification. Remote sensing and image processing tasks include image enhancement (e.g. panchromatic sharpening, contrast adjustments), image mosaicing, numerous filtering operations, simple classification (k-means), and common image transformations.WhiteboxToolsalso contains advanced tooling for spatial hydrological analysis (e.g. flow-accumulation, watershed delineation, stream network analysis, sink removal), terrain analysis (e.g. common terrain indices such as slope, curvatures, wetness index, hillshading; hypsometric analysis; multi-scale topographic position analysis), and LiDAR data processing. LiDAR point clouds can be interrogated (LidarInfo, LidarHistogram), segmented, tiled and joined, analyized for outliers, interpolated to rasters (DEMs, intensity images), and ground-points can be classified or filtered.WhiteboxToolsis not a cartographic or spatial data visualization package; instead it is meant to serve as an analytical backend for other data visualization software, mainly GIS.Installationwhiteboxsupports a variety of platforms, including Microsoft Windows, macOS, and Linux operating systems. Note that you will need to have Python 3.x installed. Python 2.x is not supported. ThewhiteboxPython package can be installed using the following command:pipinstallwhiteboxIf you have installedwhiteboxPython package before and want to upgrade to the latest version, you can use the following command:pipinstallwhitebox-UIt is recommended that you use a Python virtual environment (e.g., conda) to test the whitebox package. Please follow theconda user guideto install conda if necessary. Once you have conda installed, you can use Terminal or an Anaconda Prompt to create a Python virtual environment. Checkmanaging Python environmentfor more information.condacreate-nwbtpythonsourceactivatewbtcondainstallwhitebox-cconda-forgeIf you encounter an GLIBC errors when installing the whitebox package, you can try the following command:importwhiteboxwhitebox.download_wbt(linux_musl=True,reset=True)Alternatively, you can set the environment variableWBT_LINUXtoMUSLbefore installing the whitebox package. It will automatically download the MUSL version of WhiteboxTools.importosos.environ["WBT_LINUX"]="MUSL"whitebox TutorialsLaunch the whitebox tutorial notebook directly withmybinder.orgnow:Quick ExampleTool names in thewhiteboxPython package can be called either using the snake_case or CamelCase convention (e.g.lidar_infoorLidarInfo). See below for an example Python script (example.py). If you are interested in using theWhiteboxToolscommand-line program, checkWhiteboxTools Usage.importosimportpkg_resourcesimportwhiteboxwbt=whitebox.WhiteboxTools()print(wbt.version())print(wbt.help())# identify the sample data directory of the packagedata_dir=os.path.dirname(pkg_resources.resource_filename("whitebox",'testdata/'))wbt.set_working_dir(data_dir)wbt.verbose=Falsewbt.feature_preserving_smoothing("DEM.tif","smoothed.tif",filter=9)wbt.breach_depressions("smoothed.tif","breached.tif")wbt.d_inf_flow_accumulation("breached.tif","flow_accum.tif")A Jupyter Notebook Tutorial for whiteboxThis tutorial can be accessed in three ways:HTML version:https://gishub.org/whitebox-htmlViewable Notebook:https://gishub.org/whitebox-notebookInteractive Notebook:https://gishub.org/whitebox-cloudLaunch this tutorial as an interactive Jupyter Notebook on the cloud -https://gishub.org/whitebox-cloud.whitebox GUIWhiteboxTools also provides a Graphical User Interface (GUI) -WhiteboxTools Runner, which can be invoked using the following Python script:importwhiteboxwhitebox.Runner()TroubleshootingLinuxWhen usingimport whitebox, if you get an error that saysNo module named '_tkinter', please install thepython3-tkpackage, you can try the following solution:For Ubuntu, Linux Mint, etc:sudoapt-getinstallpython3-tkFor Manjaro, Arch Linux:sudo pacman-StkAvailable ToolsThe library currently contains518tools, which are each grouped based on their main function into one of the following categories: Data Tools, GIS Analysis, Hydrological Analysis, Image Analysis, LiDAR Analysis, Mathematical and Statistical Analysis, Stream Network Analysis, and Terrain Analysis. For a listing of available tools, complete with documentation and usage details, please see theWhiteboxTools User Manual.Supported Data FormatsThe WhiteboxTools library currently supports read/writing raster data in Whitebox GAT, GeoTIFF, ESRI (ArcGIS) ASCII and binary (.flt & .hdr), GRASS GIS, Idrisi, SAGA GIS (binary and ASCII), and Surfer 7 data formats. At present, there is limited ability in WhiteboxTools to read vector geospatial data. Support for Shapefile (and other common vector formats) will be enhanced within the library soon.ContributingIf you would like to contribute to the project as a developer, follow these instructions to get started:Fork the whitebox project (https://github.com/giswqs/whitebox-python)Create your feature branch (git checkout -b my-new-feature)Commit your changes (git commit -am ‘Add some feature’)Push to the branch (git push origin my-new-feature)Create a new Pull RequestLicenseThewhiteboxpackage is distributed under theMIT license, a permissive open-source (free software) license.Reporting BugsReport bugs athttps://github.com/giswqs/whitebox-python/issues.If you are reporting a bug, please include:Your operating system name and version.Any details about your local setup that might be helpful in troubleshooting.Detailed steps to reproduce the bug.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.2.0 (2018-06-08)0.1.0 (2018-06-06)First release on PyPI.