GISGEARS
A collection of Python tools for GIS/hydrology raster and vector analysis.
WhiteboxTools:
wsdgendepends on the WhiteboxTools executable, which thewhiteboxPython package downloads automatically the first time it runs.
Installation
pip install gisgears
Features
- wsdgen: Delineate a watershed from a DEM and an outlet layer (point or line)
- wsdpyshed: Delineate watersheds and the stream network from a DEM and one or more outlets (points or lines) using pysheds (no WhiteboxTools needed)
- wsdsmooth: Smooth the boundary of a watershed polygon shapefile
- showtif: Display a DEM GeoTIFF with an elevation colormap, optionally alongside a hillshade
- showtif2: Same as
showtif, but reads the DEM and computes the hillshade with terrio (no GDAL) - showshp: Display one or more shapefiles overlaid on a single map
- showtable: Print the attribute table of a shapefile or GeoPackage layer
Usage
Command-line
# List all available commands
gisgears-info
# Delineate a watershed from a point outlet
wsdgen --dem dem.tif --outlet outlet.shp
# Delineate a watershed from a line outlet (e.g. a cross-section), keeping intermediates
wsdgen --dem dem.tif --outlet crosssection.shp --all-outputs
# Use a coarser/finer boundary-smoothing filter
wsdgen --dem dem.tif --outlet outlet.shp --smooth-filter 15
# Extract a sparser stream network (cells with flow accumulation > 500)
wsdgen --dem dem.tif --outlet outlet.shp --acc-threshold 500
# Delineate with pysheds from a pour point shapefile or x/y coordinates
wsdpyshed --dem dem.tif --outlet pourpoint.shp
wsdpyshed --dem dem.tif --outlet crosssections.shp # line outlets, one watershed per line
wsdpyshed --dem dem.tif --xy 285612.0 2936416.7 --acc-threshold 500 --plot
# Smooth a watershed boundary (default filter 9, written to WSD/<name>_smooth.shp)
wsdsmooth WSD/watershed.shp
wsdsmooth watershed.shp --filter 15 -o basin_smooth.shp
# Inspect a DEM (prints CRS/size/stats, plots elevation; --hillshade adds a hillshade)
showtif dem.tif
showtif dem.tif --hillshade
showtif2 dem.tif --hillshade # same, using terrio instead of rasterio
# Overlay shapefiles on one map, labelling features by a column
showshp WSD/watershed.shp outlet.shp -l Station
# Print an attribute table (selected columns, with geometry as WKT)
showtable thiessen.shp -c Station -g
showtable data.gpkg -l roads -n 20
showtable data.gpkg --list-layers
Python API
from gisgears import wsdgen
# Delineate a watershed (written to WSD/watershed.tif, watershed.shp, watershed_smooth.shp,
# streams.shp, streams.gpkg, streams.geojson)
wsdgen.delineate_watershed(dem="dem.tif", outlet="outlet.shp", acc_threshold=200)
from gisgears import wsdpyshed
# Same idea with pysheds; also writes dem_clipped.tif and streams.gpkg/.geojson to WSD/
wsdpyshed.delineate_watershed(dem="dem.tif", outlet="pourpoint.shp", acc_threshold=200)
from gisgears import wsdsmooth
# Smooth a watershed boundary (written to WSD/watershed_smooth.shp)
wsdsmooth.smooth_watershed("WSD/watershed.shp", filter_size=9)
from gisgears import showtif, showshp, showtable
showtif.show_dem("dem.tif")
from gisgears import showtif2
showtif2.show_dem("dem.tif", hillshade=True) # terrio-based, with hillshade
showshp.show_shapefiles(["WSD/watershed.shp", "outlet.shp"], label="Station")
table = showtable.show_table("thiessen.shp", columns=["Station"]) # returns a DataFrame
layers = showtable.list_layers("data.gpkg") # [(name, geometry type), ...]
Notes
- The outlet layer may be a point shapefile (a single manually-marked outlet) or a line shapefile (e.g. a cross-section at the watershed outlet);
wsdgendetects the geometry type automatically. - By default only the final
watershed.tif,watershed.shp,watershed_smooth.shpand the stream network inside the watershed (streams.shpandstreams.gpkgin the DEM's CRS,streams.geojsonin WGS84) are written to theWSD/output directory; pass--all-outputsto also keep intermediate files (breached DEM, D8 pointer, flow accumulation, snapped outlet, stream raster, etc.) there instead of a temporary folder. Streams are cells whose flow accumulation exceeds--acc-threshold(cell count, default 200). wsdpyshedtakes a point or line outlet layer (--outlet, reprojected to the DEM's CRS if needed) or coordinates (--xy, repeatable). Every feature or--xypair gets its own watershed, labeled 1, 2, ... in order (the cell value inwatershed.tifand theidfield inwatershed.shp); when one outlet is upstream of another, the downstream watershed excludes the upstream one, giving nested sub-basins. Use--outlet-indexto delineate a single feature only. Each pour point is snapped to the nearest cell whose flow accumulation exceeds--acc-threshold(default 200, also used for the stream network) unless--no-snapis given. A line outlet (e.g. a cross-section) is rasterized and the watershed is everything draining to any cell it crosses; if it crosses no stream cell, its highest-accumulation cell is snapped like a point. Outputs go toWSD/by default:watershed.tif,watershed.shp,dem_clipped.tif,streams.gpkg(in the DEM's CRS) andstreams.geojson(in WGS84, as GeoJSON requires);--all-outputsadds the conditioned DEM, flow direction and flow accumulation rasters, and--web-mapwritesstreams_map.html(requiresfoliumandmapclassify).
Metadata
Release files for gisgears 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gisgears-0.6.0.tar.gz | 22.5 kB | With provenance | Details for gisgears-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gisgears-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for gisgears-0.6.0-py3-none-any.whl |
Total release size: 50.5 kB
Release files / gisgears-0.6.0.tar.gz
| Download URL | gisgears-0.6.0.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e04025aaeb0d7394f3d6e212010e7804457dcae5301f09fce9590da279751e78
|
|
BLAKE2b-256 checksum How to use checksums |
43d8c3ef4cb12f1213e95bdecad3731714529d17f30b7615fb7fd97cfeb449a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / gisgears-0.6.0-py3-none-any.whl
| Download URL | gisgears-0.6.0-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a25fa27f76a9f64a95e222e25b66b9d8c9d82965bc7e26a081274320472bc4c4
|
|
BLAKE2b-256 checksum How to use checksums |
93ffa2a8e4cc1d09f3ba5969fb1716d5785da7b8ec753ef686960fba9fc1e5f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for gisgears 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gisgears-0.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.