• Stars
    star
    315
  • Rank 132,951 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WhiteboxTools Python Frontend

whitebox-python

https://pepy.tech/badge/whitebox Documentation Status

Important Note

https://i.imgur.com/Ic8BA7C.png

This 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, please open an issue on Dr. John Lindsay's WhiteboxTools repo.

Links

Contents

Description

The whitebox Python package is built on WhiteboxTools, an advanced geospatial data analysis platform developed by Prof. John Lindsay (webpage; jblindsay) at the University of Guelph's Geomorphometry and Hydrogeomatics Research Group. WhiteboxTools can 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. WhiteboxTools also 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. WhiteboxTools is 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.

Installation

whitebox supports 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. The whitebox Python package can be installed using the following command:

pip install whitebox

If you have installed whitebox Python package before and want to upgrade to the latest version, you can use the following command:

pip install whitebox -U

It is recommended that you use a Python virtual environment (e.g., conda) to test the whitebox package. Please follow the conda user guide to install conda if necessary. Once you have conda installed, you can use Terminal or an Anaconda Prompt to create a Python virtual environment. Check managing Python environment for more information.

conda create -n wbt python
source activate wbt
conda install whitebox -c conda-forge

If you encounter an GLIBC errors when installing the whitebox package, you can try the following command:

import whitebox
whitebox.download_wbt(linux_musl=True, reset=True)

Alternatively, you can set the environment variable WBT_LINUX to MUSL before installing the whitebox package. It will automatically download the MUSL version of WhiteboxTools.

import os
os.environ["WBT_LINUX"] = "MUSL"

whitebox Tutorials

Launch the whitebox tutorial notebook directly with mybinder.org now:

Quick Example

Tool names in the whitebox Python package can be called either using the snake_case or CamelCase convention (e.g. lidar_info or LidarInfo). See below for an example Python script (example.py). If you are interested in using the WhiteboxTools command-line program, check WhiteboxTools Usage.

import os
import pkg_resources
import whitebox

wbt = whitebox.WhiteboxTools()
print(wbt.version())
print(wbt.help())

# identify the sample data directory of the package
data_dir = os.path.dirname(pkg_resources.resource_filename("whitebox", 'testdata/'))

wbt.set_working_dir(data_dir)
wbt.verbose = False
wbt.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 whitebox

This tutorial can be accessed in three ways:

Launch this tutorial as an interactive Jupyter Notebook on the cloud - https://gishub.org/whitebox-cloud.

https://i.imgur.com/LF4UE1j.gif

whitebox GUI

WhiteboxTools also provides a Graphical User Interface (GUI) - WhiteboxTools Runner, which can be invoked using the following Python script:

import whitebox
whitebox.Runner()

https://wetlands.io/file/images/whitebox.png

Troubleshooting

Linux

When using import whitebox, if you get an error that says No module named '_tkinter', please install the python3-tk package, you can try the following solution:

  • For Ubuntu, Linux Mint, etc: sudo apt-get install python3-tk
  • For Manjaro, Arch Linux: sudo pacman -S tk

Available Tools

The library currently contains 518 tools, 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 the WhiteboxTools User Manual.

Supported Data Formats

The 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.

Contributing

If you would like to contribute to the project as a developer, follow these instructions to get started:

  1. Fork the whitebox project (https://github.com/opengeos/whitebox-python)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

The whitebox package is distributed under the MIT license, a permissive open-source (free software) license.

Reporting Bugs

Report bugs at https://github.com/opengeos/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.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

More Repositories

1

leafmap

A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment
Python
1,312
star
2

earthengine-py-notebooks

A collection of 360+ Jupyter Python notebook examples for using Google Earth Engine with interactive mapping
Jupyter Notebook
1,213
star
3

qgis-earthengine-examples

A collection of 300+ Python examples for using Google Earth Engine in QGIS
Python
800
star
4

streamlit-geospatial

A multi-page streamlit app for geospatial
Python
586
star
5

python-geospatial

A collection of Python packages for geospatial analysis with binder-ready notebook examples
Shell
564
star
6

Awesome-GEE

A curated list of Google Earth Engine resources
545
star
7

geospatial-data-catalogs

A list of open geospatial datasets available on AWS, Earth Engine, Planetary Computer, NASA CMR, and STAC Index
Jupyter Notebook
380
star
8

aws-open-data-geo

A list of open geospatial datasets on AWS
Python
239
star
9

geospatial

A Python package for installing commonly used packages for geospatial analysis and data visualization with only one command.
Python
205
star
10

WhiteboxTools-ArcGIS

ArcGIS Python Toolbox for WhiteboxTools
Python
196
star
11

geog-312

Introduction to GIS Programming
Jupyter Notebook
179
star
12

lidar

A Python package for delineating nested surface depressions from digital elevation data.
Python
173
star
13

mapwidget

Custom Jupyter widgets for creating interactive 2D/3D maps using popular JavaScript libraries with bidirectional communication, such as Cesium, Mapbox, MapLibre, Leaflet, and OpenLayers
Python
151
star
14

whiteboxR

WhiteboxTools R Frontend
R
147
star
15

geebook

Geospatial Data Science with Earth Engine and Geemap
Jupyter Notebook
114
star
16

geospatial-ml

A Python package for installing commonly used packages for geospatial analysis and machine learning with only one command.
Python
111
star
17

whiteboxgui

An interactive GUI for WhiteboxTools in a Jupyter-based environment
Python
108
star
18

earthengine-py-examples

A collection of 300+ examples for using Earth Engine and the geemap Python package
Python
103
star
19

streamlit-timeline

Streamlit component for rendering vis.js timeline
Python
96
star
20

geog-414

A repo for GEOG-414 (Spatial Data Management) at the University of Tennessee
HTML
89
star
21

manjaro-linux

Shell scripts for setting up Manjaro Linux for Python programming and deep learning
Shell
88
star
22

GEE-Courses

A collection of Jupyter notebooks for GEE Courses
84
star
23

streamlit-template

A streamlit app template based on streamlit-option-menu
Python
64
star
24

streamlit-multipage-template

A streamlit multipage app template for geospatial applications
Python
60
star
25

maxar-open-data

The Maxar Open Data STAC Catalog in CSV, GeoJSON, and MosaicJSON formats
Python
58
star
26

Wetland-Hydro-GEE

Mapping wetland hydrological dynamics using Google Earth Engine (GEE)
JavaScript
50
star
27

leafmap-book

Geospatial Data Science with Leafmap
Jupyter Notebook
45
star
28

gee-tutorials

Google Earth Engine tutorials
Jupyter Notebook
39
star
29

geemap-apps

Interactive web apps created using geemap and streamlit
Python
33
star
30

postgis

Spatial Data Management with PostgreSQL and PostGIS https://gishub.org/sdm
Jupyter Notebook
32
star
31

leafmap-apps

Interactive web apps created using leafmap and streamlit
Python
32
star
32

giswqs

30
star
33

giswqs-bk

30
star
34

Learning-R

R Tutorials
R
29
star
35

geehydro

A Python package for mapping inundation dynamics using Google Earth Engine
Python
27
star
36

eefolium

A lightweight Python package for interactive mapping with Earth Engine and folium
Python
24
star
37

earthengine-apps

A collection of Earth Engine Apps created using geemap and voila
Jupyter Notebook
23
star
38

geemap-heroku

Python scripts for deploying Earth Engine Apps to heroku
Jupyter Notebook
22
star
39

whitebox-frontends

WhiteboxTools Frontends
20
star
40

geodemo

A Python package for interactive mapping
Python
19
star
41

aws-open-data

A list of open datasets on AWS
Python
17
star
42

leafmap-streamlit

Publishing interactive web apps using leafmap and streamlit
Python
17
star
43

geog-414-fall2022

Spatial Data Management with Google Earth Engine
Jupyter Notebook
17
star
44

data

Some commonly used geospatial datasets
Jupyter Notebook
16
star
45

gh-pages-html-template

A simple template for deploying an HTML website to GitHub Pages
HTML
16
star
46

streamlit-mapbox

A Streamlit Component for rendering Mapbox GL JS
Python
14
star
47

mkdocs-template

A template for building a mkdocs website
14
star
48

geospatial-apps

A collection of streamlit web apps for geospatial applications
Python
14
star
49

notebook-share

A repo for sharing notebooks
13
star
50

aws-open-data-stac

A list of STAC endpoints for the AWS Open Data Program
Python
12
star
51

global-surface-water

A streamlit web app for mapping global surface water
Python
12
star
52

streamlit-water

A streamlit web app visualizing global surface water datasets.
Python
12
star
53

GEOG-503

Programming in GIS (GEOG-503)
Jupyter Notebook
11
star
54

wetland

Mapping surface water and wetland hydrological dynamics using Google Earth Engine
Python
11
star
55

geemap-streamlit

geemap with streamlit
Python
11
star
56

streamlit-leaflet

A Streamlit component for rendering leaflet maps
Python
10
star
57

leafmap-jupyterlite

Leafmap for Jupyterlite
Jupyter Notebook
10
star
58

giswqs.github.io-bk

Public website
CSS
10
star
59

Depression-Analysis-Toolbox

An ArcGIS toolbox for identifying nested depressions in digital elevation models (DEMs)
Python
10
star
60

leafmaptools

A Python package for building a tool widgets infrastructure with ipyleaflet and ipywidgets
Python
10
star
61

GeoPython-Twitter-Bot

A Twitter Bot for GeoPython
JavaScript
10
star
62

NASA-CMR-STAC

A list of geospatial datasets on NASA's Common Metadata Repository (CMR)
Jupyter Notebook
9
star
63

streamlit-google-sheet

A streamlit web app for connecting Streamlit to a public Google Sheet
Python
9
star
64

sysu-workshop

This repo hosts materials for my workshop given at Sun Yat-sen University during July 19-21, 2017
HTML
9
star
65

GIS-Info.github.io

GIS留学:学校与项目指南 | GIS Study Abroad: Universities and Projects Guide
9
star
66

geemap-tutorials

Interactive geemap tutorials on heroku
Jupyter Notebook
9
star
67

geog-312-fall2019

First Steps in GIS Programming
HTML
8
star
68

geospatial-notebooks

A collection of Jupyter notebooks for geospatial applications
8
star
69

earthengine-js-examples

Google Earth Engine JavaScript Examples
JavaScript
8
star
70

Wetland-Hydrology-Analyst-Toolbox

An ArcGIS toolbox for wetland hydrology
Python
8
star
71

geog-312-2021

First Steps in GIS Programming (GEOG 312) at the University of Tennessee, Knoxville
Jupyter Notebook
8
star
72

Learning-Python

Python notebooks
Python
8
star
73

streamlit-raster

A Python package for rendering raster datasets with streamlit and localtileserver
Python
8
star
74

scholarpy

A Python package for searching journal publications and researchers
Python
8
star
75

dem-depression-level-set-method

Delineating nested hierarchy of topographic depressions in digital elevation models (DEMs) using level set methods
Python
8
star
76

streamlit-maps

A steamlit app for mapping applications
Python
7
star
77

geemap-ai-docker

AI Platform Deep Learning VM Image with geemap
Jupyter Notebook
7
star
78

Planetary-Computer-Catalog

The Microsoft Planetary Computer Catalog in CSV format
Python
7
star
79

stac-index-catalogs

A list of STAC endpoints retrieved from https://stacindex.org
Jupyter Notebook
7
star
80

geebook-code

Jupyter notebooks for the GEE book
7
star
81

earthengine-py-documentation

Unofficial Google Earth Engine Python Documentation
Jupyter Notebook
6
star
82

Earth-Engine-Catalog

The Google Earth Engine data catalog in CSV format
Python
6
star
83

pyhydro

A Python package for modeling fill-spill hydrology in depression-dominated landscapes
Python
6
star
84

Learning-SciPy

Learning SciPy for Numerical and Scientific Computing
Jupyter Notebook
6
star
85

streamlit-demo

Streamlit demos for geospatial
Python
6
star
86

geosdemo

A Python package demo for interactive mapping
Python
6
star
87

Earth-Engine-Python

Earth Engine Python Examples
Python
5
star
88

geoscale

Python library for scale-based spatial analysis
Python
5
star
89

richdem-binder

Binder for the richdem Python package
5
star
90

timelapse

An interactive streamlit web app for creating satellite timelapse
Python
5
star
91

plotly-dash-template

A template for deploying a plotly dash app on Heroku
Python
4
star
92

streamlit-cartopy

A streamlit web app for hurricane mapping
Python
4
star
93

Earth-Engine-Twitter-Bot

A Twitter Bot for #EarthEngine
JavaScript
4
star
94

streamlit-app-template

A multi-page streamlit web app template for geospatial applications
Python
4
star
95

Crime-Analysis

Crime analysis using R and Python
HTML
4
star
96

streamlit-timeline-demo

Streamlit component for rendering vis.js timeline
Python
4
star
97

GEOG-510

A test repo for GEOG-510
4
star
98

streamlit-tnview

A streamlit application for TennesseeView
Python
3
star
99

Python-books

Python
3
star
100

whitebox-r-binder

Binder for the whitebox R package
Jupyter Notebook
3
star