Overview

This manual is the long-form user guide for the WbW-Py API.

WbW-Py (Whitebox Workflows for Python) is the Python frontend to Whitebox Next Gen, exposing a high-performance geospatial engine for raster, vector, lidar, and sensor-bundle workflows through a Pythonic API.

Whitebox is a long-running geospatial project that began in academia and has evolved into a broad analysis platform with particular strength in geomorphometry, hydrological analysis, lidar processing, and remote sensing. Whitebox Next Gen is the current Rust-based major iteration, designed to pair high performance with modern APIs.

Whitebox Next Gen is intentionally full-stack: core geospatial capabilities that are often delegated to external C/C++ dependencies in other GIS platforms (for example raster I/O, projections, geometry/topology operations, and lidar handling) are implemented in the Whitebox codebase itself. This architecture is unusual in GIS and provides practical benefits for users: consistent behavior across platforms, tighter control over correctness and performance, fewer system-level dependency issues during installation, and faster iteration when fixing bugs or introducing new capabilities.

Within that architecture, WbW-Py is the user-facing orchestration layer for Python users. It is intended for three common use cases:

  • exploratory research notebooks and small scripts,
  • reproducible batch workflows in production pipelines,
  • integration with the broader Python geospatial ecosystem.

This manual balances beginner accessibility with reference-grade detail:

  • beginner friendly: clear chapter flow and runnable examples,
  • canonical reference: explicit patterns, boundary conditions, and validation guidance aligned with backend capabilities.

How to Use This Manual

This guide is designed for practitioners who want to move from exploratory scripts to reliable, repeatable geospatial pipelines. The examples are intentionally script-first, but each chapter also communicates design intent: when to keep data in memory, when to persist to disk, and how to validate each processing stage.

Readers get the best results by following chapters in order the first time, then using the script index as a task-oriented lookup once the core patterns are familiar.

When adapting examples, treat each script as a template with four parts:

  1. session or environment setup,
  2. data intake,
  3. transformation chain,
  4. validation and persistence.

This structure helps keep your own scripts consistent as they grow.

Goals:

  • Comprehensive API coverage.
  • Practical, script-first learning path.
  • Consistent chapter flow aligned with the project README.

Documentation style rules:

  • Every major concept must include executable code snippets.
  • Each chapter should include at least one complete end-to-end script.
  • Tool-specific parameter details are linked to tool reference docs where needed.

Common Pitfalls and Validation

  • Confirm inputs exist and have the expected CRS/schema/metadata before running long workflows.
  • Prefer explicit output names and formats for reproducibility, especially in batch scripts.
  • Re-open and inspect outputs after major steps to validate assumptions before chaining more tools.
  • For performance-sensitive runs, start with a small representative subset, then scale to full data.

Write Option References

For quick access to output option tables:

Installation and Setup

Installation is intentionally separated from workflow chapters so failures are detected early and diagnosed in isolation. The smoke tests here are not just "does import work" checks; they confirm that bindings, core runtime components, and representative interop pathways are all healthy on your machine.

For team environments, treat this chapter as a baseline validation checklist before onboarding scripts or CI jobs.

Development Install

Use this path for local development or source-based testing. It installs the package and links the Python layer with the current workspace backend.

./scripts/dev_python_install.sh

Pro Build

Use this path when testing environments that include optional pro-enabled capabilities.

./scripts/dev_python_install.sh --pro

Smoke Tests

Run both smoke tests before starting deeper debugging. The first validates import and startup; the second checks an interop roundtrip so I/O boundaries are confirmed.

python3 crates/wbw_python/examples/python_import_smoke_test.py
python3 crates/wbw_python/examples/interop_roundtrip_smoke_test.py

Build and Preview

This manual is structured as an mdBook project.

Treat documentation builds as part of normal engineering hygiene. A clean build confirms that chapter links, code fences, and chapter ordering remain coherent as examples evolve. Live preview is especially useful when refining conceptual text, because it helps ensure headings and narrative pacing stay readable.

Install mdBook

cargo install mdbook

Build the Manual

Run a full build when editing chapter structure, links, or long conceptual sections.

From repository root:

cd crates/wbw_python/manual
mdbook build

Generated HTML is written to book/.

Live Preview

Use live preview while refining wording and section flow in narrative-heavy chapters.

cd crates/wbw_python/manual
mdbook serve --open

Authoring Notes

  • Keep chapter order aligned with src/SUMMARY.md.
  • Prefer runnable snippets over pseudo-code.
  • Link chapter recipes to concrete scripts listed in the script index.

Quick Start

This chapter gives you the shortest path to a successful first run. Think of it as a minimal "vertical slice": create an environment, load a dataset, run a tool, and write output. The goal is to verify that your runtime, paths, and basic mental model are all working before you invest in larger workflows.

After this first pass, the rest of the manual progressively explains why each step matters and how to make the same pattern robust for production scripts.

The example below demonstrates the default object-first workflow pattern. It reads a DEM, runs a hydrological tool, and writes an output raster. If this runs successfully, your environment and core processing path are functioning.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster("dem.tif")
filled = wbe.hydrology.depressions_storage.fill_depressions(dem)
wbe.write_raster(filled, "dem_filled.tif")

These chapters deepen the same lifecycle shown above: discovery before execution, explicit progress handling, and script catalogs for adaptation.

Quick-Start Conventions

  • Prefer object-first workflows (read_* -> transform -> write_*).
  • Validate tool visibility for scripted pipelines.
  • Persist only outputs you need to keep.

Environment and Discovery

This chapter covers environment lifecycle and tool discovery patterns.

Environment setup is where workflow reliability begins. By explicitly creating and configuring a runtime environment, you make script behavior predictable across machines and sessions. Discovery APIs then let you verify capability before execution, which avoids long-running failures caused by missing tools, unexpected categories, or version mismatches.

Create and Configure Environment

This example establishes an explicit runtime configuration. In production scripts, this is where you set working directory and verbosity policy.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
wbe.working_directory = '/path/to/data'
wbe.verbose = True

print(wbe.version())
print(wbe.license_type())

Namespace Discovery

Use discovery to understand available capability before writing long workflows or generating dynamic tooling UIs.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

print('categories:', wbe.categories())
print('domains:', wbe.domain_namespaces())
print('terrain tools sample:', wbe.terrain.list_tools()[:15])

Search and Describe Tools

This pattern is useful when you know a task but not the exact tool identifier.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

matches = wbe.search_tools('slope')
for m in matches[:5]:
	print(m.get('tool_id', m))

desc = wbe.describe_tool('slope')
print(desc)

Discovering Parameter Values with describe_tool

describe_tool returns a dictionary containing structured parameter metadata. Each entry in the params list includes:

KeyAlways presentDescription
nameyesParameter name as used in tool calls
descriptionyesHuman-readable description
requiredyesTrue if the parameter must be supplied
typewhen setSemantic type hint: "string", "float", "int", "bool", "path", "array[int]"
choiceswhen setList of valid string values for constrained parameters
default_valuewhen setDefault value as a string, for display purposes

Use this to enumerate valid values before calling a tool:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

desc = wbe.describe_tool('lidar_tin_gridding')
for p in desc['params']:
    name = p['name']
    choices = p.get('choices')
    default = p.get('default_value')
    if choices:
        print(f"{name}: choices={choices}, default={default!r}")
    else:
        print(f"{name}: type={p.get('type', 'any')}, default={default!r}")

Example output (selected parameters):

interpolation_parameter: choices=['elevation', 'intensity', 'class', 'return_number', 'number_of_returns', 'scan_angle', 'time', 'rgb', 'user_data'], default='elevation'
returns_included: choices=['all', 'first', 'last'], default='all'
triangulation_backend: choices=['auto', 'delaunator', 'wbtopology'], default='auto'
triangulation_thin_method: choices=['nearest_center', 'min_value', 'max_value'], default='nearest_center'
triangulation_thin_cell_size: type=float, default='0.0'

This is especially useful for building dynamic UIs, generating documentation, or writing validation helpers that do not hard-code allowed values.

Schema-Aware Tool Metadata JSON

For canonical parameter I/O typing, prefer get_tool_info_json (or get_tool_metadata_json) over name/description heuristics. The JSON payload includes io_role and data_kind per parameter.

import json
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
tool = json.loads(wbe.get_tool_info_json('slope'))

for p in tool.get('params', []):
    print(
        p['name'],
        'role=', p.get('io_role', 'unknown'),
        'kind=', p.get('data_kind', 'unknown')
    )
FieldMeaning
io_roleParameter role: input, output, or non-I/O argument.
data_kindCanonical family such as raster, vector, lidar, table, json, text, file, bool, number, or string.

Use these fields for integration logic such as destination widget selection, layer-output handling, and catalog validation.

Validate Tool Availability

Use hard checks like this in batch scripts so failures occur immediately, before expensive processing begins.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
available = set(wbe.list_tools())

required = {'fill_depressions', 'd8_flow_accum'}
missing = sorted(required - available)
if missing:
	raise RuntimeError(f'Missing required tools: {missing}')

Category Access Patterns

Prefer direct properties when available:

  • wbe.hydrology
  • wbe.terrain
  • wbe.raster
  • wbe.vector
  • wbe.lidar
  • wbe.remote_sensing
  • wbe.conversion
  • wbe.streams
  • wbe.precision_agriculture
  • wbe.other

Use generic accessors for dynamic workflows:

  • wbe.category(name)
  • wbe.domain(name)

Projection/georeferencing tools are cataloged under the canonical category key projection_georeferencing and can be queried with:

proj_tools = wbe.category('projection_georeferencing').list_tools()
print(proj_tools[:10])

WbEnvironment Method Reference

This reference lists callable WbEnvironment methods with brief descriptions. Special Python dunder methods are intentionally omitted.

Constructors

MethodDescription
from_floating_license_idCreate an environment using a floating license identifier and provider settings.
from_signed_entitlement_fileCreate an environment from a signed entitlement file and public-key metadata.
from_signed_entitlement_jsonCreate an environment from signed entitlement JSON and public-key metadata.

Runtime and Licensing

MethodDescription
versionReturn the Whitebox runtime version string.
license_typeReturn the active license mode (for example open, floating, or entitlement-backed).
license_infoReturn detailed license status information for diagnostics.

Discovery and Introspection

MethodDescription
list_toolsReturn all available tool IDs visible in the current environment.
categoriesReturn the list of top-level tool categories.
categoryReturn a category namespace object by name.
domain_namespacesReturn available domain namespace names.
domainReturn a domain namespace object by name.
describe_toolReturn metadata and parameter details for a specific tool ID.
get_tool_metadata_jsonReturn canonical metadata JSON for one tool ID, including io_role/data_kind.
get_tool_info_jsonAlias of get_tool_metadata_json for cross-binding API parity.
search_toolsSearch tools by keyword or phrase.
list_tools_detailedReturn expanded metadata for all visible tools.

Core Data Readers

MethodDescription
read_rasterRead one raster into a Raster object.
read_vectorRead one vector dataset into a Vector object.
read_lidarRead one lidar dataset into a Lidar object.
read_rastersRead multiple rasters, optionally in parallel.
read_vectorsRead multiple vectors, optionally in parallel.
read_lidarsRead multiple lidar datasets, optionally in parallel.

Sensor Bundle Readers and Composites

MethodDescription
read_bundleAuto-detect and read a supported sensor bundle.
read_landsatRead a Landsat bundle with family-specific parsing.
read_sentinel2Read a Sentinel-2 SAFE bundle.
read_sentinel1Read a Sentinel-1 SAFE bundle.
read_planetscopeRead a PlanetScope bundle.
read_iceyeRead an ICEYE bundle.
read_dimapRead a DIMAP bundle.
read_maxar_worldviewRead a Maxar/WorldView bundle.
read_radarsat2Read a RADARSAT-2 bundle.
read_rcmRead a RADARSAT Constellation Mission (RCM) bundle.
true_colour_compositeBuild a true-colour composite raster from a bundle source.
false_colour_compositeBuild a false-colour composite raster from a bundle source.

Reprojection Helpers

MethodDescription
reproject_rasterReproject one raster with explicit resampling and grid controls.
reproject_vectorReproject one vector dataset with policy controls.
reproject_lidarReproject one lidar dataset with transform and failure controls.
reproject_rastersBatch reproject multiple rasters.
reproject_vectorsBatch reproject multiple vector datasets.
reproject_lidarsBatch reproject multiple lidar datasets.

Writers and Raster-Memory Management

MethodDescription
write_rasterWrite one raster to disk with optional format options.
write_rastersWrite multiple rasters to disk in one call.
remove_raster_from_memoryDrop a specific memory-backed raster from the environment cache.
clear_raster_memoryClear all memory-backed rasters tracked by the environment.
clear_memoryClear all memory-backed rasters, vectors, and LiDAR objects tracked by the environment.
raster_memory_countReturn the count of memory-backed rasters currently tracked.
raster_memory_bytesReturn the estimated bytes used by tracked memory-backed rasters.
write_vectorWrite one vector dataset to disk with optional format options.
write_lidarWrite one lidar dataset to disk with optional format options.
write_textWrite plain text content to a file path.

Key Environment Properties

PropertyDescription
working_directoryDefault working directory used for relative paths.
verboseControls environment/runtime status output emitted by the bindings.
max_procsMaximum process count used by eligible parallel operations.
projectionNamespace for CRS and coordinate transformation helper methods.
topologyNamespace for geometry-topology helper methods.
hydrology, terrain, raster, vector, lidar, remote_sensingPrimary category namespaces for tool discovery and execution.
precision_agriculturePro-tier precision agriculture tools (yield zoning, irrigation, crop stress, trafficability).
conversion, streams, otherAdditional category namespaces available in the environment.

Tool Execution and Progress

This chapter documents execution styles and progress handling.

Execution style affects both correctness and maintainability. Object-first calls are concise for in-memory workflows, while path-first calls can be clearer in batch pipelines and audit logs. Progress callbacks are operational tools, not just UI niceties: they support observability, timeout policies, and better failure triage in long geoprocessing runs.

Object-First Execution

Use object-first execution when your script is primarily in-memory and you want concise dataflow between steps.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem.tif')

filled = wbe.hydrology.depressions_storage.fill_depressions(dem)
accum = wbe.hydrology.flow_routing.d8_flow_accum(filled)
wbe.write_raster(accum, 'accum.tif')

Path-First Execution

Use path-first execution when you need explicit artifact paths for auditability, handoffs to external tools, or checkpointed batch runs.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

result = wbe.hydrology.depressions_storage.fill_depressions(
	dem='dem.tif',
	output='filled.tif',
)
print(result)

Basic Progress Callback

Use a simple callback for interactive runs where immediate feedback is enough.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

filled = wbe.hydrology.depressions_storage.fill_depressions(
	dem='dem.tif',
	output='filled.tif',
	callback=wb.print_progress,
)

Custom Progress Callback

Use a custom callback when integrating with logs, dashboards, job schedulers, or failure retry logic.

import json
import re

PERCENT_RE = re.compile(r'(-?\d+(?:\.\d+)?)\s*%')

def on_progress(event):
	payload = event
	if isinstance(event, str):
		try:
			payload = json.loads(event)
		except json.JSONDecodeError:
			payload = {'message': event}

	if isinstance(payload, dict):
		pct = payload.get('percent')
		msg = payload.get('message', '')
		if pct is None and msg:
			m = PERCENT_RE.search(str(msg))
			pct = float(m.group(1)) if m else None
		if pct is not None:
			if pct <= 1.0:
				pct *= 100.0
			print(f'[{int(max(0, min(100, pct))):3d}%] {msg}')

# Use: callback=on_progress

Treat this as the default operational template for robust scripts.

  1. Validate required tools.
  2. Run tool chain memory-first.
  3. Emit progress for long operations.
  4. Persist only key outputs.

Working with Rasters

This chapter documents practical raster workflows in WbW-Py with emphasis on inspection, iteration, modification, and persistence.

Raster workflows usually alternate between high-performance tool operations and targeted custom logic. The important concept is to choose the lowest-cost path for each step: use backend tools for heavy transformations, and reserve NumPy-level iteration for domain-specific adjustments that tools do not expose directly.

Raster Lifecycle

This lifecycle helps you separate inspection from transformation so assumptions about CRS, resolution, and nodata are explicit before heavy operations.

Typical lifecycle:

  1. Read raster.
  2. Inspect metadata.
  3. Transform values (tool-driven or array-driven).
  4. Persist outputs with explicit options when needed.
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem.tif')
meta = dem.metadata()

print(meta.rows, meta.columns)
print('EPSG:', meta.epsg_code)
print('NoData:', meta.nodata)

Memory-Backed Rasters for Pipeline Efficiency

For workflows that chain multiple tool operations, memory-backed rasters eliminate disk I/O between steps. This is especially valuable when processing large rasters in complex pipelines. Rasters remain in process memory, accessible to subsequent tools without writing intermediate results to disk.

Load a raster into memory with file_mode="m":

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

# Read directly into memory; no disk I/O for subsequent operations
dem = wbe.read_raster('dem.tif', file_mode='m')
slope = wbe.read_raster('slope.tif', file_mode='m')

# Both rasters are now memory-backed. Chain operations without disk:
result = dem.add(slope)
print(result.file_path)  # prints: memory://raster/...

Memory-backed paths are compatible with all downstream raster operations:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem.tif', file_mode='m')

# Inspect metadata
meta = dem.metadata()
print(f"Rows: {meta.rows}, Cols: {meta.columns}")

# Chain tool operations
scaled = wbe.run_tool('multiply', {
    'input': dem.file_path,
    'multiplier': 1.5
})

# Export to disk when ready
wbe.write_raster(scaled, 'dem_scaled_1p5x.tif')

Memory Lifecycle and Cleanup

Memory-backed rasters persist in the process store until explicitly removed or cleared. For long-running jobs, manage memory explicitly to avoid accumulation:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

# Check current memory usage
count_before = wbe.raster_memory_count()
bytes_before = wbe.raster_memory_bytes()
print(f"Rasters in memory: {count_before}")
print(f"Bytes used: {bytes_before}")

# Read two rasters
dem1 = wbe.read_raster('large_dem1.tif', file_mode='m')
dem2 = wbe.read_raster('large_dem2.tif', file_mode='m')

print(f"After reads: {wbe.raster_memory_count()}")

# Remove one raster when done
wbe.remove_raster_from_memory(dem1)
print(f"After remove: {wbe.raster_memory_count()}")

# Or clear all rasters at once
wbe.clear_raster_memory()
print(f"After clear: {wbe.raster_memory_count()}")

Best practices:

  • Use file_mode='m' for intermediate results in tool chains.
  • Export memory-backed rasters to disk with write_raster() when persisting results.
  • Call remove_raster_from_memory() after a raster is no longer needed.
  • Use clear_raster_memory() between independent job phases.
  • Use clear_memory() when resetting all in-process raster/vector/lidar stores together.
  • Monitor raster_memory_count() and raster_memory_bytes() in large pipelines.

Iterating Through Grid Cells

Use this pattern only when tool methods or vectorized operations cannot express your custom rule directly.

For cell-level logic, convert to NumPy and iterate safely.

import numpy as np
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
r = wbe.read_raster('dem.tif')
a = r.to_numpy(all_bands=False, dtype='float64')
meta = r.metadata()

rows, cols = a.shape
for row in range(rows):
    for col in range(cols):
        z = a[row, col]
        if np.isfinite(z) and z != meta.nodata:
            # Example transform: clamp negatives.
            if z < 0:
                a[row, col] = 0.0

Fast Random Cell Access with Pinning

For custom neighbourhood logic, flow-path traversal, or other pseudo-random cell access, use pinned raster views. Pinning avoids repeated per-access lookup and lock-routing overhead by holding a direct in-memory view during the loop.

Single-raster pattern:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
pointer = wbe.read_raster("D8Pointer.tif")

with pointer.pin() as p:
    v = p[100, 200]
    p[100, 200] = v + 1.0

Multi-raster scan-loop pattern (read one raster, write another):

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
src = wbe.read_raster("D8Pointer.tif")
dst = wb.Raster.new_from_other(src, data_type="int32")

with wb.pin_rasters(src, dst) as (srcp, dstp):
    meta = src.metadata()
    for row in range(meta.rows):
        for col in range(meta.columns):
            value = srcp[row, col]
            # Replace this with your custom per-cell rule.
            dstp[row, col] = value

Notes:

  • Use pinning for loops dominated by scalar r[row, col] accesses.
  • with scope exit flushes any pinned writes safely.
  • For pure row-wise transforms, get_row_data/set_row_data is still efficient.

Writing Modified Data Back

This example shows the common pattern of deriving a new raster while preserving georeferencing context from a base raster.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
base = wbe.read_raster('dem.tif')
a = base.to_numpy(all_bands=False)
a = a * 1.05

out = wb.Raster.from_numpy(a, base, output_path='dem_scaled.tif')
wbe.write_raster(out, 'dem_scaled_cog.tif', options={
    'compress': True,
    'strict_format_options': True,
    'geotiff': {'layout': 'cog', 'tile_size': 512},
})

Supported raster write keys and valid values are documented in Output Controls.

Multi-Band Iteration

Use this structure when per-band logic differs or when your transform depends on band-specific rules.

import numpy as np
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
rgb = wbe.read_raster('multiband.tif')
arr = rgb.to_numpy(all_bands=True, dtype='float32')
# arr shape is typically (bands, rows, cols)

bands, rows, cols = arr.shape
for b in range(bands):
    for row in range(rows):
        for col in range(cols):
            v = arr[b, row, col]
            if np.isfinite(v):
                arr[b, row, col] = max(v, 0.0)

wb.Raster.from_numpy(arr, rgb, output_path='multiband_clamped.tif')

Tool-First Raster Processing

This is the preferred pattern for scale: run optimized tools first, then apply targeted custom fixes only where necessary.

Use tools for most heavy computation, then iterate only where custom logic is needed.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem.tif')
filled = wbe.hydrology.depressions_storage.fill_depressions(dem)
slope = wbe.terrain.derivatives.slope(filled)

# Optional post-processing pass in NumPy.
a = slope.to_numpy(all_bands=False)
a[a < 0] = 0
slope_fixed = wb.Raster.from_numpy(a, slope)

wbe.write_raster(slope_fixed, 'slope_fixed.tif')

NoData and Performance Guidance

  • Always check metadata().nodata when doing per-cell iteration.
  • Prefer vectorized NumPy operations over nested Python loops when possible.
  • Use tool methods (wbe.hydrology.*, wbe.raster.*, wbe.terrain.*) for large transforms.
  • Persist only final outputs where possible to keep memory-first workflows efficient.

Raster Object Method Reference

The tables below focus on callable Raster methods. Common simple properties such as file_path, file_name, active_band, and band_count are omitted from the tables to keep the reference readable.

Construction, Conversion, and Summary

MethodDescription
from_numpyCreate a raster from a NumPy array while inheriting grid geometry from a base raster.
bandReturn a band-specific raster view for multiband data.
to_numpyExport the active band or all bands to NumPy for custom numeric work.
deep_copyWrite a full raster copy to a derived or explicit output path.
new_from_other, new_from_other_with_dataCreate a new raster that inherits geometry from another raster, optionally with a new data buffer.
metadataReturn the RasterConfigs summary for rows, columns, resolution, bounds, and nodata.
calculate_clip_valuesCalculate percentile-based lower and upper clip values.
calculate_mean, calculate_mean_and_stdevCompute simple raster summary statistics.
normalizeProduce a normalized raster suitable for display or downstream scaling steps.
reinitialize_valuesReset all cells to a single constant value.
update_min_maxRecompute cached minimum and maximum values after edits.
num_cells, num_valid_cellsReport total cell count and valid-cell count.
size_of, get_data_size_in_bytesReport approximate in-memory or backing-data size.
is_memory_backedIndicate whether the raster is currently memory-backed.
get_short_filename, get_file_extensionReturn convenience filename information for reporting or output naming.

Grid Navigation and Direct Editing

MethodDescription
get_value, set_valueRead or write an individual cell value.
pinReturn a pinned raster view for low-overhead random read/write access in a with scope.
get_row_data, set_row_dataRead or replace an entire row of raster values.
increment, decrementAdd to or subtract from a single cell value.
increment_row_data, decrement_row_dataAdd to or subtract from every value in a row.
is_cell_nodataCheck whether a specific cell is nodata.
get_row_from_y, get_y_from_rowConvert between world Y coordinates and raster row indices.
get_column_from_x, get_x_from_columnConvert between world X coordinates and raster column indices.

CRS and Reprojection

MethodDescription
crs_wkt, crs_epsgInspect the raster CRS as WKT text or inferred/declared EPSG code.
set_crs_wkt, set_crs_epsgAssign CRS metadata without moving the raster grid.
clear_crsRemove CRS metadata when it is known to be wrong or must be re-assigned.
reprojectReproject the raster with explicit control over resampling, extent, resolution, and grid policies.
reproject_nearest, reproject_bilinearReproject with a fixed resampling method for common nearest-neighbour or bilinear cases.
reproject_to_match_gridReproject onto the exact grid geometry of a target raster.
reproject_to_match_resolutionReproject while matching the cell resolution of a reference raster.
reproject_to_match_resolution_in_epsgReproject to a target EPSG while borrowing cell resolution from a reference raster.

Unary Math and Numeric Transforms

Unary transform calls return a single Raster object. Band selection (band_mode='all'|'active'|'list' and bands=[...]) controls which bands are changed within that returned raster.

MethodDescription
absAbsolute value transform.
acos, arccosInverse cosine transform.
acoshInverse hyperbolic cosine transform.
asin, arcsinInverse sine transform.
asinhInverse hyperbolic sine transform.
atan, arctanInverse tangent transform.
atanhInverse hyperbolic tangent transform.
cbrtCube-root transform.
ceil, floor, round, truncStandard rounding-family transforms.
clampLimit values to a minimum and maximum range.
cos, cosh, sin, sinh, tan, tanhTrigonometric and hyperbolic transforms.
degrees, to_degrees, radians, to_radiansConvert angular units between radians and degrees.
exp, exp2, expm1Exponential transforms.
ln, log10, log1p, log2Natural-log and common logarithmic transforms.
neg, signum, sqrt, square, recipNegation, sign extraction, square root, squaring, and reciprocal transforms.
is_finite, is_infinite, is_nan, is_nodataBuild masks from numeric validity tests.
logical_not, logical_not_in_place, not_Logical-not style mask inversion.

Binary Arithmetic and Comparisons

MethodDescription
add, add_in_placeAdd another raster or scalar, either to a new raster or in place.
sub, subtract, sub_in_placeSubtract another raster or scalar.
mul, multiply, mul_in_placeMultiply by another raster or scalar.
div, divide, div_in_placeDivide by another raster or scalar.
pow, power, pow_in_placeRaise values to a raster/scalar power.
atan2Compute two-argument arctangent from paired raster/scalar inputs.
min, maxCompute cellwise minima or maxima.
eq, eq_in_placeEquality comparison.
ne, ne_in_placeInequality comparison.
gt, gt_in_placeGreater-than comparison.
ge, ge_in_placeGreater-than-or-equal comparison.
lt, lt_in_placeLess-than comparison.
le, le_in_placeLess-than-or-equal comparison.

Logical Combination

MethodDescription
and_Bitwise-style cellwise AND combination.
or_Bitwise-style cellwise OR combination.
xor_Bitwise-style cellwise XOR combination.
logical_and, logical_and_in_placeLogical AND for boolean or mask rasters.
logical_or, logical_or_in_placeLogical OR for boolean or mask rasters.
logical_xor, logical_xor_in_placeLogical XOR for boolean or mask rasters.

Working with Vectors

This chapter covers schema inspection, feature iteration, attribute reads/writes, and persistence workflows.

Vector processing is often more about data contracts than geometry mechanics. Schemas, field types, and attribute consistency determine whether downstream analysis remains trustworthy. The patterns below emphasize validating structure first, then applying deterministic edits, then persisting to stable interchange formats for downstream tools.

See Also: Online Sources

If you need to acquire vectors directly from web providers (starting with OSM Overpass), see the dedicated chapter:

Read and Inspect

This step establishes the schema contract your downstream edits depend on.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
roads = wbe.read_vector('roads.gpkg')

schema = roads.schema()
print(schema)
print('features:', roads.feature_count())

Memory-Backed Vectors for Pipeline Efficiency

For workflows that chain multiple vector operations, memory-backed vectors eliminate disk I/O between steps. This is valuable for complex pipelines where intermediate results are passed between spatial operations.

Load a vector into memory with file_mode='m':

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

# Read directly into memory
roads = wbe.read_vector('roads.gpkg', file_mode='m')
rivers = wbe.read_vector('rivers.gpkg', file_mode='m')

print(roads.file_path)  # prints: memory://vector/...

Memory-backed vectors are compatible with all downstream operations:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
v = wbe.read_vector('polygons.gpkg', file_mode='m')

# Inspect schema and metadata
schema = v.schema()
meta = v.metadata()

# Pass to spatial tools
centroids = wbe.vector.geometry_processing.centroid_vector(v)

# Export to disk when ready
wbe.write_vector(centroids, 'centroids_final.gpkg')

Vector Memory Lifecycle

Memory-backed vectors persist until explicitly removed or cleared. For long-running vector pipelines, manage memory explicitly:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

# Check current memory
print(f"Vectors in memory: {wbe.vector_memory_count()}")

# Read vectors
v1 = wbe.read_vector('large1.gpkg', file_mode='m')
v2 = wbe.read_vector('large2.gpkg', file_mode='m')

print(f"After reads: {wbe.vector_memory_count()}")

# Remove when done
wbe.remove_vector_from_memory(v1)
print(f"After remove: {wbe.vector_memory_count()}")

# Or clear all
wbe.clear_vector_memory()
print(f"After clear: {wbe.vector_memory_count()}")

Implicit Memory Output from Tools

All vector-output tools store their result in memory automatically when the output parameter is omitted. You do not need to pass file_mode='m' or choose a temporary path — simply leave output out and the returned Vector object is already memory-backed:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
roads = wbe.read_vector('roads.gpkg')

# No output path — result is stored in memory automatically
centroids = wbe.vector.geometry_processing.centroid_vector(roads)
print(centroids.file_path)  # prints: memory://vector/...

# Chain operations without any intermediate files
clipped = wbe.vector.overlay_analysis.clip(centroids, 'boundary.gpkg')
print(clipped.file_path)  # also memory://vector/...

# Persist the final result only
wbe.write_vector(clipped, 'result.gpkg')

This applies to all tool categories — GIS, hydrology, geomorphometry, and stream network tools all follow the same rule. Providing an explicit output path writes to disk as before.

Best practices:

  • Use file_mode='m' for intermediate spatial analysis results.
  • Export memory-backed vectors to disk with write_vector() when persisting final outputs.
  • Call remove_vector_from_memory() after a vector is no longer needed.
  • Use clear_vector_memory() between independent analysis phases.
  • Use clear_memory() when resetting all in-process raster/vector/lidar stores together.

Iterate Through Features

Use feature iteration for inspections, QA checks, or bespoke attribute rules.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
v = wbe.read_vector('roads.gpkg')

n = v.feature_count()
for i in range(n):
    attrs = v.attributes(i)
    # attrs is dict-like; process values
    print(i, attrs)

Read and Update Attribute Table

This example demonstrates single-field updates, grouped updates, and schema extension in one controlled sequence.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
v = wbe.read_vector('roads.gpkg')

# Read one field value
name0 = v.attribute(0, 'name')
print('name[0]=', name0)

# Update one field
v.update_attribute(0, 'name', 'Main Street')

# Update multiple fields
v.update_attributes(1, {'speed': 50, 'class': 'collector'})

# Add a new field
v.add_field('reviewed', field_type='bool', default_value=False)

Persist Vector Outputs

This pattern shows both default extension behavior and explicit format control for reproducibility.

For complete write-option keys and allowed values, see Output Controls.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
roads = wbe.read_vector('roads.gpkg')
centroids = wbe.vector.geometry_processing.centroid_vector(roads)

# Extensionless output defaults to GeoPackage
wbe.write_vector(centroids, 'roads_centroids')

# Explicit output format
wbe.write_vector(buffered, 'roads_buffer.parquet', options={
    'strict_format_options': True,
    'geoparquet': {'compression': 'zstd'},
})

Practical Notes

  • Use schema() first to validate field names and types.
  • Prefer update_attributes() for grouped edits to a feature.
  • Re-read and validate after major writes, especially when switching formats.

Vector Object Method Reference

Common simple properties such as file_path and file_name are omitted here so the tables stay focused on callable Vector methods.

Schema and Attribute Access

MethodDescription
schemaReturn the vector schema, including field structure and geometry information.
feature_countReport how many features are present.
attribute_fields, attribute_field_namesInspect available attribute fields by full definition or by field name list.
attributeRead a single field value from one feature.
attributesRead all attribute values for one feature as a grouped record.
add_fieldAdd a new attribute field to the dataset schema.
update_attributeUpdate one field in one feature.
update_attributesUpdate multiple fields in one feature at once.

File, Metadata, and Copying

MethodDescription
metadataReturn VectorMetadata describing file state, CRS, and feature count.
absolute_pathResolve the vector to an absolute file path string.
parent_directoryReturn the containing directory path.
existsCheck whether the backing dataset exists on disk.
get_short_filename, get_file_extensionReturn convenience filename information.
get_file_size_in_bytes, get_last_modified_unix_secondsInspect filesystem metadata for reporting or audit logs.
deep_copyWrite a copied vector dataset to a derived or explicit output path.

CRS and Geometry-Safe Persistence

MethodDescription
crs_wkt, crs_epsgInspect CRS metadata as WKT text or EPSG code.
set_crs_wkt, set_crs_epsgAssign CRS metadata without moving feature coordinates.
clear_crsRemove CRS metadata so it can be assigned again explicitly.
reprojectReproject the vector dataset with explicit failure, topology, and antimeridian policies.

Working with Lidar

This chapter documents lidar workflows in WbW-Py, including file-backed processing, metadata checks, and output controls.

Lidar datasets are typically large enough that memory strategy becomes a primary design concern. The core pattern in this chapter is to combine file-backed objects, vectorized column operations, and chunked processing so scripts scale from small validation tiles to production-scale point clouds without rewriting your workflow model.

Baseline Workflow

This baseline confirms read, inspect, transform, and write in a single lidar path before introducing chunking complexity.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
las = wbe.read_lidar('survey.las')
meta = las.metadata()

print(meta.file_path)
print('epsg:', meta.crs_epsg)

normals = wbe.lidar.calculate_point_normals(las)
wbe.write_lidar(normals, 'survey_normals.copc.laz')

Memory-Backed Lidar for Pipeline Efficiency

For workflows that chain multiple lidar operations, memory-backed lidar objects eliminate disk I/O between steps. This is valuable when processing large point clouds through sequential filtering or classification steps.

Load a point cloud into memory with file_mode='m':

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

# Read directly into memory
survey = wbe.read_lidar('survey.las', file_mode='m')
print(survey.file_path)  # prints: memory://lidar/...

Memory-backed lidar objects support the full NumPy API and all downstream operations:

import whitebox_workflows as wb
import numpy as np

wbe = wb.WbEnvironment()

# Read into memory
survey = wbe.read_lidar('survey.las', file_mode='m')

# Inspect and process
meta = survey.metadata()
print(f'Points: {meta.point_count}')

# Extract and edit points
arr = survey.to_numpy(cols=['x', 'y', 'z', 'classification'])
high_mask = arr[:, 2] > 250
arr[high_mask, 3] = 6

# Write edits back to disk
edited = wb.Lidar.from_numpy(
    arr,
    base=survey,
    cols=['x', 'y', 'z', 'classification'],
    output_path='survey_filtered.laz',
)

Lidar Memory Lifecycle

Memory-backed lidar objects persist until explicitly removed or cleared. For long-running lidar pipelines, manage memory explicitly:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

# Check current memory
print(f"Lidar objects in memory: {wbe.lidar_memory_count()}")

# Read point clouds
survey1 = wbe.read_lidar('large1.las', file_mode='m')
survey2 = wbe.read_lidar('large2.las', file_mode='m')

print(f"After reads: {wbe.lidar_memory_count()}")

# Remove when done
wbe.remove_lidar_from_memory(survey1)
print(f"After remove: {wbe.lidar_memory_count()}")

# Or clear all
wbe.clear_lidar_memory()
print(f"After clear: {wbe.lidar_memory_count()}")

Implicit Memory Output from Tools

All lidar-output tools store their result in memory automatically when the output parameter is omitted. You do not need to pass file_mode='m' or choose a temporary path — simply leave output out and the returned Lidar object is already memory-backed:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
survey = wbe.read_lidar('survey.laz')

# No output path — result is stored in memory automatically
filtered = wbe.lidar.filtering_classification.filter_lidar_classes(survey, excluded_classes=[7])
print(filtered.file_path)  # prints: memory://lidar/...

# Chain operations without any intermediate files
thinned = wbe.lidar.interpolation_gridding.lidar_thin(filtered, resolution=0.5)
print(thinned.file_path)  # also memory://lidar/...

# Persist the final result only
wbe.write_lidar(thinned, 'survey_clean.copc.laz')

This applies to all lidar tools. Providing an explicit output path writes to disk as before.

Best practices:

  • Use file_mode='m' for intermediate point cloud processing.
  • Export memory-backed lidar to disk with write_lidar() when persisting final outputs.
  • Call remove_lidar_from_memory() after a point cloud is no longer needed.
  • Use clear_lidar_memory() between independent analysis phases.
  • Use clear_memory() when resetting all in-process raster/vector/lidar stores together.
  • Monitor lidar_memory_count() for large processing jobs.

Iterating Through Lidar Points

Stable WbW-Py lidar objects are file-backed and tool-oriented, with explicit columnar point access through NumPy. Direct point-by-point Python iterators are still not the primary API path.

Recommended point-level workflow:

  1. Use Lidar.to_numpy() with selected point fields.
  2. Perform vectorized filtering/classification edits in NumPy.
  3. Write updates with Lidar.from_numpy(...).

The example below reclassifies points using a simple mask to illustrate the pattern without domain-specific classification logic.

import whitebox_workflows as wb
import numpy as np

wbe = wb.WbEnvironment()
las = wbe.read_lidar('survey.las')

arr = las.to_numpy(cols=['x', 'y', 'z', 'classification'])
ground_mask = arr[:, 3] == 2
arr[ground_mask, 3] = 6

edited = wb.Lidar.from_numpy(
    arr,
    base=las,
    cols=['x', 'y', 'z', 'classification'],
    output_path='survey_reclassified.laz',
)

print('points:', edited.point_count)

Output Controls

Use these options when you need to tune compression and structure for storage, cloud access, or downstream compatibility.

For complete lidar write-option keys and allowed values, see Output Controls.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
las = wbe.read_lidar('survey.las')

wbe.write_lidar(las, 'survey_out.laz', options={
    'laz': {
        'chunk_size': 25000,
        'compression_level': 7,
    },
})

wbe.write_lidar(las, 'survey_out.copc.laz', options={
    'copc': {
        'max_points_per_node': 75000,
        'max_depth': 8,
        'node_point_ordering': 'hilbert',
    },
})

Chunked Numpy Streaming

For very large point clouds, use chunked column streaming to avoid holding a full point matrix in memory.

Recommended chunked workflow:

  1. Read chunks with Lidar.to_numpy_chunks(...).
  2. Apply vectorized edits per chunk.
  3. Write edited chunks with Lidar.from_numpy_chunks(...).

Use this pattern whenever full-matrix reads risk exhausting memory.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
lidar = wbe.read_lidar('survey.las')

cols = ['x', 'y', 'z', 'classification']
chunks = lidar.to_numpy_chunks(chunk_size=200_000, cols=cols)

for chunk in chunks:
    # Reclassify non-ground points above a simple elevation threshold.
    mask = chunk[:, 2] > 250.0
    chunk[mask, 3] = 6

edited = wb.Lidar.from_numpy_chunks(
    chunks,
    base=lidar,
    cols=cols,
    output_path='survey_chunked_reclassified.laz',
)

print('points:', edited.point_count)

For callback-driven processing, pass callback= to to_numpy_chunks(...) to process each chunk as it is decoded. In callback mode, no list is returned.

Notes:

  • LAS/LAZ chunk outputs use the shared core streaming rewrite path.
  • Other output formats currently use the existing non-streaming write path.

Best Practices

  • Validate CRS before and after transformations.
  • Prefer COPC output for large datasets and cloud streaming scenarios.
  • Keep raw source lidar immutable; write derived products to new files.

Lidar Object Method Reference

Common simple properties such as file_path, file_name, and point_count are omitted here so the tables stay focused on callable Lidar methods and the most important array-processing workflows.

Array and Chunk Workflows

MethodDescription
to_numpyExport selected point fields as a 2D NumPy array.
to_numpy_chunksStream selected point fields as chunked NumPy arrays for large clouds.
from_numpyBuild a new lidar file by applying a full 2D NumPy array back onto a base cloud.
from_numpy_chunksBuild a new lidar file from an iterable of chunked NumPy arrays.

File, Metadata, and Copying

MethodDescription
metadataReturn LidarMetadata for path, file state, and CRS information.
absolute_pathResolve the cloud to an absolute file path string.
parent_directoryReturn the containing directory path.
existsCheck whether the backing lidar file exists.
get_short_filename, get_file_extensionReturn convenience filename information.
get_file_size_in_bytes, get_last_modified_unix_secondsInspect filesystem metadata for reporting or audit logs.
deep_copyWrite a copied lidar dataset to a new path.
copy_to_pathCopy the lidar dataset to an explicit destination.
write_to_pathPersist the lidar dataset with optional format-specific write options.

CRS and Coordinate Management

MethodDescription
crs_wkt, crs_epsgInspect CRS metadata as WKT text or EPSG code.
set_crs_wkt, set_crs_epsgAssign CRS metadata without moving point coordinates.
clear_crsRemove CRS metadata when it is wrong or unknown.
reprojectReproject the point cloud with explicit 3D-transform and failure-policy controls.

Working with Sensor Bundles

This chapter documents supported sensor bundle families and common workflows.

Bundle APIs abstract away family-specific packaging details so you can focus on analysis intent: identify useful channels, inspect quality assets, and produce consistent derived outputs. The conceptual goal is to normalize early-stage ingestion across heterogeneous providers while preserving enough provenance to keep downstream interpretation defensible.

Supported Families

  • Generic auto-detect: read_bundle(...)
  • Landsat: read_landsat(...)
  • Sentinel-1 SAFE: read_sentinel1(...)
  • Sentinel-2 SAFE: read_sentinel2(...)
  • PlanetScope: read_planetscope(...)
  • ICEYE: read_iceye(...)
  • DIMAP: read_dimap(...)
  • Maxar/WorldView: read_maxar_worldview(...)
  • RADARSAT-2: read_radarsat2(...)
  • RCM: read_rcm(...)

Common Inspection Pattern

Start with this inspection sequence to quickly understand what content is available before choosing analysis-specific channels.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
b = wbe.read_bundle('BUNDLE_ROOT')

print('family:', b.family)
print('bands:', b.list_band_keys())
print('measurements:', b.list_measurement_keys())
print('qa:', b.list_qa_keys())
print('assets:', b.list_asset_keys())

Family-Specific Examples

These examples show the same workflow shape across different providers: load, inspect keys, read representative channels, then generate a preview or derived artifact.

Sentinel-2

Use this when building optical workflows from known band identifiers.

s2 = wbe.read_sentinel2('S2_SCENE.SAFE')
red = s2.read_band('B04')
nir = s2.read_band('B08')
rgb = s2.true_colour_composite(wbe, output_path='s2_true_colour.tif')

Landsat

Use this when scene metadata and quality indicators are part of ingestion logic.

ls = wbe.read_landsat('LC09_SCENE')
print(ls.processing_level(), ls.cloud_cover_percent())
preview = ls.read_band(ls.list_band_keys()[0])

Sentinel-1 / SAR Families

Use this for SAR measurement inspection and quick visual QA composites.

s1 = wbe.read_sentinel1('S1_SCENE.SAFE')
print(s1.polarizations())
meas = s1.read_measurement(s1.list_measurement_keys()[0])
false_colour = s1.false_colour_composite(wbe, output_path='s1_false_colour.tif')

PlanetScope / ICEYE / DIMAP / Maxar-WorldView / RADARSAT-2 / RCM

This loop pattern is useful for multi-provider pipelines that need consistent intake checks.

for loader, path in [
    (wbe.read_planetscope, 'PLANETSCOPE_SCENE'),
    (wbe.read_iceye, 'ICEYE_SCENE'),
    (wbe.read_dimap, 'DIMAP_SCENE'),
    (wbe.read_maxar_worldview, 'MAXAR_SCENE'),
    (wbe.read_radarsat2, 'RADARSAT2_SCENE'),
    (wbe.read_rcm, 'RCM_SCENE'),
]:
    bundle = loader(path)
    print(bundle.family, bundle.bundle_root)
  1. Open with family-specific reader when known.
  2. Inspect key sets (list_*_keys).
  3. Read representative channels.
  4. Build previews/composites for QA.
  5. Persist derived rasters and document source family + key choices.

Calibration Contract Notes (Landsat/Sentinel-2)

Remote-sensing radiometric and thermal tools in WbW-Python now rely on a standardized sensor-bundle calibration contract in wbraster.

  • Sentinel-2 bundle metadata provides quantification values used for DN to TOA reflectance scaling.
  • Landsat bundles provide typed per-band reflectance and thermal constants used in TOA reflectance and LST workflows.

For best results, keep original SAFE/MTL metadata with scene rasters when moving or staging bundle data for analysis.

Sensor Bundle Object Method Reference

Common bundle properties such as family and bundle_root are omitted here so the tables stay focused on callable Bundle methods.

Key Discovery and Data Access

MethodDescription
list_band_keysList spectral or image-band keys exposed by the bundle.
list_measurement_keysList measurement-layer keys, commonly used in SAR families.
list_qa_keysList quality-assurance layer keys.
list_asset_keysList auxiliary assets packaged with the bundle.
list_aux_keysList auxiliary layers that are not primary bands or measurements.
read_bandRead a band by key as a raster object.
read_measurementRead a measurement layer by key as a raster object.
read_qa_layerRead a QA layer by key as a raster object.
read_assetRead a named asset from the bundle.
read_aux_layerRead an auxiliary layer by key.

Scene and Platform Metadata

MethodDescription
metadata_jsonReturn the bundle metadata payload as JSON text.
mission, product_type, processing_level, processing_baselineInspect the provider, product family, and processing lineage.
scene_id, tile_id, collection_number, path_rowInspect scene identifiers used for cataloging and lineage.
acquisition_datetime_utc, acquisition_modeInspect when and how the scene was acquired.
cloud_cover_percentReport cloud cover when the bundle family exposes it.
polarization, polarizationsInspect single-polarization or multi-polarization SAR metadata.
look_direction, orbit_directionInspect platform look and orbit geometry.
incidence_angle_near_deg, incidence_angle_far_deg, off_nadir_angle_deg, view_angle_degInspect sensor/view geometry angles.
sun_azimuth_deg, sun_elevation_deg, sun_zenith_degInspect solar geometry for optical scenes.
pixel_spacing_range_m, pixel_spacing_azimuth_mInspect SAR-oriented pixel spacing metadata.
spatial_boundsReturn spatial footprint bounds for the scene.

Derived Preview Products

MethodDescription
true_colour_compositeBuild a true-colour preview raster when the bundle family supports it.
false_colour_compositeBuild a false-colour preview raster for quick QA or analysis setup.

Output Controls

This chapter documents output controls for raster, vector, and lidar writes in WbW-Py.

Output settings are where reproducibility becomes explicit. Defaults are useful for fast iteration, but production workflows should pin format, compression, and layout choices so outputs remain comparable across runs and environments. Treat this chapter as the policy layer for how artifacts are written, named, and validated.

General Principles

  • Start with default output behavior unless you need strict reproducibility.
  • Use strict_format_options=True when you want invalid option/format combinations to fail instead of silently ignoring options.
  • Prefer extensionless outputs for sensible defaults when prototyping.

Raster Output Controls

write_raster(...) and write_rasters(...) support an options dictionary.

Use this when output layout and compression are part of a reproducibility or distribution requirement.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
r = wbe.read_raster('dem.tif')

wbe.write_raster(r, 'out_default.tif')

wbe.write_raster(
    r,
    'out_cog.tif',
    options={
        'compress': True,
        'strict_format_options': True,
        'geotiff': {
            'layout': 'cog',
            'tile_size': 512,
            'compression': 'deflate',
            'bigtiff': False,
        },
    },
)

Raster Write Option Reference

The raster options dictionary currently supports these top-level keys:

  • compress: boolean convenience switch for GeoTIFF-family outputs.
  • strict_format_options: boolean validation switch.
  • geotiff: nested dictionary for GeoTIFF / BigTIFF / COG-specific controls.
  • jpeg2000: nested dictionary for JPEG2000 (.jp2) controls.

compress

compress is a convenience flag. It applies only to GeoTIFF-family outputs.

  • True: maps to GeoTIFF deflate compression.
  • False: maps to uncompressed GeoTIFF output.

Default behavior:

  • compress is unset by default (not True and not False).
  • For GeoTIFF-family outputs, an unset compress falls through to the GeoTIFF writer default compression, which is deflate.
  • For non-GeoTIFF outputs, compress has no effect.

If geotiff.compression is also supplied, the explicit geotiff.compression value takes precedence over compress.

strict_format_options

strict_format_options accepts True or False.

  • False (default): GeoTIFF-specific options are ignored when writing a non-GeoTIFF output such as .jp2, .gpkg, or .zarr; JPEG2000-specific options are ignored when writing non-.jp2 outputs.
  • True: using GeoTIFF-specific options with a non-GeoTIFF output path, or JPEG2000-specific options with a non-.jp2 output path, raises an error.

jpeg2000

The jpeg2000 dictionary supports these keys:

  • compression: string compression mode.
  • quality_db: numeric quality target in dB used when compression='lossy'.
  • decomp_levels: non-negative integer decode-resolution level hint (0 to 255).
  • color_space: string color-space override.

Default values when keys are omitted:

  • compression: lossy.
  • quality_db: 35.0 when compression='lossy' and no explicit quality_db is provided.
  • decomp_levels: writer default (unset).
  • color_space: writer default (unset); inferred from band layout when possible.

Supported jpeg2000.compression values:

  • lossless
  • lossy

Supported jpeg2000.color_space values:

  • greyscale (aliases: grayscale, gray, grey)
  • srgb (alias: rgb)
  • ycbcr (alias: ycb)
  • multiband (aliases: multi_band, multi)

Notes:

  • quality_db is optional; when omitted with compression='lossy', the writer default quality is used.

geotiff

The geotiff dictionary supports these keys:

  • compression: string compression codec.
  • bigtiff: boolean.
  • layout: string layout name.
  • rows_per_strip: positive integer used when layout='stripped'.
  • tile_width: positive integer used when layout='tiled'.
  • tile_height: positive integer used when layout='tiled'.
  • tile_size: positive integer shortcut used by layout='cog', and also accepted as a shortcut for both tile width and tile height when layout='tiled'.
  • cog_tile_size: positive integer alias for tile_size when layout='cog'.

Default values when keys are omitted:

  • compression: deflate.
  • bigtiff: False.
  • layout: standard.
  • rows_per_strip: 1 when layout='stripped'.
  • tile_width: 512 when layout='tiled'.
  • tile_height: defaults to tile_width when layout='tiled'.
  • tile_size / cog_tile_size: 512 when layout='cog'.

Supported geotiff.compression values:

  • none
  • off
  • uncompressed
  • deflate
  • zip
  • lzw
  • packbits
  • pack_bits
  • jpeg
  • webp
  • web_p
  • jpegxl
  • jpeg_xl
  • jxl

These names are aliases for the same underlying codecs:

  • none, off, and uncompressed
  • deflate and zip
  • packbits and pack_bits
  • webp and web_p
  • jpegxl, jpeg_xl, and jxl

Supported geotiff.layout values:

  • standard: default GeoTIFF writer behavior.
  • stripped: strip-organized GeoTIFF.
  • striped: alias for stripped.
  • tiled: tiled GeoTIFF.
  • cog: Cloud-Optimized GeoTIFF.

Layout-specific parameter behavior:

  • layout='standard': ignores strip/tile size keys.
  • layout='stripped' or layout='striped': uses rows_per_strip. Default is 1 if omitted.
  • layout='tiled': uses tile_width and tile_height. If omitted, tile_width defaults to 512. tile_height defaults to tile_width. If tile_size is supplied, it is accepted as a shortcut for both dimensions.
  • layout='cog': uses tile_size or cog_tile_size. Default is 512 if neither is supplied.

Extensionless Raster Outputs

If you omit the output extension, raster writes default to .tif. In that case the wrapper also defaults the GeoTIFF layout to COG unless you explicitly set a different layout.

# Writes my_surface.tif and defaults to COG-style layout.
wbe.write_raster(r, 'my_surface')

Practical Patterns

# Explicit uncompressed standard GeoTIFF
wbe.write_raster(r, 'out_standard_uncompressed.tif', options={
        'compress': False,
        'geotiff': {'layout': 'standard'},
})

# Stripped GeoTIFF with 64 rows per strip
wbe.write_raster(r, 'out_stripped.tif', options={
        'geotiff': {'layout': 'stripped', 'rows_per_strip': 64},
})

# Tiled GeoTIFF using a single tile_size shortcut
wbe.write_raster(r, 'out_tiled.tif', options={
        'geotiff': {'layout': 'tiled', 'tile_size': 256},
})

# COG with explicit codec and BigTIFF toggle
wbe.write_raster(r, 'out_cog.tif', options={
        'strict_format_options': True,
        'geotiff': {
                'layout': 'cog',
                'tile_size': 512,
                'compression': 'deflate',
                'bigtiff': False,
        },
})

Common Raster Profiles

These profiles illustrate common tradeoffs between compatibility and read performance.

# Stripped GeoTIFF
wbe.write_raster(r, 'out_stripped.tif', options={
    'geotiff': {'layout': 'stripped', 'rows_per_strip': 32},
})

# Tiled GeoTIFF
wbe.write_raster(r, 'out_tiled.tif', options={
    'geotiff': {'layout': 'tiled', 'tile_width': 256, 'tile_height': 256},
})

Vector Output Controls

write_vector(...) supports format-specific options.

Use strict format options in production so incompatible settings fail fast.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
v = wbe.read_vector('roads.gpkg')

# Extensionless output defaults to GeoPackage
wbe.write_vector(v, 'roads_copy')

# GeoParquet with strict options
wbe.write_vector(
    v,
    'roads.parquet',
    options={
        'strict_format_options': True,
        'geoparquet': {
            'compression': 'zstd',
            'max_rows_per_group': 250000,
            'write_batch_size': 8192,
        },
    },
)

Vector Write Option Reference

For vector writes, the options dictionary supports these keys:

  • strict_format_options: boolean validation switch.
  • geoparquet: nested dictionary used for GeoParquet-specific controls.

strict_format_options

  • False (default): format-specific options are ignored when they do not apply to the selected output format.
  • True: format-specific options on an incompatible output path raise an error.

geoparquet

The geoparquet dictionary supports:

  • max_rows_per_group: positive integer.
  • data_page_size_limit: positive integer.
  • write_batch_size: positive integer.
  • data_page_row_count_limit: positive integer.
  • compression: string codec name.

Default values when keys are omitted:

  • max_rows_per_group: 1_048_576.
  • data_page_size_limit: Parquet library default page size.
  • write_batch_size: Parquet library default write batch size.
  • data_page_row_count_limit: Parquet library default row-count limit.
  • compression: Parquet library default compression codec.

Supported geoparquet.compression values:

  • none
  • snappy
  • gzip
  • lz4
  • zstd
  • brotli

Notes:

  • GeoParquet controls are only applied for .parquet outputs.
  • If no output extension is provided, vector writes default to .gpkg.
# GeoParquet with explicit row-group and compression controls
wbe.write_vector(v, 'roads.parquet', options={
        'strict_format_options': True,
        'geoparquet': {
                'compression': 'zstd',
                'max_rows_per_group': 250000,
                'data_page_size_limit': 1048576,
                'write_batch_size': 8192,
                'data_page_row_count_limit': 20000,
        },
})

Lidar Output Controls

write_lidar(...) supports LAZ and COPC option blocks.

Choose LAZ for compact archives and COPC when cloud-native spatial access is important.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
l = wbe.read_lidar('survey.las')

# LAZ controls
wbe.write_lidar(l, 'survey_out.laz', options={
    'laz': {'chunk_size': 25000, 'compression_level': 7},
})

# COPC controls
wbe.write_lidar(l, 'survey_out.copc.laz', options={
    'copc': {
        'max_points_per_node': 75000,
        'max_depth': 8,
        'node_point_ordering': 'hilbert',
    },
})

Lidar Write Option Reference

For lidar writes, the options dictionary supports these top-level keys:

  • laz: nested dictionary with LAZ writer controls.
  • copc: nested dictionary with COPC hierarchy controls.

laz

Supported keys:

  • chunk_size: positive integer.
  • compression_level: integer compression level.

Default values when keys are omitted:

  • chunk_size: 50000.
  • compression_level: 6.

compression_level is typically used in the 0-9 range for LAZ workflows.

copc

Supported keys:

  • max_points_per_node: positive integer.
  • max_depth: positive integer.
  • node_point_ordering: string ordering mode.

Default values when keys are omitted:

  • max_points_per_node: 100000.
  • max_depth: 8.
  • node_point_ordering: auto.

Supported copc.node_point_ordering values:

  • auto
  • morton
  • hilbert

Notes:

  • If no output extension is provided, lidar writes default to .copc.laz.
  • COPC options are relevant when output format is COPC (.copc.laz or .copc.las).
# Extensionless output defaults to COPC
wbe.write_lidar(l, 'survey_out', options={
    'copc': {
        'max_points_per_node': 75000,
        'max_depth': 8,
        'node_point_ordering': 'hilbert',
    },
})

# Explicit LAZ controls
wbe.write_lidar(l, 'survey_out.laz', options={
    'laz': {
        'chunk_size': 25000,
        'compression_level': 7,
    },
})

Memory Lifecycle and Cleanup

For workflows that use memory-backed rasters, vectors, and lidar objects (file_mode='m'), explicit lifecycle management prevents unbounded memory growth in long-running jobs.

When to use memory mode

Memory mode is most valuable when:

  • Chaining multiple operations on the same data without disk I/O.
  • Processing intermediate results that are never persisted to disk.
  • Running batched analysis where you load, process, and clear per batch.
  • Working with smaller datasets where memory is not a constraint.

Avoid memory mode when:

  • Working with data larger than available RAM.
  • Processing single operations on large files.
  • Running unattended long-running jobs without explicit cleanup.

Explicit cleanup in long-running pipelines

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

# Long-running batch analysis
for tile_id in range(1, 1001):
    print(f'Processing tile {tile_id}')
    
    # Read data into memory for this tile
    dem = wbe.read_raster(f'tile_{tile_id}.tif', file_mode='m')
    bounds = wbe.read_vector(f'bounds_{tile_id}.gpkg', file_mode='m')
    
    # Process
    result = wbe.run_tool('clip_raster_by_polygon', {
        'input': dem.file_path,
        'polygon': bounds.file_path,
        'output': f'clipped_{tile_id}.tif'
    })
    
    # Explicit cleanup before next iteration
    wbe.remove_raster_from_memory(dem)
    wbe.remove_vector_from_memory(bounds)

Monitoring memory usage

For production scripts, track memory explicitly:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

print(f"Initial raster memory: {wbe.raster_memory_bytes() / 1e6:.1f} MB")
print(f"Initial vector memory: {wbe.vector_memory_bytes() / 1e6:.1f} MB")

# ... run operations ...

# Before returning or starting new phase
print(f"Final raster count: {wbe.raster_memory_count()}")
print(f"Final raster memory: {wbe.raster_memory_bytes() / 1e6:.1f} MB")

# Explicit reset if needed
wbe.clear_memory()
print(f"After clear: {wbe.raster_memory_count()}")

Extensionless Defaults

Extensionless writes are useful in prototyping, but pin extensions in production for deterministic artifact naming.

When no extension is provided:

  • raster -> .tif (COG-style GeoTIFF default)
  • vector -> .gpkg
  • lidar -> .copc.laz
wbe.write_raster(r, 'my_raster')
wbe.write_vector(v, 'my_vector')
wbe.write_lidar(l, 'my_lidar')

Reproducibility Checklist

  1. Pin output extension explicitly.
  2. Set strict_format_options=True when format mismatches must error.
  3. Pin codec/layout/tile parameters for raster outputs.
  4. For vector/lidar, pin format-specific compression and partitioning options.
  5. Re-open output and validate metadata before downstream analysis.

Supported Data Formats

This chapter summarizes practical format support exposed through WbW-Py.

Format support influences interoperability, performance, and long-term archive strategy. Read/write capability is only one part of the decision; you should also consider ecosystem compatibility, compression behavior, and whether a given format is best used as an interchange artifact or as an internal working format.

Backend support comes from core crates:

  • Raster: wbraster
  • Vector: wbvector
  • Lidar: wblidar

Raster Formats

Exhaustive raster format support in the current WbW-Py build:

FormatRead (read_raster)Write (write_raster)Common extensions / path rules
DTEDYesYes.dt0, .dt1, .dt2 (DTED 0, 1, 2 elevation data; WGS-84 geographic only)
Esri ASCII GridYesYes.asc (and .grd when detected as ASCII)
Esri Binary Grid workspaceYesBackend-onlyEsri Binary workspace directory (hdr.adf + w001001.adf) or .adf
Esri Float GridYesYes.flt, .hdr (single-band float grid with header file)
ERDAS IMAGINE (HFA)YesNo.img - read-only MVP; RLC (run-length) compression supported
GRASS ASCII RasterYesYes.txt / .asc when GRASS header keys are detected
Surfer GRDYesYes.grd (DSAA / DSRB signatures)
PCRasterYesYes.map (CSF signature)
SAGA Binary GridYesYes.sdat, .sgrd
Idrisi / TerrSet RasterYesYes.rst, .rdc
ER MapperYesYes.ers
ENVI HDR-labelled rasterYesYes.hdr, or data files (.img, .dat, .bin, .raw, .bil, .bsq, .bip) with .hdr sidecar
GeoTIFF / BigTIFF / COGYesYes.tif, .tiff
GeoPackage rasterYesYes.gpkg
JPEG2000 / GeoJP2YesYes.jp2
JPEG + World FileYesYes.jpg, .jpeg with .jgw, .jpgw, .jpegw, or .wld world file
PNG + World FileYesYes.png with .pgw, .pngw, or .wld world file
ZarrYesYes.zarr store (directory / suffix)
XYZ ASCII GridYesYes.xyz (whitespace or comma-delimited X Y Z points)

Typical pattern:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
r = wbe.read_raster('dem.tif')
wbe.write_raster(r, 'dem_out.tif')

Vector Formats

Exhaustive vector format support in the current WbW-Py build:

FormatRead (read_vector)Write (write_vector)Extensions / notes
FlatGeobufYesYes.fgb
GeoJSONYesYes.geojson, .json
TopoJSONYesYes.topojson
GeoPackageYesYes.gpkg
GeoParquetYesYes.parquet
GMLYesYes.gml
GPXYesYes.gpx
KMLYesYes.kml
KMZYesYes.kmz
MapInfo InterchangeYesYes.mif with .mid sidecar
OSM PBFYesNo.osm.pbf (read workflows only)
ESRI ShapefileYesYes.shp plus dataset sidecars

When write_vector(...) is called without an extension, WbW-Py defaults output to .gpkg.

Typical pattern:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
v = wbe.read_vector('roads.gpkg')
wbe.write_vector(v, 'roads_out.gpkg')

Lidar Formats

Exhaustive lidar format support in the current WbW-Py build:

FormatRead (read_lidar)Write (write_lidar)Extensions / notes
LASYesYes.las
LAZYesYes.laz
COPCYesYes.copc.las, .copc.laz
PLYYesYes.ply
E57YesYes.e57

When write_lidar(...) is called without an extension, WbW-Py defaults output to .copc.laz.

Typical pattern:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
l = wbe.read_lidar('survey.las')
wbe.write_lidar(l, 'survey_out.copc.laz')

Sensor Bundle Families

Supported bundle readers include:

  • read_bundle(...) (auto-detect)
  • read_landsat(...)
  • read_sentinel1(...)
  • read_sentinel2(...)
  • read_planetscope(...)
  • read_iceye(...)
  • read_dimap(...)
  • read_maxar_worldview(...)
  • read_radarsat2(...)
  • read_rcm(...)

Bundle inputs may be either extracted directories or supported archives:

  • .zip
  • .tar
  • .tar.gz
  • .tgz

See Working with Sensor Bundles for family-specific examples.

Validation Guidance

  1. Prefer stable interchange formats (.tif, .gpkg, .copc.laz) for production pipelines.
  2. Re-open outputs and verify metadata after write operations.
  3. Use explicit options where format behavior must be reproducible.

Reprojection and CRS

This chapter covers raster, vector, and lidar reprojection in WbW-Py.

CRS handling is a semantic correctness issue, not just a metadata preference. When coordinate assumptions are wrong, analyses may still run but yield invalid spatial conclusions. The patterns here emphasize explicit source/destination CRS checks, controlled reprojection settings, and immediate post-transform verification before any downstream computation.

CRS Inspection

Run this first to verify assumptions before any reprojection call.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem.tif')
roads = wbe.read_vector('roads.gpkg')
las = wbe.read_lidar('survey.las')

print('raster epsg:', dem.metadata().epsg_code)
print('vector epsg:', roads.metadata().crs_epsg)
print('lidar epsg:', las.metadata().crs_epsg)

Assigning Projection Metadata

Use CRS assignment only when the coordinates are already in the correct coordinate system but the file metadata is missing or wrong. Assignment does not move coordinates; it only changes the declared CRS. If you need to change the coordinate values themselves, use the reprojection methods shown later in this chapter.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem_without_crs.tif')
roads = wbe.read_vector('roads_without_crs.gpkg')
las = wbe.read_lidar('survey_without_crs.las')

# Assign by EPSG when you know the coordinates already use that CRS.
dem.set_crs_epsg(26917)
roads.set_crs_epsg(26917)

# Assign by WKT when that is the CRS information you have available.
utm_wkt = wbe.projection.to_ogc_wkt(26917)
las.set_crs_wkt(utm_wkt)

print('raster epsg after assignment:', dem.crs_epsg())
print('vector epsg after assignment:', roads.crs_epsg())
print('lidar epsg after assignment:', las.crs_epsg())

# If metadata is wrong rather than missing, clear it before reassigning.
roads.clear_crs()
roads.set_crs_epsg(26917)

This pattern is especially useful for legacy rasters, sidecar-free vector exports, and lidar files that have correct coordinates but incomplete CRS metadata.

Raster Reprojection

WbW-Py exposes six raster-object reprojection methods. Use the one that matches your grid-control needs:

  1. raster.reproject(...): General method with full control over extent, rows/cols, resolution, snap origin, nodata policy, antimeridian policy, grid-size policy, and destination footprint.
  2. raster.reproject_nearest(dst_epsg, ...): Convenience wrapper for nearest-neighbour reprojection.
  3. raster.reproject_bilinear(dst_epsg, ...): Convenience wrapper for bilinear reprojection.
  4. raster.reproject_to_match_grid(target_grid, ...): Reprojects and snaps exactly to another raster's grid geometry (extent, rows, cols, resolution).
  5. raster.reproject_to_match_resolution(reference_grid, ...): Reprojects while matching the reference raster's resolution and snap behavior.
  6. raster.reproject_to_match_resolution_in_epsg(dst_epsg, reference_grid, ...): Reprojects to a specified EPSG while deriving output resolution controls from a reference raster.

Available resampling methods (wbraster)

Use these values anywhere a reprojection method accepts resample:

  • nearest: category-safe nearest-neighbour.
  • bilinear: smooth linear interpolation.
  • cubic: bicubic interpolation.
  • lanczos: high-quality sinc-window interpolation.
  • average: 3x3 mean statistic.
  • min: 3x3 minimum statistic.
  • max: 3x3 maximum statistic.
  • mode: 3x3 modal statistic.
  • median: 3x3 median statistic.
  • stddev: 3x3 standard deviation statistic.

Practical defaults:

  • Categorical/class rasters: nearest (or mode for smoothing by majority).
  • Continuous surfaces (DEM, reflectance, temperature): bilinear, cubic, or lanczos.
  • Thematic/statistical resamples: average, min, max, median, stddev.

Example: full-control reprojection

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem.tif')

dem_utm = dem.reproject(
    dst_epsg=32618,
    resample='bilinear',
    x_res=10.0,
    y_res=10.0,
    nodata_policy='partial_kernel',
    antimeridian_policy='auto',
    grid_size_policy='expand',
    destination_footprint='none',
)

wbe.write_raster(dem_utm, 'dem_utm_10m.tif')

Example: grid-matching reprojection

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
src = wbe.read_raster('landcover_4326.tif')
target = wbe.read_raster('dem_utm_10m.tif')

# Categorical raster: nearest is typically required.
aligned = src.reproject_to_match_grid(target, resample='nearest')
wbe.write_raster(aligned, 'landcover_aligned.tif')

Automatic reprojection in raster-stack tools

Several stack-based tools now support automatic stack alignment with explicit controls:

  • auto_reproject (default true)
  • auto_reproject_method (optional override)

Current behavior:

  1. inputs[0] is treated as the reference raster.
  2. Any stack raster with mismatched CRS is auto-reprojected to match the reference grid when auto_reproject=true.
  3. If auto_reproject_method is unset:
    • categorical rasters infer nearest
    • continuous rasters infer bilinear
  4. If extents do not overlap after alignment, tools raise a hard error.

This is especially important for stack workflows (input_rasters/inputs) such as overlay operations, weighted sums, PCA, inverse PCA, raster calculator, image segmentation, and position-based stack selection.

Example: stack tool with automatic reprojection

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

result = wbe.run_tool(
    'weighted_sum',
    {
        'input_rasters': ['slope_utm.tif', 'landcover_4326.tif', 'distance_utm.tif'],
        'weights': [0.4, 0.35, 0.25],
        'auto_reproject': True,
        'auto_reproject_method': '',  # empty -> infer nearest/bilinear per raster
        'output': 'weighted_sum.tif',
    },
)
print(result)

Vector Reprojection

This pattern is appropriate when geometry validity and failure policy need to be explicit.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
roads = wbe.read_vector('roads.gpkg')

roads_utm = wbe.projection_georeferencing.general.reproject_vector(
    roads,
    dst_epsg=32618,
    failure_policy='error',
    topology_policy='none',
)

wbe.write_vector(roads_utm, 'roads_utm.gpkg')

Lidar Reprojection

Use explicit lidar reprojection settings to avoid silent dimensional or policy defaults.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
las = wbe.read_lidar('survey.las')

las_utm = wbe.projection_georeferencing.general.reproject_lidar(
    las,
    dst_epsg=32618,
    use_3d_transform=False,
    failure_policy='error',
)

wbe.write_lidar(las_utm, 'survey_utm.copc.laz')

Georeference Raster from Control Points

Use this tool when an image/raster has no reliable georeferencing and you have ground-control points (GCPs) linking image pixel coordinates to map coordinates.

Required CSV fields:

  • source_col
  • source_row
  • target_x
  • target_y
import whitebox_workflows as wb

wbe = wb.WbEnvironment()

result = wbe.projection_georeferencing.general.georeference_raster_from_control_points(
    input_raster='historical_scan.tif',
    control_points_csv='historical_scan_gcps.csv',
    epsg=32618,
    resample='bilinear',
    output='historical_scan_georef.tif',
    report='historical_scan_georef_report.json',  # optional diagnostics JSON
)

print(result)

If you need raw runtime invocation style, the equivalent tool ID is georeference_raster_from_control_points.

Projection Utility Namespace

This namespace is useful for CRS diagnostics and point-level coordinate transform tasks outside full dataset reprojection.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

wkt_3857 = wbe.projection.to_ogc_wkt(3857)
print('epsg from wkt:', wbe.projection.identify_epsg(wkt_3857))

pts = [{'x': -79.3832, 'y': 43.6532}]
pts_utm = wbe.projection.reproject_points(pts, src_epsg=4326, dst_epsg=32618)
print(pts_utm)

Parse a PROJ string

Use projection.from_proj_string when you have a PROJ4-style string (e.g., read from a legacy file header or third-party metadata) and need to identify the corresponding EPSG code or obtain an OGC WKT representation.

The method returns a dict with exactly one of these keys:

  • {'epsg': int} — EPSG code identified
  • {'wkt': str} — no EPSG match, WKT representation available
  • {'unknown': True} — PROJ string parsed but CRS could not be identified further
import whitebox_workflows as wb

wbe = wb.WbEnvironment()

proj_str = '+proj=utm +zone=17 +datum=NAD83 +units=m +no_defs'
result = wbe.projection.from_proj_string(proj_str)

if 'epsg' in result:
    print('identified EPSG:', result['epsg'])  # e.g. 26917
elif 'wkt' in result:
    print('WKT:', result['wkt'])
else:
    print('CRS unknown')

This is the recommended fallback for legacy data sources that carry only a PROJ4 metadata string. WbW-Py itself uses this path internally when reprojecting rasters whose CRS metadata does not include an EPSG code.

Area-of-use bounding box

Use projection.area_of_use to retrieve the geographic bounding box of valid use for an EPSG code. This is useful for validating that your data actually falls within the intended CRS domain before or after reprojection.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

bbox = wbe.projection.area_of_use(32618)  # UTM Zone 18N
if bbox is not None:
    print(f"valid lon: {bbox['lon_min']} to {bbox['lon_max']}")
    print(f"valid lat: {bbox['lat_min']} to {bbox['lat_max']}")

# Returns None for codes with no registered bounding box.
print(wbe.projection.area_of_use(9999))  # None

You can also pass the bounding box check as a pre-reprojection guard:

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
dem = wbe.read_raster('dem.tif')

dst_epsg = 32618
bbox = wbe.projection.area_of_use(dst_epsg)
if bbox is not None:
    ext = dem.metadata().extent
    # Quick geographic sanity check before committing to full reprojection.
    in_range = (
        ext.min_x >= bbox['lon_min'] and ext.max_x <= bbox['lon_max'] and
        ext.min_y >= bbox['lat_min'] and ext.max_y <= bbox['lat_max']
    )
    if not in_range:
        print('WARNING: DEM extent may fall outside area of use for EPSG:', dst_epsg)

dem_utm = dem.reproject(dst_epsg=dst_epsg, resample='bilinear')
wbe.write_raster(dem_utm, 'dem_utm.tif')

Best Practices

  • Confirm source CRS before any reprojection.
  • Use nearest for categorical raster data, bilinear/cubic for continuous data.
  • Re-open outputs and verify CRS metadata post-transform.
  • Keep transform options explicit for reproducible pipelines.

Topology Utilities

This chapter covers topology helper methods available under wbe.topology.

Topology utilities are best used as fast, script-level geometry checks and diagnostics. They answer questions like:

  • Do these two geometries intersect, touch, or overlap?
  • Is this polygon valid before a downstream operation?
  • What is the exact DE-9IM relationship between two geometries?

These methods are lightweight and ideal for validation gates. For large-scale overlay workflows and heavy production geometry processing, prefer dedicated vector tools in wbe.vector.*.

Topology Workflow Pattern

A robust pattern for topology-aware scripts is:

  1. Validate CRS compatibility first.
  2. Run quick topology predicates to detect obvious incompatibilities.
  3. Repair invalid geometries if required.
  4. Re-check relationships after repairs.
  5. Continue into heavier vector analysis only after topology checks pass.

This keeps failures early and localized, which is usually easier to debug than finding topology issues deep into a long processing chain.

WKT Predicate Checks

Use predicate checks for fast boolean decisions in filters and QA gates.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

poly = 'POLYGON((0 0,10 0,10 10,0 10,0 0))'
pt = 'POINT(5 5)'

print('contains:', wbe.topology.contains_wkt(poly, pt))
print('intersects:', wbe.topology.intersects_wkt(poly, pt))
print('within:', wbe.topology.within_wkt(pt, poly))
print('touches:', wbe.topology.touches_wkt(poly, pt))
print('disjoint:', wbe.topology.disjoint_wkt(poly, pt))

Relationship and Distance

Use relate_wkt when a simple predicate is not enough and you need the full topological relationship signature.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

a = 'LINESTRING(0 0, 10 0)'
b = 'LINESTRING(0 1, 10 1)'

print('distance:', wbe.topology.distance_wkt(a, b))
print('relate:', wbe.topology.relate_wkt(a, b))

The DE-9IM string returned by relate_wkt is useful for rule-based quality checks in advanced pipelines, especially when business logic depends on exact boundary/interior behavior.

Geometry Validation and Repair

Validation and repair are especially useful before overlays, dissolves, and buffer-heavy workflows where invalid rings can cause downstream failures.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()

invalid = 'POLYGON((0 0,4 4,4 0,0 4,0 0))'
print('is_valid:', wbe.topology.is_valid_polygon_wkt(invalid))

fixed = wbe.topology.make_valid_polygon_wkt(invalid)
print('fixed:', fixed)

buf = wbe.topology.buffer_wkt('LINESTRING(0 0, 10 0)', 1.5)
print('buffer:', buf)

When repairing, prefer writing repaired geometries to new outputs and keeping source data immutable for auditability.

Feature-to-Feature Relation

For vector feature comparisons, use vector_feature_relation(...).

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
roads = wbe.read_vector('roads.gpkg')

rel = wbe.topology.vector_feature_relation(roads, 0, roads, 1)
print(rel)

For batch validation across many feature pairs, call this in a controlled loop and log results with feature IDs for traceable QA reports.

Topology Namespace Method Reference

The table below summarizes the core wbe.topology methods.

MethodDescription
intersects_wktReturn True when two geometries share any portion of space.
contains_wktReturn True when geometry A strictly contains geometry B.
within_wktReturn True when geometry A is strictly within geometry B.
touches_wktReturn True when geometries meet at boundaries but interiors do not overlap.
disjoint_wktReturn True when geometries have no spatial intersection.
crosses_wktReturn True when geometries cross with dimensional reduction behavior.
overlaps_wktReturn True when same-dimension geometries partially overlap.
covers_wktReturn True when geometry A covers geometry B including boundary cases.
covered_by_wktReturn True when geometry A is covered by geometry B including boundary cases.
relate_wktReturn DE-9IM relationship text for exact topology-rule evaluation.
distance_wktReturn shortest distance between two geometries.
is_valid_polygon_wktCheck polygon validity before topology-sensitive workflows.
make_valid_polygon_wktRepair an invalid polygon WKT representation.
buffer_wktBuild a buffered geometry from WKT and distance.
vector_feature_relationEvaluate topology relation between indexed features in vector datasets.

Practical Guidance

  • Use topology utilities for fast geometry checks in validation pipelines.
  • For complex overlays and production transforms, prefer vector tool workflows.
  • Keep CRS explicit before topology checks; mismatched CRS can produce plausible but wrong relations.
  • Use relate_wkt when QA rules depend on exact boundary/interior semantics.

Interoperability

This chapter provides practical exchange patterns between WbW-Py and common Python geospatial tooling.

Interoperability is best thought of as controlled boundary crossing. Each conversion introduces potential differences in metadata conventions, numeric precision, CRS representation, and schema typing. The workflows in this chapter focus on explicit handoff points and roundtrip validation so multi-library pipelines remain trustworthy.

Copy-Boundary Model

  • to_numpy() / from_numpy() are explicit in-memory exchange boundaries.
  • Rasterio/GeoPandas/rioxarray flows are file-based boundaries.
  • Always validate metadata after roundtrip (metadata(), CRS, dimensions, schema).

NumPy Roundtrip

Use this when you need direct numeric control for custom raster math.

import numpy as np
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
r = wbe.read_raster('dem.tif')
a = r.to_numpy(dtype='float64')
a = np.where(np.isfinite(a), a + 1.0, a)

r2 = wb.Raster.from_numpy(a, r, output_path='dem_plus1.tif')

Rasterio Roundtrip

Use this for compatibility with rasterio-centric ecosystems and workflows.

import rasterio
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
r = wbe.read_raster('dem.tif')
wbe.write_raster(r, 'dem_for_rasterio.tif')

with rasterio.open('dem_for_rasterio.tif') as src:
    arr = src.read(1)
    profile = src.profile

arr = arr * 1.02
profile.update(dtype='float32', count=1)
with rasterio.open('dem_rio_out.tif', 'w', **profile) as dst:
    dst.write(arr.astype('float32'), 1)

r_back = wbe.read_raster('dem_rio_out.tif')
print(r_back.metadata())

GeoPandas and Shapely Roundtrip

Use this pattern for vector enrichment and geometry filtering in the broader Python geospatial stack.

import geopandas as gpd
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
v = wbe.read_vector('roads.gpkg')
wbe.write_vector(v, 'roads_for_gpd.gpkg')

gdf = gpd.read_file('roads_for_gpd.gpkg')
gdf['length_m'] = gdf.length
gdf = gdf[gdf['length_m'] > 20.0]
gdf.to_file('roads_filtered.gpkg', driver='GPKG')

v_back = wbe.read_vector('roads_filtered.gpkg')
print(v_back.schema())

xarray/rioxarray Roundtrip

Use this when you need labeled-array operations or rolling-window processing.

import rioxarray as rxr
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
r = wbe.read_raster('dem.tif')
wbe.write_raster(r, 'dem_for_xarray.tif')

da = rxr.open_rasterio('dem_for_xarray.tif').squeeze(drop=True)
da_smoothed = da.rolling(x=3, y=3, center=True).mean()
da_smoothed.rio.to_raster('dem_xarray_smoothed.tif')

r_back = wbe.read_raster('dem_xarray_smoothed.tif')
print(r_back.metadata())

pyproj CRS Workflow

Use this for explicit CRS introspection and conversion checks outside full file I/O steps.

from pyproj import CRS
import whitebox_workflows as wb

wbe = wb.WbEnvironment()
r = wbe.read_raster('dem.tif')

src = CRS.from_epsg(r.metadata().epsg_code)
dst = CRS.from_epsg(32618)
print(src.to_string(), '->', dst.to_string())

r_utm = wbe.projection_georeferencing.general.reproject_raster(r, dst_epsg=dst.to_epsg(), resample='bilinear')

Validation Checklist

  1. Check CRS after every roundtrip.
  2. Check dimensions and nodata for raster flows.
  3. Check schema and representative attributes for vector flows.
  4. Prefer stable formats (.tif, .gpkg) for routine exchange.

Licensing

This chapter documents licensing modes, tier models, and interactive activation workflows.

Licensing mode is a runtime dependency and should be treated like any other infrastructure requirement. The objective is to make startup behavior explicit, auditable, and resilient: scripts should clearly communicate which mode they expect, how fallback is handled, and what operational evidence is logged when activation succeeds or fails.

License Tiers

Whitebox NG is available in two tiers:

  • Open Tier (open): Governed by MIT/Apache 2.0 dual licensing. All Open-tier tools are free and open-source with no entitlement required.

  • Pro Tier (pro): Proprietary commercial software. Pro-tier tools require activation with a valid license key and are subject to End-User License Agreement (EULA) terms.

Open Mode

Use this for OSS-only workflows or environments where entitlement is not required. No activation needed.

import whitebox_workflows as wb

wbe = wb.WbEnvironment()
print('license type:', wbe.license_type())  # open

Interactive License Management

For end users and interactive workflows, activate and manage Pro licenses directly within Python. Activation persists local license state so subsequent runs automatically load the license without re-entry.

Activating a License

import whitebox_workflows as wb

# User calls activate with their license key
result = wb.activate_license(
    key='YOUR_LICENSE_KEY',
    firstname='John',
    lastname='Smith',
    email='john@example.com',
    agree_to_license_terms=True,
    # Optional: provider_url, machine_id, customer_id
)
print(result)  # Activation confirmation message

What happens:

  • Server validates the key and issues a signed entitlement.
  • Entitlement is verified and persisted to ~/.whitebox/wbw_ng_license_state.json.
  • Subsequent WbEnvironment() calls automatically load local state.
  • If local state is expired or invalid, fallback to open tier.

Checking License Status

import whitebox_workflows as wb

info = wb.license_info()
print(info)
# {
#   "valid": true,
#   "effective_tier": "pro",
#   "seconds_remaining": 2592000,
#   "expires_at_unix": 1234567890,
#   "now_unix": 1234567890
# }

Querying Time Remaining Directly

Use the dedicated helper when you only need remaining time values:

import whitebox_workflows as wb

remaining = wb.license_time_remaining()
print(remaining)
# {
#   "active": true,
#   "valid": true,
#   "seconds_remaining": 2592000,
#   "days_remaining": 30,
#   "expires_at_unix": 1234567890,
#   "now_unix": 1234567890
# }

If no local license exists, the call returns active: false with seconds_remaining: 0 and days_remaining: 0.

Transferring a License

To move a license to another machine, call transfer which returns a portable payload and clears local state:

import whitebox_workflows as wb

payload = wb.transfer_license()
print(payload)  # Contains activation credentials for the destination machine
# Local state is now cleared on this machine

Deactivating a License

import whitebox_workflows as wb

result = wb.deactivate_license()
print(result)  # Confirmation message
# Local state is cleared; future runs fall back to open tier

Local State Persistence

Active license state is stored at ~/.whitebox/wbw_ng_license_state.json (or override via WBW_LICENSE_STATE_PATH environment variable). On each startup:

  • If local state exists and is valid, it is automatically loaded.
  • If local state is expired or missing, the runtime falls back to open tier.
  • You do not need to re-authenticate on every run once activated.

Programmatic Modes: Signed Entitlement and Floating License

For automated or managed deployments, use programmatic licensing modes where entitlements are supplied directly at runtime.

Signed Entitlement (JSON)

Use this in managed deployments where entitlement payloads are supplied at runtime.

import whitebox_workflows as wb

signed_entitlement_json = '...'
public_key_kid = 'k1'
public_key_b64url = 'REPLACE_WITH_PROVIDER_KEY'

wbe = wb.WbEnvironment.from_signed_entitlement_json(
    signed_entitlement_json=signed_entitlement_json,
    public_key_kid=public_key_kid,
    public_key_b64url=public_key_b64url,
    include_pro=True,
    fallback_tier='open',
)

print(wbe.license_type())

Signed Entitlement (File)

Use this when entitlement bundles are provisioned as files by platform tooling.

import whitebox_workflows as wb

wbe = wb.WbEnvironment.from_signed_entitlement_file(
    entitlement_file='entitlement.json',
    public_key_kid='k1',
    public_key_b64url='REPLACE_WITH_PROVIDER_KEY',
    include_pro=True,
    fallback_tier='open',
)

Floating License

Use this when license allocation is centrally managed and leased per machine or session.

import whitebox_workflows as wb

wbe = wb.WbEnvironment.from_floating_license_id(
    floating_license_id='fl_12345',
    include_pro=True,
    fallback_tier='open',
    provider_url='https://license.example.com',
    machine_id='machine-01',
    customer_id='customer-abc',
)

print(wbe.license_info())

Failure Handling Guidance

  • Validate startup at script entry and fail early on licensing errors.
  • For entitlement/floating modes, keep diagnostics from thrown exceptions.
  • Use open mode fallback only where policy permits.

Security and Operations Notes

  • Do not hardcode real license secrets in source control.
  • Prefer environment variables or secure secret stores.
  • Log license mode and runtime version for reproducibility.

API Reference Strategy

Manual chapters provide narrative and recipes, and now include a dedicated API reference section near the end of the manual.

The split is intentional:

  • conceptual chapters answer workflow questions (what to do and why)
  • API chapters answer contract questions (exact parameters and return shape)

To reduce drift, API chapters source content from shared generated references.

Reference Boundaries

  • This manual explains concepts, patterns, and end-to-end examples.
  • This manual also includes an API section for non-tool WbEnvironment methods and tool wrappers.
  • Source-of-truth references remain in TOOLS.md, docs/tools_*.md, and package typing assets.

Terrain Analysis and Geomorphometry

Terrain analysis — or geomorphometry — is the quantitative characterization of land-surface form from digital elevation models (DEMs). It is one of the original strengths of the Whitebox platform and covers a broad spectrum: from simple first-order derivatives like slope and aspect, through classification of terrain form, to advanced multiscale and visibility analyses.

This chapter moves from foundational concepts through intermediate and advanced workflows, with example scripts throughout.


What is a DEM?

A digital elevation model (DEM) is a raster where each cell stores the elevation of the land surface at that location. DEMs underpin nearly every terrain analysis: slope gradients, drainage patterns, landform classification, solar radiation modelling, and viewshed analysis all begin with a DEM.

Common DEM sources include:

  • LiDAR-derived bare-earth surfaces (highest resolution and accuracy)
  • Photogrammetric DEMs from drone or aerial surveys
  • SRTM (global 30 m coverage)
  • ASTER GDEM and Copernicus DEM (global 30 m or 90 m)

DEM quality — vertical accuracy, spatial resolution, systematic artefacts from interpolation or acquisition — directly limits the quality of derivative products, so always inspect your DEM before computing derivatives.


Core Concepts

Terrain analysis relies on these fundamental concepts:

  • Slope: The gradient of the land surface, typically expressed in degrees (0–90) or percent. High values indicate steep terrain; low values indicate flat terrain. Critical for erosion, landslide, and hydrology models.
  • Aspect: Compass direction a slope faces (0–360°, measured clockwise from north). Flat cells are typically -1 or nodata. Controls solar radiation, drainage direction, and habitat quality.
  • Curvature: Rate of change of slope (usually planform and profile separately). Positive profile curvature indicates acceleration zones (ridges); negative indicates deceleration zones (valleys).
  • Flow direction: The steepest downslope direction from each cell. Forms the basis for flow accumulation, drainage network delineation, and watershed boundaries.
  • Flow accumulation: Number of upslope cells draining to each cell, proportional to contributing area. High values indicate stream channels and valley bottoms.
  • Topographic Wetness Index (TWI): Ln(upslope area / tan(slope)), predicts persistent moisture. High TWI indicates probable saturated zones; used in soil moisture and flood risk mapping.
  • Landform classification: Categorizing terrain into types (e.g. summits, ridges, valleys, footslopes) via multivariate analysis. Provides interpretable terrain structure without tuning thresholds.
  • Multiscale analysis: Deriving terrain metrics at multiple scales. Single-scale derivatives can miss important structure; multiscale approaches reveal process-relevant scales.
  • Viewshed: Set of cells visible from a vantage point. Used in landscape perception, military analysis, and wind farm siting.

First-Order Terrain Derivatives

First-order derivatives measure the rate of change of elevation over space.

Slope

Slope is the magnitude of the first derivative of elevation: the maximum rate of elevation change per unit horizontal distance. It is typically expressed in degrees (0–90) or as a percentage (rise over run × 100).

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

dem = wbe.read_raster('dem.tif')

# Degrees is the default units
slope_deg = wbe.terrain.derivatives.slope(dem, units='degrees')
wbe.write_raster(slope_deg, 'slope_degrees.tif')

# Percentage slope useful for agricultural and road applications
slope_pct = wbe.terrain.derivatives.slope(dem, units='percent')
wbe.write_raster(slope_pct, 'slope_percent.tif')

High values indicate steep terrain; low values indicate flat terrain. Slope is widely used in landslide hazard mapping, erosion modelling, habitat suitability analysis, and infrastructure routing.

Aspect

Aspect is the compass direction that a slope faces, measured clockwise from north (0°–360°). Flat cells conventionally receive a value of -1 or nodata.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

dem = wbe.read_raster('dem.tif')
aspect = wbe.terrain.derivatives.aspect(dem)
wbe.write_raster(aspect, 'aspect.tif')

Aspect controls solar insolation, snow persistence, soil moisture, and vegetation structure. South-facing slopes in the northern hemisphere receive more direct solar radiation and tend to be warmer and drier than north-facing slopes.

Hillshade

Hillshading simulates how the terrain would appear under a directional light source and is primarily a visualization aid rather than an analytical derivative.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

dem = wbe.read_raster('dem.tif')

# Single directional hillshade — azimuth and altitude in degrees
hs = wbe.terrain.general.hillshade(dem, azimuth=315.0, altitude=45.0)
wbe.write_raster(hs, 'hillshade.tif')

# Multidirectional hillshade (more even illumination, no shadow artefacts)
mdhs = wbe.terrain.general.multidirectional_hillshade(dem)
wbe.write_raster(mdhs, 'hillshade_multidirectional.tif')

# Hypsometrically tinted hillshade blends elevation colour and shading
hyp = wbe.terrain.general.hypsometrically_tinted_hillshade(dem)
wbe.write_raster(hyp, 'hillshade_hypsometric.tif')

Curvature

Curvature characterizes how the terrain surface bends in space. While slope measures the inclination of a surface, curvature measures how that inclination is changing — the "shape" of the surface rather than its steepness alone.

Whitebox provides a range of curvature types, each capturing a different geometric property.

Profile Curvature

Profile curvature is the curvature in the direction of steepest descent. Positive values correspond to convex terrain (accelerating flow); negative values to concave terrain (decelerating flow, area of convergence).

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem.tif')

profile_curv = wbe.terrain.derivatives.profile_curvature(dem)
wbe.write_raster(profile_curv, 'profile_curvature.tif')

Plan Curvature

Plan curvature is measured in the horizontal plane, perpendicular to the direction of slope. It indicates flow convergence (negative values) or flow divergence (positive values) and is a useful predictor of soil moisture, run-on areas, and erosion.

plan_curv = wbe.terrain.derivatives.plan_curvature(dem)
wbe.write_raster(plan_curv, 'plan_curvature.tif')

Full Curvature Suite

For detailed geomorphometric characterisation compute the full family. Each captures a slightly different geometric facet of the surface:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem.tif')

curv_types = {
    'mean_curvature':       wbe.terrain.derivatives.mean_curvature(dem),
    'gaussian_curvature':   wbe.terrain.derivatives.gaussian_curvature(dem),
    'minimal_curvature':    wbe.terrain.derivatives.minimal_curvature(dem),
    'maximal_curvature':    wbe.terrain.derivatives.maximal_curvature(dem),
    'casorati_curvature':   wbe.terrain.derivatives.casorati_curvature(dem),
    'accumulation_curvature': wbe.terrain.derivatives.accumulation_curvature(dem),
    'difference_curvature': wbe.terrain.derivatives.difference_curvature(dem),
    'generating_function':  wbe.terrain.derivatives.generating_function(dem),
    'curvedness':           wbe.terrain.derivatives.curvedness(dem),
}

for name, raster in curv_types.items():
    wbe.write_raster(raster, f'{name}.tif')

When to use each:

  • Mean curvature: general shape descriptor; used in hydrological and geomorphological studies.
  • Gaussian curvature: distinguishes synclinal, anteclinal, and saddle-point forms; positive on entirely convex surfaces, negative on saddle shapes.
  • Minimal/maximal curvature: principal curvatures; describe the extremes of bending in orthogonal directions.
  • Casorati curvature: root-mean-square of principal curvatures; a rotationally invariant roughness descriptor.
  • Accumulation curvature: amplifies high-curvature terrain features; useful for ridge–valley extraction.

Terrain Position and Landform Classification

Terrain position describes where a location sits relative to its surrounding landscape — ridge crest, upper slope, flat, valley floor, and so on. It forms the backbone of many landform classification workflows.

Topographic Position Index (TPI)

TPI compares the elevation of a cell to the mean elevation of its neighbourhood. Positive values indicate elevated positions (ridges, hilltops); negative values indicate depressed positions (valleys, channels); values near zero indicate planar slopes or mid-slope positions.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem.tif')

# Inner and outer radii in cells
tpi = wbe.terrain.landform_indices.relative_topographic_position(dem, filterx=11, filtery=11)
wbe.write_raster(tpi, 'tpi.tif')

Deviation from Mean Elevation

Similar to TPI but expressed as a Z-score: how many standard deviations the local elevation is from the neighbourhood mean.

dev = wbe.terrain.general.deviation_from_mean_elevation(dem, filterx=11, filtery=11)
wbe.write_raster(dev, 'deviation_from_mean_elev.tif')

Geomorphons

Geomorphons classify the local terrain into ten fundamental landform elements by analysing the directional horizon profile in eight compass directions: flat, peak, ridge, shoulder, spur, slope, hollow, footslope, valley, and pit. The approach is descriptive and does not require thresholds for individual derivatives.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem.tif')

geons = wbe.terrain.landform_indices.geomorphons(dem, search=50, threshold=1.0, flat=1.0, forms=True)
wbe.write_raster(geons, 'geomorphons.tif')

The search parameter sets the look-ahead distance in cells. Increasing it produces a more generalised classification that emphasises regional landform context; smaller values capture finer-scale topographic features.


Multiscale Terrain Analysis

Many geomorphic properties are scale-dependent: a feature that appears as a ridge at one scale is part of a larger plateau at another. Multiscale analysis explores how terrain derivatives vary with the scale (neighbourhood size) of computation.

Multiscale Roughness

Roughness quantifies the local complexity of the terrain surface. The multiscale variant computes roughness at a range of neighbourhood sizes and returns both the maximum roughness and the scale at which it occurs.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem.tif')

roughness, roughness_scale = wbe.terrain.multiscale_signatures.multiscale_roughness(
    dem,
    min_scale=1,
    max_scale=100,
    step=1
)

wbe.write_raster(roughness, 'multiscale_roughness.tif')
wbe.write_raster(roughness_scale, 'roughness_scale_of_max.tif')

The scale-of-maximum raster describes the spatial grain of the terrain texture: alluvial fans and smooth glacial valleys show large dominant scales; deeply dissected badlands and karst terrain show small scales.

Multiscale Elevation Percentile

Measures how often a cell's elevation is higher than nearby cells across a range of scales, identifying persistent topographic prominence regardless of local noise.

mep = wbe.terrain.multiscale_signatures.multiscale_elevation_percentile(
    dem,
    min_scale=1,
    num_steps=10,
    step_size=2,
    step_nonlinearity=1.0,
    sig_digits=3
)
wbe.write_raster(mep, 'multiscale_elevation_percentile.tif')

Multiscale Curvatures

Computes a suite of curvature metrics at multiple scales and returns the value at the scale of maximum local curvature for each cell.

multiscale_mean_curv = wbe.terrain.multiscale_signatures.multiscale_curvatures(
    dem,
    min_scale=1,
    max_scale=30,
    step=1
)
wbe.write_raster(multiscale_mean_curv, 'multiscale_curvatures.tif')

Multiscale Topographic Position Image

Produces an RGB composite where colour encodes topographic position at three nested scales, providing an intuitive visual summary of multi-level terrain structure.

mtp = wbe.terrain.multiscale_signatures.multiscale_topographic_position_image(
    dem,
    local=1,
    meso=11,
    broad=101
)
wbe.write_raster(mtp, 'multiscale_topo_position.tif')

Visibility Analysis

Visibility analysis determines which parts of the landscape can be seen from a given viewpoint or set of viewpoints.

Viewshed

A viewshed identifies the set of cells visible from an observer location.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

dem = wbe.read_raster('dem.tif')
observer_points = wbe.read_vector('observer_locations.shp')

viewshed = wbe.terrain.visibility.viewshed(dem, observer_points, height=1.8)
wbe.write_raster(viewshed, 'viewshed.tif')

Horizon Angle and Openness

Horizon angle measures the elevation angle to the skyline in a given direction, useful for solar modelling and local climate studies. Terrain openness (positive and negative) quantifies how open or enclosed a location is relative to its surroundings.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem.tif')

# Positive openness: how "exposed" each cell is
openness_pos = wbe.terrain.visibility.openness(dem, dist=50, pos_openness=True)
wbe.write_raster(openness_pos, 'openness_positive.tif')

# Negative openness: how "enclosed" each cell is
openness_neg = wbe.terrain.visibility.openness(dem, dist=50, pos_openness=False)
wbe.write_raster(openness_neg, 'openness_negative.tif')

Sky View Factor

Sky view factor measures the fraction of the sky hemisphere that is visible from a point on the surface, accounting for topographic obstruction. Values range from 0 (fully enclosed depression) to 1 (completely open flat surface). It is used in urban heat island modelling, long-wave radiation estimation, and snowmelt modelling.

svf = wbe.terrain.visibility.sky_view_factor(dem, num_directions=16, max_dist=200.0)
wbe.write_raster(svf, 'sky_view_factor.tif')

Terrain Smoothing

Raw DEMs often contain artefacts from acquisition and interpolation: striping, pitting, noisy micro-relief. Smoothing prior to derivative computation reduces these effects while ideally preserving genuine terrain features.

Feature-Preserving Smoothing (Multiscale)

Whitebox Next Gen now includes a newer multiscale feature-preserving smoother that is better suited to terrain-analysis workflows than the earlier single-scale smoother when you need to suppress short-wavelength DEM noise without flattening broader terrain form. The multiscale method works through a coarse-to-fine pyramid, smoothing at larger scales first and then refining the surface back toward the source DEM with explicit fidelity and edge-preservation controls.

At the moment this tool is most directly accessed through the generic tool-execution surface in WbW-Py.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('raw_dem.tif')

# Coarse-to-fine multiscale smoothing with explicit controls.
dem_smooth = wbe.run_tool(
  'feature_preserving_smoothing_multiscale',
  {
    'input': dem,
    'smoothing_amount': 0.65,
    'edge_preservation': 0.80,
    'scale_levels': 4,
    'fidelity': 0.45,
    'z_factor': 1.0,
  }
)
wbe.write_raster(dem_smooth, 'dem_smooth_multiscale.tif')

Use this before curvature, terrain-position, and landform-classification workflows, especially where acquisition artefacts or interpolation roughness would otherwise dominate second-derivative products.


WbW-Pro Spotlight: Terrain Constraint and Conflict Analysis

  • Problem: Screen terrain constraints early for siting and corridor decisions.
  • Tool: terrain_constraint_and_conflict_analysis
  • Typical inputs: DEM, optional wetness, optional flood-risk surface, optional land-cover penalty, slope threshold.
  • Typical outputs: Terrain-conflict score raster, conflict classes, and summary outputs.
import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

result = wbe.run_tool(
  'terrain_constraint_and_conflict_analysis',
  {
    'dem': 'dem.tif',
    'wetness': 'wetness_index_norm.tif',
    'flood_risk': 'flood_risk_norm.tif',
    'landcover_penalty': 'landcover_penalty_norm.tif',
    'slope_limit_deg': 15.0,
    'output_prefix': 'terrain_conflict_corridor_a'
  }
)
print(result)

Note: This workflow requires a WbEnvironment initialized with a valid Pro licence.

Pro Sweep Diagnostics for Siting Workflows

For scenario testing in Pro siting workflows, wind_turbine_siting and solar_site_suitability_analysis accept sweep_spec_json and produce additional sweep outputs:

  • run_matrix_summary (CSV)
  • sensitivity_report (JSON)
  • sensitivity_report_html (HTML)
  • stability_map (GeoTIFF; 3=high, 2=medium, 1=low)

The JSON sensitivity report includes a normalized primary metric span and stability class fields for quick robustness screening:

  • metrics.primary_metric
  • metrics.primary_relative_span
  • metrics.stability_class with values high, medium, or low

Example:

import json
import whitebox_workflows as wbw

wbe = wbw.WbEnvironment(include_pro=True, tier="pro")

sweep_spec = {
  "schema_version": "1.0.0",
  "sweep_mode": "grid",
  "parameters": [
    {"name": "candidate_threshold", "values": [0.65, 0.7, 0.75]},
  ],
}

score, conf, summary = wbe.wind_turbine_siting(
  dem="dem.tif",
  settlements="settlements.gpkg",
  sweep_spec_json=json.dumps(sweep_spec),
  output_prefix="wind_sweep",
)

Complete Terrain Analysis Pipeline

The following script assembles a typical geomorphometric analysis workflow moving from raw DEM conditioning through a suite of first- and second-order derivatives and terrain classification outputs.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.verbose = True

# --- 1. Read and inspect input ---
dem = wbe.read_raster('dem_raw.tif')
print(dem.metadata())

# --- 2. Fill missing data (voids from nodata gaps) ---
dem_filled = wbe.terrain.general.fill_missing_data(dem, filter_size=11)

# --- 3. Multiscale feature-preserving smoothing ---
dem_smooth = wbe.run_tool(
  'feature_preserving_smoothing_multiscale',
  {
    'input': dem_filled,
    'smoothing_amount': 0.65,
    'edge_preservation': 0.80,
    'scale_levels': 4,
    'fidelity': 0.45,
  }
)
wbe.write_raster(dem_smooth, 'dem_smooth_multiscale.tif')

# --- 4. First-order derivatives ---
slope   = wbe.terrain.derivatives.slope(dem_smooth, units='degrees')
aspect  = wbe.terrain.derivatives.aspect(dem_smooth)
hillshade = wbe.terrain.general.multidirectional_hillshade(dem_smooth)

wbe.write_raster(slope,     'slope.tif')
wbe.write_raster(aspect,    'aspect.tif')
wbe.write_raster(hillshade, 'hillshade.tif')

# --- 5. Curvatures ---
prof_curv = wbe.terrain.derivatives.profile_curvature(dem_smooth)
plan_curv = wbe.terrain.derivatives.plan_curvature(dem_smooth)
mean_curv = wbe.terrain.derivatives.mean_curvature(dem_smooth)

wbe.write_raster(prof_curv, 'curvature_profile.tif')
wbe.write_raster(plan_curv, 'curvature_plan.tif')
wbe.write_raster(mean_curv, 'curvature_mean.tif')

# --- 6. Terrain position ---
dev = wbe.terrain.general.deviation_from_mean_elevation(dem_smooth, filterx=11, filtery=11)
wbe.write_raster(dev, 'deviation_from_mean_elev.tif')

# --- 7. Landform classification ---
geomorphons = wbe.terrain.landform_indices.geomorphons(dem_smooth, search=50, threshold=1.0, flat=1.0)
wbe.write_raster(geomorphons, 'geomorphons.tif')

# --- 8. Multiscale roughness ---
roughness, roughness_scale = wbe.terrain.multiscale_signatures.multiscale_roughness(
    dem_smooth, min_scale=1, max_scale=50, step=1
)
wbe.write_raster(roughness, 'multiscale_roughness.tif')

# --- 9. Visibility ---
svf = wbe.terrain.visibility.sky_view_factor(dem_smooth, num_directions=16, max_dist=200.0)
wbe.write_raster(svf, 'sky_view_factor.tif')

print("Terrain analysis complete.")

Ridges and Valleys

Topographic ridges and channels are fundamental landform elements. Whitebox provides tools to extract them directly as vector features.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem_smooth.tif')

# Extract ridges
ridges = wbe.terrain.general.find_ridges(dem, line_thin=True)
wbe.write_raster(ridges, 'ridges.tif')

# Extract ridge and valley lines as vectors
ridge_lines = wbe.terrain.general.ridge_and_valley_vectors(dem)
wbe.write_vector(ridge_lines, 'ridge_valley_lines.gpkg')

For hydrographic applications, channel extraction is usually better served through the hydrology toolset (flow accumulation-based extraction), but ridge-line extraction complements watershed delineation by explicitly mapping the divide network.


Embankment and Road Mapping

In agricultural, infrastructure, and floodplain contexts, anthropogenic embankments (dykes, levees, road fills) appear as linear elevated features on DEMs. Whitebox provides dedicated tools for their detection:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem_lidar.tif')

# Map elevated linear features such as road embankments and dykes
embankments = wbe.terrain.general.embankment_mapping(
    dem,
    road_vec='roads.shp',
    search_dist=2.5,
    min_road_width=6.0,
    typical_width=30.0,
    max_height=2.5,
    spillout_slope=4.0,
    max_remove_fs_slope=0.1,
    min_bench_width=6.0,
    clean_up=True,
    output_type='filtered DEM'
)
wbe.write_raster(embankments, 'dem_embankments_filtered.tif')

Summary

Terrain analysis in WbW-Py follows a layered depth model:

  • First-order work: slope, aspect, hillshade are fast and interpretable.
  • Curvature analysis: adds information about surface bending and is critical for hydrological modelling, mass movement susceptibility, and landform process inference.
  • Classification: geomorphons and multiscale position methods provide stable, interpretable landform maps without manually tuned thresholds.
  • Multiscale methods: reveal scale-dependent structure that single-scale derivatives miss.
  • Visibility and openness: support solar, ecological, and landscape planning applications.

For most projects the right progression is: smooth → first-order derivatives → curvatures → classification → application-specific outputs.


Tips

  • Pre-process your DEM: Remove spikes, pits, and fill sinks before computing derivatives. Use breach_depressions_least_cost() (preserves real depressions) or fill_depressions() (infills) depending on your application.
  • Resolution matters: Coarse DEMs (e.g. 30 m) are smoothed and may miss local process features. Fine DEMs (e.g. 1 m LiDAR) can be noisy. Choose resolution to match your process scale.
  • Flow direction algorithms: D8 (8-directional) is faster but can cause artificial flow alignments. D-infinity and Dinf-Rho distribute flow more naturally and are preferred for continuous analyses.
  • Curvature is scale-dependent: Always compute curvature at the scale matching your DEM resolution. A 10 m window on a 1 m DEM can overinterpret noise; a 1 m window on a 30 m DEM misses important structure.
  • Multiscale position classification: Run classification at 3–5 scales (e.g. local, neighbourhood, regional) and examine layer coherence. Inconsistent multi-scale patterns suggest model overfitting.
  • Viewshed validation: Viewshed results are sensitive to DEM quality and observer height assumptions. Always validate against ground observation or high-res ortho imagery.
  • Hydrological thresholds are empirical: Contributing area thresholds for stream initiation vary by geology and climate (typically 0.5–5 km²). Calibrate against observed stream networks.
  • Openness and exposure: Sky-view factor (SVF) and terrain openness support better hillshading and visibility assessment than raw slope or aspect. Use for visual interpretation and photogrammetry.

Spatial Hydrology

Spatial hydrology covers the analysis of water movement and accumulation across the land surface using DEMs. It is one of Whitebox's deepest specializations and spans DEM conditioning, flow routing, watershed delineation, stream network extraction, and advanced connectivity and storage modelling.

This chapter progresses from fundamental concepts through a full watershed analysis pipeline, including advanced topics such as probabilistic depression analysis and hydrologic connectivity.


Core Concepts

The Hydrologic DEM Problem

Most raw DEMs contain surface depressions — cells or groups of cells enclosed by higher neighbours — that are real topographic basins, artefacts of acquisition noise, or pits introduced by interpolation. Standard single-flow- direction routing (D8) cannot route water out of these depressions. Before flow routing, the DEM must be conditioned to remove spurious depressions while preserving genuine ones (such as lakes and wetlands).

The two principal conditioning strategies are:

Filling: raises cells within each depression up to the spill elevation. This guarantees flat, drained surfaces but can significantly alter elevations and produce large flat areas that require secondary gradient enforcement.

Breaching: cuts a narrow channel of minimum cost through the barrier surrounding each depression, routing water to the nearest outside outlet. This preserves more of the original elevation field and is usually preferred when breachable barriers exist (roads, levees, embankments).

In practice, a hybrid approach — breach where possible, fill remaining depressions — is often optimal.

Flow Direction Algorithms

After DEM conditioning, a flow direction raster encodes which direction water flows from each cell. Whitebox supports multiple algorithms, each with different properties:

AlgorithmFlow typeBest use
D8Single (deterministic)Channel delineation, simple watersheds
Rho8Single (stochastic)Reduces D8 directional bias
D-infinity (DInf)Multiple (proportional split)Hillslope flux, dispersive flow
FD8Multiple (proportional)Shallow overland flow modelling
MD-infinityMultipleSubsurface/soil moisture modelling
Quinn et al. (FD8 variant)MultipleWetness index, slope-area workflows
Minimal Dispersion Flow AlgorithmAdaptiveBalance between D8 and DInf

DEM Conditioning

Breach Depressions

breach_depressions_least_cost is the recommended first-pass conditioning tool. It minimises the total vertical cost of breaching while constraining each breach path to a maximum length and depth.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

dem = wbe.read_raster('dem_raw.tif')

dem_breached = wbe.hydrology.depressions_storage.breach_depressions_least_cost(
    dem,
    dist=50,           # maximum breach channel length in cells
    max_cost=None,     # no cost ceiling (breach wherever needed)
    min_dist=True,     # prefer shorter breach paths
    flat_increment=None,
    fill_deps=True     # fill any remaining unbreachable depressions
)
wbe.write_raster(dem_breached, 'dem_conditioned.tif')

If your study area contains roads or embankments that act as real barriers to flow, consider mapping them as embankments first and then burning them into the DEM:

dem_burned = wbe.hydrology.depressions_storage.topological_breach_burn(dem, streams='streams_mapped.shp')
dem_conditioned = wbe.hydrology.depressions_storage.breach_depressions_least_cost(dem_burned, dist=50, fill_deps=True)

Fill Depressions

When you need guaranteed flat-free surfaces or are processing coarse-resolution DEMs where breaching introduces artefacts, full filling is appropriate:

dem_filled = wbe.hydrology.depressions_storage.fill_depressions(dem, flat_increment=0.001)
wbe.write_raster(dem_filled, 'dem_filled.tif')

The flat_increment adds a tiny gradient across flat areas to enable downstream flow routing.

Single-Cell Pit Removal

For DEMs that are mostly clean but contain isolated single-cell pits (from radiometric noise in LiDAR interpolation), a lightweight pre-pass avoids unnecessary full conditioning:

dem_pitless = wbe.hydrology.depressions_storage.fill_pits(dem)
dem_conditioned = wbe.hydrology.depressions_storage.breach_depressions_least_cost(dem_pitless, dist=50, fill_deps=True)

Flow Direction

D8 Flow Pointer

D8 assigns each cell a direction code to its steepest neighbour. The result is an integer pointer raster used by many downstream tools.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem_conditioned.tif')

d8_pntr = wbe.hydrology.flow_routing.d8_pointer(dem)
wbe.write_raster(d8_pntr, 'd8_pointer.tif')

D-Infinity Flow Pointer

DInf partitions flow between two downslope neighbours according to the slope angle, producing a continuous flow direction that reduces the directional bias of D8:

dinf_pntr = wbe.hydrology.flow_routing.dinf_pointer(dem)
wbe.write_raster(dinf_pntr, 'dinf_pointer.tif')

Flow Accumulation

Flow accumulation counts (or accumulates weighted values of) the upstream contributing area draining to each cell. It is the primary tool for identifying stream channels, delineating watersheds, and computing topographic wetness indices.

Basic D8 Flow Accumulation

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem_conditioned.tif')

d8_pntr = wbe.hydrology.flow_routing.d8_pointer(dem)

# Cell-count accumulation
flow_accum = wbe.hydrology.flow_routing.d8_flow_accum(d8_pntr, out_type='cells')
wbe.write_raster(flow_accum, 'flow_accum_d8.tif')

# Log-transform for visualisation (high dynamic range)
import math
flow_accum_log = flow_accum.log2()   # WbW raster operator
wbe.write_raster(flow_accum_log, 'flow_accum_d8_log.tif')

Specific Contributing Area (D-Infinity)

Specific contributing area normalises by cell width and is used in wetness index and erosion models:

dinf_pntr = wbe.hydrology.flow_routing.dinf_pointer(dem)
sca = wbe.hydrology.flow_routing.dinf_flow_accum(dinf_pntr, input_is_pointer=True, out_type='sca')
wbe.write_raster(sca, 'specific_contributing_area.tif')

Topographic Wetness Index (TWI)

TWI = ln(SCA / tan(slope)) is a widely used proxy for soil moisture and saturated area:

import whitebox_workflows as wbw
import math

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem_conditioned.tif')

dinf_pntr = wbe.hydrology.flow_routing.dinf_pointer(dem)
sca       = wbe.hydrology.flow_routing.dinf_flow_accum(dinf_pntr, out_type='sca')
slope_rad = wbe.terrain.derivatives.slope(dem, units='radians')

# Avoid log(0) by clamping minimum SCA
sca_clamped = sca.max(0.001)
slope_clamped = slope_rad.max(0.001)

twi = (sca_clamped / slope_clamped.tan()).log()
wbe.write_raster(twi, 'twi.tif')

Stream Network Extraction

Stream channels appear in the flow accumulation raster as cells with very large contributing areas. Thresholding the accumulation surface reveals the channel network.

Simple Threshold Extraction

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

d8_pntr   = wbe.read_raster('d8_pointer.tif')
flow_accum = wbe.read_raster('flow_accum_d8.tif')

# Extract stream cells above threshold (contributing area in cells)
streams = wbe.streams.network_extraction.extract_streams(flow_accum, threshold=1000.0)
wbe.write_raster(streams, 'streams_raster.tif')

# Convert to vector lines
stream_vec = wbe.streams.network_extraction.raster_streams_to_vector(streams, d8_pntr)
wbe.write_vector(stream_vec, 'streams.gpkg')

Stream links divide the network into segments between junctions, enabling per-segment statistics and Strahler order computation:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
streams   = wbe.read_raster('streams_raster.tif')
d8_pntr   = wbe.read_raster('d8_pointer.tif')

# Assign Strahler order to each channel cell
strahler = wbe.streams.ordering_metrics.strahler_stream_order(d8_pntr, streams)
wbe.write_raster(strahler, 'strahler_order.tif')

# Hack stream order (less sensitive to stubs)
hack = wbe.streams.ordering_metrics.hack_stream_order(d8_pntr, streams)
wbe.write_raster(hack, 'hack_order.tif')

# Horton's drainage composition ratios
horton_ratios = wbe.streams.ordering_metrics.horton_ratios(d8_pntr, streams)
print(horton_ratios)   # returns bifurcation ratio, length ratio, area ratio

Shreve and Topological Orders

For large network analysis requiring consistent junction-based numbering:

shreve = wbe.streams.ordering_metrics.shreve_stream_magnitude(d8_pntr, streams)
wbe.write_raster(shreve, 'shreve_magnitude.tif')

topo_order = wbe.streams.ordering_metrics.topological_stream_order(d8_pntr, streams)
wbe.write_raster(topo_order, 'topological_order.tif')

Watershed Delineation

Single-Outlet Watershed

Delineate the complete contributing area upstream of a single outlet point:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

d8_pntr   = wbe.read_raster('d8_pointer.tif')
outlet_pts = wbe.read_vector('outlet.shp')

watershed = wbe.hydrology.watersheds_basins.watershed(d8_pntr, outlet_pts)
wbe.write_raster(watershed, 'watershed.tif')

Multiple Outlet Points / Nested Basins

unnest_basins handles overlapping contributing areas when working with multiple outlets in a nested configuration:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
d8_pntr   = wbe.read_raster('d8_pointer.tif')
outlets   = wbe.read_vector('outlets_multiple.shp')

# Each outlet gets a unique basin ID; nested basins properly accounted for
nested = wbe.hydrology.watersheds_basins.unnest_basins(d8_pntr, outlets)
wbe.write_raster(nested, 'nested_watersheds.tif')

Subbasin Delineation

Delineate subbasins for all channel junctions simultaneously:

subbasins = wbe.hydrology.watersheds_basins.subbasins(d8_pntr, streams)
wbe.write_raster(subbasins, 'subbasins.tif')

Terrain Hydrologic Indices

Elevation Above Stream

Measures the vertical distance of each cell above the nearest channel, useful for floodplain mapping and valley-bottom delineation:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

dem     = wbe.read_raster('dem_conditioned.tif')
streams = wbe.read_raster('streams_raster.tif')
d8_pntr = wbe.read_raster('d8_pointer.tif')

height_above_stream = wbe.hydrology.hydrologic_indices.elevation_above_stream(dem, streams)
wbe.write_raster(height_above_stream, 'height_above_stream.tif')

Cells with values below 1.0 or 2.0 metres are candidate floodplain cells under typical storm recurrence intervals.

Downslope Distance to Stream

How far (path-following the flow network) is each cell from the nearest channel?

dist_to_stream = wbe.hydrology.hydrologic_indices.downslope_distance_to_stream(
    d8_pntr, streams, dist_type='path'
)
wbe.write_raster(dist_to_stream, 'distance_to_stream.tif')

Advanced: Stochastic Depression Analysis

Real DEMs have vertical uncertainty. A depression that appears in one DEM may not appear once that uncertainty is accounted for. stochastic_depression_ analysis runs a Monte Carlo simulation across an ensemble of stochastically perturbed DEMs to estimate the probability that each cell is part of a real depression rather than a noise artefact.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem = wbe.read_raster('dem.tif')

# rmse: vertical uncertainty of the DEM (e.g. 0.15 m for good LiDAR)
# range: spatial autocorrelation range of the error field in map units
# iterations: number of Monte Carlo realisations
depression_prob = wbe.hydrology.depressions_storage.stochastic_depression_analysis(
    dem,
    rmse=0.15,
    range=5.0,
    iterations=100
)
wbe.write_raster(depression_prob, 'depression_probability.tif')

Cells with probability > 0.5 are more likely to be real basins than artefacts. This output can drive a probability-weighted conditioned DEM or inform uncertainty quantification in flood inundation modelling.


Advanced: Hydrologic Connectivity

hydrologic_connectivity computes the probability (or frequency) that each cell contributes runoff to the watershed outlet, accounting for temporary storage and variable source areas:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem     = wbe.read_raster('dem_conditioned.tif')
streams = wbe.read_raster('streams_raster.tif')

connectivity = wbe.hydrology.hydrologic_indices.hydrologic_connectivity(dem, streams)
wbe.write_raster(connectivity, 'hydrologic_connectivity.tif')

Highly connected areas (near streams, with steep contributing slopes) respond quickly to rainfall; low-connectivity areas (flats, depressions, wetlands) buffer the hydrological response.


Advanced: Impoundment Analysis

Impoundment modelling simulates the water surface extent and volume that would result from a dam or weir at a specified location on a stream:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
dem     = wbe.read_raster('dem_conditioned.tif')
streams = wbe.read_raster('streams_raster.tif')

# impoundment height above stream bed in metres
impoundment_area = wbe.hydrology.depressions_storage.impoundment_size_index(
    dem, streams, damlength=1000.0
)
wbe.write_raster(impoundment_area, 'impoundment_size_index.tif')

Full Watershed Analysis Script

This end-to-end script conditions a DEM, routes flow, extracts a stream network, delineates a watershed, and produces a suite of hydrologic derivatives in a single automated workflow.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.verbose = True

# --- Inputs ---
dem_path    = 'dem_raw.tif'
outlet_path = 'outlet_point.shp'
streams_threshold = 2000   # cells (adjust to DEM resolution)

# --- 1. Read DEM ---
dem = wbe.read_raster(dem_path)

# --- 2. Fill missing data ---
dem = wbe.terrain.general.fill_missing_data(dem, filter_size=11)

# --- 3. Smooth ---
dem = wbe.terrain.general.feature_preserving_smoothing(dem, filter_size=11, num_iter=2)
wbe.write_raster(dem, 'dem_smooth.tif')

# --- 4. Condition DEM ---
dem_cond = wbe.hydrology.depressions_storage.breach_depressions_least_cost(dem, dist=50, fill_deps=True)
wbe.write_raster(dem_cond, 'dem_conditioned.tif')

# --- 5. Flow direction ---
d8_pntr  = wbe.hydrology.flow_routing.d8_pointer(dem_cond)
dinf_pntr = wbe.hydrology.flow_routing.dinf_pointer(dem_cond)
wbe.write_raster(d8_pntr, 'd8_pointer.tif')

# --- 6. Flow accumulation ---
flow_accum = wbe.hydrology.flow_routing.d8_flow_accum(d8_pntr, out_type='cells')
wbe.write_raster(flow_accum, 'flow_accum.tif')

# --- 7. Streams ---
streams = wbe.streams.network_extraction.extract_streams(flow_accum, threshold=streams_threshold)
wbe.write_raster(streams, 'streams.tif')
stream_vec = wbe.streams.network_extraction.raster_streams_to_vector(streams, d8_pntr)
wbe.write_vector(stream_vec, 'streams.gpkg')

# --- 8. Stream order ---
strahler = wbe.streams.ordering_metrics.strahler_stream_order(d8_pntr, streams)
wbe.write_raster(strahler, 'strahler_order.tif')

# --- 9. Watershed ---
outlet_pts = wbe.read_vector(outlet_path)
watershed  = wbe.hydrology.watersheds_basins.watershed(d8_pntr, outlet_pts)
wbe.write_raster(watershed, 'watershed.tif')

# --- 10. TWI ---
sca         = wbe.hydrology.flow_routing.dinf_flow_accum(dinf_pntr, out_type='sca')
slope_rad   = wbe.terrain.derivatives.slope(dem_cond, units='radians')
sca_c       = sca.max(0.001)
slope_c     = slope_rad.max(0.001)
twi         = (sca_c / slope_c.tan()).log()
wbe.write_raster(twi, 'twi.tif')

# --- 11. Height above stream ---
height_above = wbe.hydrology.hydrologic_indices.elevation_above_stream(dem_cond, streams)
wbe.write_raster(height_above, 'height_above_stream.tif')

print("Watershed analysis pipeline complete.")

Summary

Hydrological analysis in WbW-Py follows a clear preparation → routing → network → delineation progression:

  1. Condition the DEM (breach + fill) to ensure topologically correct flow.
  2. Route flow using the algorithm appropriate to your application (D8 for channels, DInf for hillslope flux).
  3. Accumulate flow and extract the stream network by thresholding.
  4. Delineate watersheds and subbasins from outlets or channel junctions.
  5. Compute terrain hydrologic indices (TWI, height above stream, connectivity).
  6. Advance to probabilistic or connectivity analysis for uncertainty quantification and dynamic source area modelling.

LiDAR Processing

LiDAR (Light Detection and Ranging) produces dense 3D point clouds from airborne or terrestrial laser scanning. Each point has a position (X, Y, Z), return number, intensity, classification, and optionally colour, waveform, and timestamp. Whitebox has one of the most comprehensive LiDAR processing pipelines available in any open or commercial GIS platform, covering the full chain from raw point cloud inspection through ground filtering, gridding, structural analysis, and individual tree segmentation.


LiDAR Data Model

A LiDAR file (LAS or LAZ) is a structured binary format with:

  • Header: file-level metadata — bounding box, CRS, point count, record format version, generating software, and global statistics.
  • Point records: per-point X/Y/Z, return metadata, intensity, classification (ground, low vegetation, buildings, water, etc.).
  • Variable length records (VLRs): CRS definitions, waveform lookups, extra byte descriptions, and custom metadata.

Modern point clouds can also be stored in COPC (Cloud-Optimized Point Cloud) format — an indexed, HTTP-range-request-friendly LAS-in-COPC wrapper — and in E57 (the ASTM exchange format) or PLY. Whitebox supports all of these through wblidar.


Core Concepts

Before processing LiDAR data, understand these foundational terms:

  • Return number: Which reflection from a single laser pulse. Pulse 1 is the first (often canopy top); pulse 2–5 capture midstory and ground returns.
  • Point classification: ASPRS standard categories — ground (2), low veg (3), medium veg (4), high veg (5), buildings (6), noise (7), overlap (12), and others.
  • Intensity: Reflectance value (0–65535) proportional to target brightness. Useful for vegetation density estimation and water detection.
  • Ground filtering: Separating terrain points (classification 2) from vegetation and buildings; critical for accurate digital terrain models (DTMs).
  • Digital terrain model (DTM): Raster surface of bare earth, computed from ground returns only. Used for hydrology, geomorphometry, and flood modelling.
  • Digital surface model (DSM): Raster surface of highest returns (canopy top). Used for building detection and volume calculations.
  • Canopy height model (CHM): DSM minus DTM; represents vegetation height above ground. Standard input for tree detection and segmentation.
  • Point density: Points per square unit (typically points/m²). Higher density enables finer segmentation; lower density requires smoothing.
  • Normalization: Converting raw Z-values to height-above-ground by subtracting DTM, creating a normalized point cloud for structural analysis.

Reading and Inspecting LiDAR Data

Reading a Single File

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

lidar = wbe.read_lidar('survey_tile.laz')
header = lidar.metadata()

print(f"Points:     {header.number_of_points}")
print(f"Bounds:     {header.min_x:.2f}, {header.min_y:.2f} to {header.max_x:.2f}, {header.max_y:.2f}")
print(f"Z range:    {header.min_z:.2f} – {header.max_z:.2f}")
print(f"Point fmt:  {header.point_format}")
print(f"CRS:        {header.wkt}")

Inspecting Individual Point Records

You can iterate over point records for custom filtering or analysis. For large files prefer the NumPy bridge or chunked streaming (see below).

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar('tile.laz')

ground_count = 0
for i in range(lidar.header.number_of_points):
    pd, time, colour, waveform = lidar.get_point_record(i)
    if pd.classification == 2:   # 2 = ground in ASPRS classification
        ground_count += 1

print(f"Ground points: {ground_count}")

NumPy Bridge

For vectorised analysis, convert the entire point cloud to a structured NumPy array:

import whitebox_workflows as wbw
import numpy as np

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar('tile.laz')

arr = lidar.to_numpy(['x', 'y', 'z', 'intensity', 'classification'])

# Z statistics for ground points
ground_z = arr['z'][arr['classification'] == 2]
print(f"Ground Z mean: {ground_z.mean():.2f}")
print(f"Ground Z std:  {ground_z.std():.2f}")

Tile Footprints

When working with a tiled survey, produce a vector index of tile footprints before processing:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

footprints = wbe.lidar.interpolation_gridding.lidar_tile_footprint(
    input_directory='lidar_tiles/',
    output='tile_index.gpkg'
)
wbe.write_vector(footprints, 'tile_index.gpkg')

Ground Point Filtering

Separating ground returns from vegetation, buildings, and other objects is the most critical pre-processing step for DEM generation. Whitebox provides several algorithms.

Progressive Morphological Filter (PMF) / IMProved Ground Point Filter

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar('raw_tile.laz')

# Classify ground returns using the improved ground point filter
lidar_classified = wbe.lidar.filtering_classification.improved_ground_point_filter(
    lidar,
    radius=0.5,       # initial search radius in metres
    min_z_range=0.1,  # minimum Z variation to be non-ground
    max_z_range=30.0  # maximum above-ground feature height
)

wbe.write_lidar(lidar_classified, 'tile_classified.laz')

Filtering by Percentile

Extract the subset of points that fall below a chosen height percentile within each local neighbourhood — useful for identifying near-ground returns without full classification:

near_ground = wbe.lidar.filtering_classification.filter_lidar_by_percentile(
    lidar,
    radius=2.0,
    percentile=5.0   # lowest 5% of heights locally
)
wbe.write_lidar(near_ground, 'near_ground_returns.laz')

Filtering by Reference Surface

Remove points above (or below) a reference raster surface by a tolerance:

ground_ref = wbe.read_raster('dtm_existing.tif')

filtered = wbe.lidar.filtering_classification.filter_lidar_by_reference_surface(
    lidar,
    reference=ground_ref,
    threshold=0.5,   # metres above reference surface
    criterion='above'
)
wbe.write_lidar(filtered, 'below_reference.laz')

Gridding: From Point Cloud to Raster

Gridding (or interpolation) converts the discrete point cloud into a continuous raster surface.

DTM — Digital Terrain Model

Interpolate from ground-classified returns to produce the bare-earth surface:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar('tile_classified.laz')

dtm = wbe.lidar.interpolation_gridding.lidar_tin_gridding(
    lidar,
    parameter='elevation',
    returns_included='last',   # last returns best represent ground
    resolution=1.0,            # output cell size in metres
    exclude_cls='0,1,3,4,5,6,7,8,9'  # exclude all non-ground classes
)
wbe.write_raster(dtm, 'dtm_1m.tif')

TIN gridding triangulates the ground returns and interpolates elevations to the output raster grid, preserving break-lines and reducing artefacts relative to simple nearest-neighbour methods.

DSM — Digital Surface Model

The DSM captures the highest return in each cell, representing the top of the vegetation and building canopy:

dsm = wbe.lidar_pointdensity(
    lidar,
    parameter='elevation',
    returns_included='first',
    resolution=1.0
)
# Or use the high-point gridding:
dsm = wbe.lidar.interpolation_gridding.lidar_tin_gridding(
    lidar,
    parameter='elevation',
    returns_included='first',
    resolution=1.0
)
wbe.write_raster(dsm, 'dsm_1m.tif')

Canopy Height Model (CHM)

CHM = DSM − DTM, expressing the height of above-ground objects:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

dtm = wbe.read_raster('dtm_1m.tif')
dsm = wbe.read_raster('dsm_1m.tif')

chm = dsm - dtm
chm = chm.max(0.0)    # Prevent negative CHM values from DEM mismatch

wbe.write_raster(chm, 'chm_1m.tif')

Intensity Surface

Intensity records the strength of the laser return and is related to surface reflectance. Gridding intensity produces a pseudo-imagery product useful for feature detection:

intensity = wbe.lidar.interpolation_gridding.lidar_tin_gridding(
    lidar,
    parameter='intensity',
    returns_included='all',
    resolution=1.0
)
wbe.write_raster(intensity, 'intensity_1m.tif')

Point Density

Understanding point density helps identify data quality issues (sparse areas, flight overlap gaps) before gridding:

density = wbe.lidar_pointdensity(lidar, resolution=1.0)
wbe.write_raster(density, 'point_density.tif')

Multiple-Tile Workflows

Large surveys are tiled and must be processed together. Whitebox supports batch processing and tile joining.

Reading Multiple Tiles

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

tiles = wbe.read_lidars([
    'tiles/tile_001.laz',
    'tiles/tile_002.laz',
    'tiles/tile_003.laz',
])

Joining Tiles

merged = wbe.lidar.io_management.lidar_join(tiles)
wbe.write_lidar(merged, 'merged.laz')

Tiling Output

After processing a large cloud, re-tile for downstream storage:

wbe.lidar.io_management.lidar_tile(
    lidar,
    width=500.0,   # tile width in map units
    height=500.0,
    origin_x=0.0,
    origin_y=0.0,
    output_directory='retiled/'
)

Normalisation (Height Above Ground)

Normalised point clouds express each point's Z as height above the ground surface rather than absolute elevation — essential for vegetation metrics.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

lidar = wbe.read_lidar('tile_classified.laz')
dtm   = wbe.read_raster('dtm_1m.tif')

normalised = wbe.normalise_lidar(lidar, dtm)
wbe.write_lidar(normalised, 'tile_normalised.laz')

After normalisation: ground returns are at Z ≈ 0, understorey vegetation at 1–5 m, mid-storey at 5–20 m, and canopy top at 20+ m (depending on forest type).


Individual Tree Segmentation

Individual tree segmentation identifies and delineates individual tree crowns from the CHM or normalised point cloud. This is used in forestry inventory, carbon stock estimation, and urban tree management.

CHM-Based Segmentation

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
chm = wbe.read_raster('chm_smooth.tif')

tree_polygons = wbe.lidar.analysis_metrics.individual_tree_detection(
    chm,
    min_search_radius=1.0,   # minimum crown radius in metres
    min_height=2.0,           # ignore vegetation below this height
    max_search_radius=10.0
)
wbe.write_vector(tree_polygons, 'tree_crowns.gpkg')

A smooth CHM substantially improves segmentation quality — apply feature_preserving_smoothing or a moderate Gaussian to the raw CHM first:

chm_raw    = wbe.read_raster('chm_1m.tif')
chm_smooth = wbe.remote_sensing.filters.gaussian_filter(chm_raw, sigma=0.75)
wbe.write_raster(chm_smooth, 'chm_smooth.tif')

Point-Cloud-Based Segmentation

For higher-detail work, segment directly in 3D:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
lidar_norm = wbe.read_lidar('tile_normalised.laz')

tree_clouds = wbe.lidar.filtering_classification.lidar_segmentation(
    lidar_norm,
    radius=1.5,
    min_z_range=2.0
)
wbe.write_lidar(tree_clouds, 'trees_segmented.laz')

Structural Metrics

Canopy Cover and Closure

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar('tile_normalised.laz')

# Canopy cover: fraction of cells with returns above height threshold
cover = wbe.lidar_canopy_cover(lidar, threshold=2.0, resolution=20.0)
wbe.write_raster(cover, 'canopy_cover_20m.tif')

Height Percentiles and Mean Height

p75 = wbe.lidar.filtering_classification.lidar_elevation_slice(lidar, min_h=0.0, max_h=None, cls=1)
wbe.write_raster(p75, 'canopy_p75.tif')

Building Detection

LiDAR height and planarity cues allow detection of building footprints:

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar('urban_tile.laz')
dtm   = wbe.read_raster('dtm_urban.tif')

buildings = wbe.lidar_building_detection(
    lidar,
    dtm,
    min_height=3.0,
    min_area=25.0
)
wbe.write_vector(buildings, 'detected_buildings.gpkg')

Chunked Lidar Streaming

For very large LiDAR datasets that exceed available RAM, WbW-Py supports chunked streaming via the NumPy bridge. Each chunk is a fixed-size window over the point array:

import whitebox_workflows as wbw
import numpy as np

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar('large_survey.copc.laz')

first_return_z = []

for chunk in lidar.to_numpy_chunks(['x', 'y', 'z', 'return_number'], chunk_size=500_000):
    mask = chunk['return_number'] == 1
    first_return_z.append(chunk['z'][mask])

all_first_z = np.concatenate(first_return_z)
print(f"First-return Z mean: {all_first_z.mean():.2f}")

Full Ground-Filter-to-DTM Pipeline

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.verbose = True

# --- 1. Read raw tile ---
lidar = wbe.read_lidar('raw_flight.laz')
print(lidar.metadata())

# --- 2. Remove outlier points ---
lidar_clean = wbe.lidar.filtering_classification.lidar_elevation_slice(lidar, min_h=-2.0, max_h=3000.0)

# --- 3. Ground point filtering ---
lidar_classified = wbe.lidar.filtering_classification.improved_ground_point_filter(lidar_clean, radius=0.5)
wbe.write_lidar(lidar_classified, 'classified.laz')

# --- 4. DTM ---
dtm = wbe.lidar.interpolation_gridding.lidar_tin_gridding(
    lidar_classified,
    parameter='elevation',
    returns_included='last',
    resolution=0.5,
    exclude_cls='0,1,3,4,5,6,7,8,9'
)
dtm = wbe.terrain.general.fill_missing_data(dtm, filter_size=11)
wbe.write_raster(dtm, 'dtm_0.5m.tif')

# --- 5. DSM ---
dsm = wbe.lidar.interpolation_gridding.lidar_tin_gridding(
    lidar_classified,
    parameter='elevation',
    returns_included='first',
    resolution=0.5
)
wbe.write_raster(dsm, 'dsm_0.5m.tif')

# --- 6. CHM ---
chm = (dsm - dtm).max(0.0)
wbe.write_raster(chm, 'chm_0.5m.tif')

# --- 7. Normalise ---
lidar_norm = wbe.normalise_lidar(lidar_classified, dtm)
wbe.write_lidar(lidar_norm, 'normalised.laz')

# --- 8. Tree segmentation ---
chm_smooth = wbe.remote_sensing.filters.gaussian_filter(chm, sigma=0.75)
trees = wbe.lidar.analysis_metrics.individual_tree_detection(chm_smooth, min_search_radius=1.0, min_height=2.0)
wbe.write_vector(trees, 'tree_crowns.gpkg')

print(f"Detected {trees.num_features()} tree crowns.")

WbW-Pro Spotlight: LiDAR Change and Disturbance Analysis

  • Problem: Compare repeat LiDAR epochs to detect disturbance in a repeatable way.
  • Tool: lidar_change_and_disturbance_analysis
  • Typical inputs: Baseline tile set, monitoring tile set, output resolution, minimum change threshold.
  • Typical outputs: Change rasters plus summary metrics for affected area, hotspot intensity, and QA review.
import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

result = wbe.run_tool(
    'lidar_change_and_disturbance_analysis',
    {
        'baseline_tiles': '/data/lidar_epoch_2022/',
        'monitor_tiles':  '/data/lidar_epoch_2025/',
        'resolution': 1.0,
        'min_change_m': 0.5,
        'output_prefix': 'disturbance_2025_vs_2022'
    }
)
print(result)

Note: This workflow requires a WbEnvironment initialized with a valid Pro licence.


Summary

LiDAR processing in WbW-Py covers the full pipeline:

  1. Inspect raw point cloud headers and per-file statistics.
  2. Filter outliers and classify ground returns.
  3. Grid ground, first returns, and intensity to produce DTM, DSM, and CHM.
  4. Normalise for vegetation structure analysis.
  5. Segment individual trees from the CHM or point cloud.
  6. Compute structural metrics at plot or landscape scale.
  7. Stream chunked data for very large surveys.

The high-performance wblidar backend supports LAS 1.0–1.5, LAZ, COPC, E57, and PLY natively, with no external dependencies or codec wrappers.


Tips

  • Choose your format wisely: LAS is universal and compact; LAZ adds compression and is ideal for archival or transmission. COPC is cloud-optimized and best for remote HTTP range-request access. Use LAZ or LAS for terrestrial/airborne surveys; COPC for cloud-native workflows.
  • Always validate classifications: Use lidar_histogram() and lidar_info() to inspect point distributions by return and classification. Misclassified ground points silently corrupt DTMs and downstream hydrology.
  • DTM vs. DSM vs. CHM: Generate all three at the same resolution so derivatives align. A common pitfall is mixing DTM and DSM resolution.
  • Ground filtering is critical: Outliers and noise (classification 7) should be excluded before gridding. Use lidar_filter_for_ground() to remove spikes and erratic points.
  • Normalization enables vegetation analysis: Always normalize point clouds (subtract DTM) before individual tree detection or canopy structural metrics.
  • Monitor memory for large surveys: Point clouds are memory-intensive. For datasets > 1 GB, use streaming APIs (lidar_read_chunked()) rather than loading the entire tile at once.
  • Coordinate reference systems matter: LAS headers carry CRS as WKT. Verify WKT matches your project CRS before gridding or merging tiles.
  • Density and grid resolution: If point density is < 0.5 pts/m², consider upsampling or smoothing the output grid to avoid isolated pits or peaks.

Remote Sensing Analysis

Remote sensing uses satellite imagery, aerial photography, and drone captures to characterise the Earth's surface. Whitebox Workflows for Python (WbW-Py) provides a comprehensive toolkit for image processing, spectral analysis, dimensionality reduction, supervised and unsupervised classification, change detection, and sensor-specific workflows. Because all tools operate directly on in-memory raster objects, complex multi-step image analysis pipelines can be written as concise Python scripts.

Sensor Bundle First: When working with industry-standard satellite products (Sentinel-2, Landsat, PlanetScope, SAR, and others), open the scene as a sensor bundle rather than loading individual band files by hand. Bundles provide automatic metadata discovery, key-based band access, and one-call true/false-colour composites that work across sensor families without hardcoding file names.


Core Concepts

Remote sensing image analysis requires familiarity with these core ideas:

  • Spectral bands: Distinct wavelength ranges (e.g. blue 450–510 nm, red 620–750 nm, NIR 750–900 nm). Different materials reflect different bands, enabling material discrimination.
  • Spectral indices: Normalized ratios of bands that isolate phenomena. NDVI (Normalized Difference Vegetation Index) uses NIR and red to measure greenness; NDWI uses NIR and SWIR for water content.
  • Spatial resolution: Pixel size in meters (Sentinel-2: 10 m for visible/NIR, 20 m for SWIR; Landsat: 30 m; SAR: 5–30 m depending on mode).
  • Temporal resolution: Revisit interval (Sentinel-2: 5 days; Landsat: 16 days; PlanetScope: daily or higher).
  • Atmospheric effects: Raw radiance is affected by aerosols, water vapour, and ozone. Surface reflectance products are atmospherically corrected; still require relative normalization for multi-date analysis.
  • Cloud masking: Cloud and cloud shadow pixels must be identified and excluded before classification or change detection using quality/QA bands.
  • Supervised classification: Training polygons with known labels teach a model to assign classes to unlabelled pixels. Training quality directly controls classification accuracy.
  • Unsupervised classification: Clustering algorithms (K-means, ISODATA) discover spectral clusters without training labels; useful for exploratory analysis.
  • Change detection: Comparing indices or classifications across dates to identify land-use changes, disturbance, or phenological shifts.

Sensor Bundles — Cross-Family Scene Ingestion

WbW-Py's Bundle class wraps a product folder (zip archive or extracted directory) and exposes a consistent API regardless of sensor family. This is the preferred starting point for any scene-level workflow.

Opening a Bundle

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

# Works with Sentinel-2, Landsat 8/9, PlanetScope, SPOT, SAR, etc.
bundle = wbe.read_bundle('/data/S2B_MSIL2A_20240601T105619_N0510_R094_T32TPT_20240601T142845.SAFE')

# Or from a zip archive — WbW extracts it automatically
bundle = wbe.read_bundle('/data/LC09_L2SP_017030_20240610_20240612_02_T1.tar')

Discovering Available Layers

Bundle surfaces keys for bands, derived measurements, QA/cloud masks, auxiliary layers, and additional assets:

print(bundle.family)               # e.g. 'sentinel2', 'landsat_c2', 'planetscope'
print(bundle.mission)              # e.g. 'Sentinel-2B'
print(bundle.tile_id())            # e.g. '32TPT'
print(bundle.processing_level())   # e.g. 'L2A', 'L2SP'
print(bundle.cloud_cover_percent())
print(bundle.acquisition_datetime_utc())

print(bundle.list_band_keys())        # spectral bands, e.g. ['B02', 'B03', 'B04', 'B08', ...]
print(bundle.list_measurement_keys()) # derived measurements, e.g. ['ndvi', 'ndwi']
print(bundle.list_qa_keys())          # quality/cloud layers, e.g. ['SCL', 'QA_PIXEL']
print(bundle.list_aux_keys())         # auxiliary rasters, e.g. ['AOT', 'WVP']
print(bundle.list_asset_keys())       # additional assets (angles, browse images, etc.)

Reading Bands by Key

# Keys follow sensor-native naming — no need to memorise file paths
blue  = bundle.read_band('B02')   # Sentinel-2 blue
green = bundle.read_band('B03')
red   = bundle.read_band('B04')
nir   = bundle.read_band('B08')
swir1 = bundle.read_band('B11')
swir2 = bundle.read_band('B12')

# Landsat 9 uses different key names
# blue  = bundle.read_band('SR_B2')
# green = bundle.read_band('SR_B3')
# red   = bundle.read_band('SR_B4')
# nir   = bundle.read_band('SR_B5')

# QA / cloud mask
cloud_mask = bundle.read_qa_layer('SCL')      # Sentinel-2 scene classification
# cloud_mask = bundle.read_qa_layer('QA_PIXEL')  # Landsat Collection 2

Quick-Look Composites

Bundles know which keys correspond to red/green/blue/NIR bands for their sensor family, so composites require no band-order bookkeeping:

# Write a true-colour GeoTIFF (auto-enhanced by default)
bundle.true_colour_composite(wbe, output_path='true_colour.tif')

# False-colour (NIR-Red-Green) composite
bundle.false_colour_composite(wbe, output_path='false_colour.tif')

Multi-Sensor Workflow Without Hardcoded Paths

The bundle API is deliberately family-agnostic. The same code body works on Sentinel-2 and Landsat scenes because both expose their bands by semantic key:

def compute_ndvi_from_bundle(wbe, bundle_path, output_path):
    b = wbe.read_bundle(bundle_path)
    if 'ndvi' in b.list_measurement_keys():
        ndvi = b.read_measurement('ndvi')
    else:
        # Fall back to band-based NDVI — works for any optical sensor
        red_band = b.read_band('B04') if b.family == 'sentinel2' else b.read_band('SR_B4')
        nir_band = b.read_band('B08') if b.family == 'sentinel2' else b.read_band('SR_B5')
        ndvi = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(nir_band, red_band)
    wbe.write_raster(ndvi, output_path, compress=True)

compute_ndvi_from_bundle(wbe, '/data/S2B_MSIL2A_20240601.SAFE', 'ndvi_s2.tif')
compute_ndvi_from_bundle(wbe, '/data/LC09_L2SP_017030.tar',     'ndvi_l9.tif')

Working with Individual Band Files

When bundles are not available (e.g., reprojected mosaics, custom composites, legacy archives), load individual band files in the conventional way. All raster objects returned by read_band() and read_raster() are interchangeable.

wbe.working_directory = '/data/sentinel2'

blue   = wbe.read_raster('B02_10m.tif')
green  = wbe.read_raster('B03_10m.tif')
red    = wbe.read_raster('B04_10m.tif')
nir    = wbe.read_raster('B08_10m.tif')

# Sentinel-2 bands 11/12 are 20 m; resample to match 10 m bands before analysis
swir1 = wbe.remote_sensing.enhancement_contrast.resample(wbe.read_raster('B11_20m.tif'), base_raster=red, method='bilinear')
swir2 = wbe.remote_sensing.enhancement_contrast.resample(wbe.read_raster('B12_20m.tif'), base_raster=red, method='bilinear')

Cloud and No-Data Masking

Before any analysis, mask clouds, cloud shadows, and saturated pixels.

# Sentinel-2 SCL classes: 3=cloud shadow, 8=medium cloud, 9=high cloud, 10=thin cirrus
scl = bundle.read_qa_layer('SCL')
cloud_free_red = wbe.raster.general.raster_calculator(
    "if('scl' == 3 or 'scl' == 8 or 'scl' == 9 or 'scl' == 10, nodata, 'red')",
    [scl, red]
)

# Landsat Collection 2 QA_PIXEL — dilated cloud = bit 1, cloud = bit 3, shadow = bit 4
# qa = bundle.read_qa_layer('QA_PIXEL')
# Use raster_calculator with bitwise masking expressions to isolate cloud/shadow pixels

Spectral Indices

Spectral indices are band-ratio transformations that suppress illumination variation and amplify specific surface properties. WbW-Py's normalized_difference_index() is a general-purpose tool for any normalised ratio, while raster_calculator() accommodates arbitrary expressions.

Normalised Difference Vegetation Index (NDVI)

NDVI measures photosynthetically active green biomass:

$$NDVI = \frac{NIR - Red}{NIR + Red}$$

Values range from −1 to +1; healthy vegetation typically exceeds 0.3.

ndvi = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(nir, red)
wbe.write_raster(ndvi, 'ndvi.tif', compress=True)

Common Water, Snow, and Urban Indices

# NDWI (McFeeters 1996) — open water; Green/NIR
ndwi  = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(green, nir)

# MNDWI — better for urban areas; Green/SWIR1
mndwi = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(green, swir1)

# NBR — fire severity and post-fire recovery; NIR/SWIR2
nbr   = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(nir, swir2)

# NDSI — snow and ice; Green/SWIR1
ndsi  = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(green, swir1)

# NDBI — normalised built-up index; SWIR1/NIR
ndbi  = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(swir1, nir)

Enhanced Vegetation Index (EVI)

EVI reduces soil background noise and atmospheric effects that affect NDVI in dense canopies:

$$EVI = 2.5 \cdot \frac{NIR - Red}{NIR + 6 \cdot Red - 7.5 \cdot Blue + 1}$$

evi = wbe.raster.general.raster_calculator(
    expression="2.5 * ('nir' - 'red') / ('nir' + 6.0 * 'red' - 7.5 * 'blue' + 1.0)",
    input_rasters=[nir, red, blue]
)
wbe.write_raster(evi, 'evi.tif', compress=True)

Soil Adjusted Vegetation Index (SAVI)

SAVI introduces a soil brightness correction factor L (commonly 0.5):

$$SAVI = \frac{(NIR - Red) \cdot (1 + L)}{NIR + Red + L}$$

L = 0.5
savi = wbe.raster.general.raster_calculator(
    expression="('nir' - 'red') * (1.0 + 0.5) / ('nir' + 'red' + 0.5)",
    input_rasters=[nir, red]
)

Image Enhancement and Contrast Stretching

Raw digital numbers often have narrow histogram ranges that make visualisation difficult. WbW-Py provides several enhancement methods:

# Percentage contrast stretch — clips top and bottom 2% of values
enhanced = wbe.remote_sensing.enhancement_contrast.percentage_contrast_stretch(red, clip_tail=2.0)

# Standard deviation stretch — maps ±2σ to display range
sd_stretched = wbe.remote_sensing.enhancement_contrast.standard_deviation_contrast_stretch(red, num_std_dev=2.0)

# Gaussian contrast stretch
gauss = wbe.remote_sensing.enhancement_contrast.gaussian_contrast_stretch(red, num_std_dev=2.0)

# Sigmoidal stretch — soft S-curve useful for optical imagery
sig = wbe.remote_sensing.enhancement_contrast.sigmoidal_contrast_stretch(red, cutoff=0.4, gain=4.0)

# Min-max linear stretch
linear = wbe.remote_sensing.enhancement_contrast.min_max_contrast_stretch(red, min_val=0.0, max_val=255.0)

# Gamma correction — lighten (gamma<1) or darken (gamma>1) an image
gamma = wbe.remote_sensing.enhancement_contrast.gamma_correction(red, gamma=0.6)

Histogram matching normalises a source image to match the distribution of a reference image — invaluable when mosaicking scenes acquired on different dates or under different atmospheric conditions:

# Match the histogram of a target scene to a reference scene
matched = wbe.remote_sensing.enhancement_contrast.histogram_matching(source_scene, reference_scene)

# You can also match between two images from the same sensor
matched2 = wbe.remote_sensing.enhancement_contrast.histogram_matching_two_images(img1, img2)

IHS Colour Space Transformations

Intensity-Hue-Saturation (IHS) space separates brightness from colour, enabling selective sharpening or enhancement without hue distortion:

# Convert RGB composite to IHS
(intensity, hue, saturation) = wbe.remote_sensing.enhancement_contrast.rgb_to_ihs(red, green, blue)

# Enhance the intensity channel
enhanced_i = wbe.remote_sensing.enhancement_contrast.standard_deviation_contrast_stretch(intensity, num_std_dev=2.0)

# Convert back to RGB
(r2, g2, b2) = wbe.remote_sensing.enhancement_contrast.ihs_to_rgb(enhanced_i, hue, saturation)

Panchromatic Sharpening (Pan-Sharpening)

When a high-resolution panchromatic band accompanies lower-resolution multispectral data, IHS pan-sharpening fuses the two:

panchromatic = bundle.read_band('B8A')   # Sentinel-2 red-edge as panchromatic proxy
# Landsat: panchromatic = bundle.read_band('PAN')   # 15 m Landsat panchromatic

(sharp_r, sharp_g, sharp_b) = wbe.remote_sensing.enhancement_contrast.panchromatic_sharpening(
    pan=panchromatic,
    red=red,
    green=green,
    blue=blue
)
wbe.write_raster(sharp_r, 'pan_sharp_r.tif')
wbe.write_raster(sharp_g, 'pan_sharp_g.tif')
wbe.write_raster(sharp_b, 'pan_sharp_b.tif')

Image Filtering

Spatial filters are used to suppress noise, enhance edges, or smooth imagery before classification.

# Gaussian smoothing — reduces sensor noise
smoothed = wbe.remote_sensing.filters.gaussian_filter(red, sigma=1.0)

# Bilateral filter — edge-preserving smoothing
bilateral = wbe.remote_sensing.filters.bilateral_filter(red, sigma_dist=2.0, sigma_int=25.0)

# High-pass filter — enhances fine texture
texture = wbe.remote_sensing.filters.high_pass_filter(red, filter_size_x=5, filter_size_y=5)

# Unsharp masking — sharpens blurred imagery
sharp = wbe.remote_sensing.filters.unsharp_masking(red, sigma=3.0, amount=1.0, threshold=0)

# Edge detection — Sobel gradient magnitude
edges_h = wbe.remote_sensing.edge_feature_detection.sobel_filter(red, variant='3x3')

# Canny edge detector — more precise edge localisation
canny_edges = wbe.remote_sensing.edge_feature_detection.canny_edge_detection(red, sigma=0.5,
                                        low_threshold=5.0, high_threshold=15.0)

# General-purpose GLCM texture (multiband output)
# Band names are recorded in raster metadata as band_1_name, band_2_name, ...
glcm = wbe.remote_sensing.filters.glcm_texture(
    red,
    window_size=9,
    distance=1,
    angles="0,45,90,135",
    features="contrast,homogeneity,entropy",
    direction_aggregation="mean",
    levels=32,
    output_path="glcm_texture.tif",
)

Principal Component Analysis (PCA)

PCA is an essential step in multispectral and hyperspectral analysis. It rotates correlated bands into decorrelated principal components (PCs) ordered by descending variance. The first few PCs typically capture most scene variance and are used to reduce data dimensionality before classification.

# Run PCA on all six bands
bands = [blue, green, red, nir, swir1]
pca_result = wbe.raster.general.principal_component_analysis(
    input_rasters=bands,
    output_html_file='pca_report.html',
    num_comp=4,
    standardize=True   # unit-variance standardisation recommended when bands
                       # have very different value ranges
)
# pca_result is a list of component rasters ordered PC1, PC2, ...
pc1, pc2, pc3, pc4 = pca_result[0], pca_result[1], pca_result[2], pca_result[3]
wbe.write_raster(pc1, 'pc1.tif')
wbe.write_raster(pc2, 'pc2.tif')

The HTML report includes the eigenvalue table, percentage of variance explained per component, and the component loadings matrix. PC1 often correlates strongly with overall brightness. PC2 frequently captures vegetation/non-vegetation contrast. Higher PCs capture moisture, soil, and urban differences.

Inverse PCA

Apply classification or enhancements to individual PCs and then reconstruct back to original band space:

# Modify pc1, then reconstruct
pc1_modified = wbe.remote_sensing.enhancement_contrast.standard_deviation_contrast_stretch(pc1, num_std_dev=2.0)
modified_components = [pc1_modified, pc2, pc3, pc4]

reconstructed_bands = wbe.raster.general.inverse_pca(
    modified_components,
    original_rasters=bands
)

Image Segmentation and Object-Based Analysis

Object-based image analysis (OBIA) groups pixels into meaningful spatial units (segments) before classifying them. This is superior to pixel-based classification for high-resolution imagery where individual objects span many pixels.

# Inspect the dedicated OBIA grouping under remote sensing.
print(wbe.remote_sensing.obia.list_tools())

# 1) Create baseline segments (SLIC-like open-core baseline).
segments = wbe.remote_sensing.obia.segment_slic_superpixels(
    inputs=[red, green, nir],
    region_size=18,
    compactness=12.0,
    output='segments_slic.tif'
)

# 2) Merge small regions for cleaner object topology.
segments_clean = wbe.remote_sensing.obia.segments_merge_small_regions(
    segments=segments,
    min_size=12,
    method='longest',
    output='segments_clean.tif'
)

# 3) Extract object-level features.
spectral_csv = wbe.remote_sensing.obia.object_features_spectral_basic(
    segments=segments_clean,
    inputs=[red, green, nir],
    output='object_features_spectral.csv'
)

shape_csv = wbe.remote_sensing.obia.object_features_shape_basic(
    segments=segments_clean,
    output='object_features_shape.csv'
)

texture_csv = wbe.remote_sensing.obia.object_features_texture_glcm_basic(
    segments=segments_clean,
    input=nir,
    levels=16,
    output='object_features_texture.csv'
)

# 4) Train/apply object RF model using segment-level training labels.
pred_csv = wbe.remote_sensing.obia.classify_objects_random_forest(
    features='object_features_all.csv',
    training='training_segments.csv',
    class_field='class',
    output='object_predictions.csv'
)

# 5) Evaluate object-level accuracy.
report = wbe.remote_sensing.obia.evaluate_object_classification_accuracy(
    predictions=pred_csv,
    reference='validation_segments.csv',
    output='object_accuracy.json'
)

# Optional one-call baseline pipeline.
outputs = wbe.remote_sensing.obia.obia_pipeline_basic(
    inputs=[red, green, nir],
    training='training_segments.csv',
    output_prefix='obia_field01',
    segment_method='slic',
)

This baseline stack is designed to be reproducible and script-friendly. For many projects, the one-call obia_pipeline_basic run is the fastest path to a validated Phase 1 workflow.

Advanced OBIA Capabilities (Open Tier)

The OBIA stack now includes advanced capabilities in open tier. These tools are available under wbe.remote_sensing.obia.* and are grouped here by workflow purpose.

Segmentation and scale control:

  • segment_watershed_markers
  • segment_multiresolution_hierarchical
  • segment_scale_parameter_optimizer
  • segments_split_low_cohesion

Object conversion and interoperability:

  • segments_to_polygons
  • polygons_to_segments

Advanced feature engineering:

  • object_features_context_neighbors
  • object_features_topology_relations

Advanced object classification:

  • classify_objects_svm
  • classify_objects_ensemble_pro
  • classify_objects_rules_basic
  • classify_objects_rules_hierarchical
  • object_class_probability_maps
  • object_uncertainty_diagnostics_pro

Hierarchy management and propagation:

  • build_object_hierarchy_multiscale
  • propagate_labels_across_hierarchy

Post-processing and quality:

  • objects_enforce_min_mapping_unit
  • objects_boundary_refinement_pro
  • evaluate_segmentation_quality_pro

Workflow orchestration and reporting:

  • obia_batch_orchestrator_pro
  • obia_audit_report_pro
# Build multi-scale objects and hierarchy links
hier = wbe.remote_sensing.obia.segment_multiresolution_hierarchical(
    inputs=[red, green, nir],
    coarse_k=900.0,
    fine_k=280.0,
    output_prefix='site01_hier'
)

# Add neighborhood + topology context features for difficult classes
context_csv = wbe.remote_sensing.obia.object_features_context_neighbors(
    segments=hier['segments_fine'],
    output='site01_context.csv'
)
topology_csv = wbe.remote_sensing.obia.object_features_topology_relations(
    segments=hier['segments_fine'],
    output='site01_topology.csv'
)

# Ensemble and rule-hierarchy options
ensemble_pred = wbe.remote_sensing.obia.classify_objects_ensemble_pro(
    features='site01_features_all.csv',
    training='site01_training_segments.csv',
    output='site01_pred_ensemble.csv'
)
rule_pred = wbe.remote_sensing.obia.classify_objects_rules_hierarchical(
    features='site01_features_all.csv',
    rules='site01_rules.csv',
    output='site01_pred_rules.csv'
)

# Probability and uncertainty diagnostics
prob_csv = wbe.remote_sensing.obia.object_class_probability_maps(
    predictions=ensemble_pred,
    output='site01_probabilities.csv'
)
unc_json = wbe.remote_sensing.obia.object_uncertainty_diagnostics_pro(
    probabilities=prob_csv,
    low_conf_threshold=0.7,
    output='site01_uncertainty.json'
)
# Batch orchestration + audit report for multi-scene production runs
batch = wbe.remote_sensing.obia.obia_batch_orchestrator_pro(
    jobs=[
        {
            'inputs': ['s1_red.tif', 's1_green.tif', 's1_nir.tif'],
            'training': 's1_training.csv',
            'output_prefix': 'prod/s1',
            'segment_method': 'graph',
        },
        {
            'inputs': ['s2_red.tif', 's2_green.tif', 's2_nir.tif'],
            'training': 's2_training.csv',
            'output_prefix': 'prod/s2',
            'segment_method': 'slic',
        },
    ],
    output='prod/obia_batch_report.json'
)

audit = wbe.remote_sensing.obia.obia_audit_report_pro(
    artifacts=[
        'prod/s1_object_predictions.csv',
        'prod/s2_object_predictions.csv',
        'prod/obia_batch_report.json',
    ],
    output='prod/obia_audit.json'
)

The segments_to_polygons and polygons_to_segments conversion tools are also valuable in edit-and-return workflows where analysts refine object boundaries in vector space and then rasterize updated objects back to segment grids.


Unsupervised Classification

Unsupervised classification groups pixels by spectral similarity without training data, making it useful for exploratory analysis.

K-Means Clustering

bands = [blue, green, red, nir, swir1]

kmeans_result = wbe.remote_sensing.classification.k_means_clustering(
    input_rasters=bands,
    num_classes=10,
    max_iterations=25,
    class_change_threshold=2.0,
    initialize='random'
)
wbe.write_raster(kmeans_result, 'kmeans_10class.tif')

K-means with 10–15 classes followed by manual merging of semantically similar classes is a common workflow. Visualise the clusters against known reference areas to assign land-cover labels.

Modified K-Means

Modified k-means iteratively merges clusters that are too small or spectrally indistinct, and splits clusters that are too dispersed:

mod_kmeans = wbe.remote_sensing.classification.modified_k_means_clustering(
    input_rasters=bands,
    start_num_classes=20,
    merge_distance=2.0,
    max_iterations=25
)
wbe.write_raster(mod_kmeans, 'modified_kmeans.tif')

DBSCAN Clustering

DBSCAN is a density-based algorithm that does not require specifying the number of clusters and handles irregularly shaped spectral clusters well:

dbscan_result = wbe.raster.general.dbscan(
    input_rasters=bands,
    scaling_method='min_max',
    search_distance=0.5,
    min_points=5
)
wbe.write_raster(dbscan_result, 'dbscan_clusters.tif')

Supervised Classification

Supervised classification uses labelled training areas to build a model that is then applied across the full image. WbW-Py supports several classifiers.

Evaluating Training Sites

Before training, check that each class is spectrally separable. Poor separability leads to confused outputs regardless of classifier choice:

training_polys = wbe.read_vector('training_polygons.shp')
wbe.remote_sensing.classification.evaluate_training_sites(
    input_rasters=bands,
    training_polygons=training_polys,
    class_field_name='CLASS',
    output_html_file='separability_report.html'
)

The HTML report shows histograms and box-plots per band per class. Classes whose histograms overlap substantially should be merged or split by adding more nuanced training polygons.

Minimum Distance Classification

The simplest linear classifier assigns each pixel to the nearest class mean in feature space:

classified_md = wbe.remote_sensing.classification.min_dist_classification(
    input_rasters=bands,
    polys=training_polys,
    class_field=True,
    class_field_name='CLASS',
    threshold=5.0  # optional: do not classify if z-score distance > 5
)
wbe.write_raster(classified_md, 'classified_min_dist.tif')

Parallelepiped Classification

The parallelepiped classifier assigns pixels that fall within all class-mean ± n×σ boxes. It is fast but can leave pixels unclassified when they fall outside all boxes:

classified_pp = wbe.remote_sensing.classification.parallelepiped_classification(
    input_rasters=bands,
    polys=training_polys,
    class_field_name='CLASS'
)
wbe.write_raster(classified_pp, 'classified_parallelepiped.tif')

K-Nearest Neighbour Classification

KNN classification is a non-parametric method well-suited to non-linear class boundaries. The k parameter is the number of neighbours to consider:

training_pts = wbe.read_vector('training_points.shp')

knn_model = wbe.remote_sensing.classification.knn_classification(
    input_rasters=bands,
    training_data=training_pts,
    field_name='CLASS',
    scaling_method='z_score',
    k=7,
    distance_weighting=True,
    test_proportion=0.2,
    create_output=True
)
wbe.write_raster(knn_model, 'classified_knn.tif')

Random Forest Classification

Random forest is an ensemble tree classifier that is robust to noise, handles multi-class problems, and produces out-of-bag accuracy estimates. All formerly Pro-tier classifier tools are now open-source:

# Step 1: fit the model and save it
rf_model = wbe.raster.general.random_forest_classification_fit(
    input_rasters=bands,
    training_data=training_polys,
    class_field_name='CLASS',
    n_trees=500,
    min_samples_leaf=1,
    test_proportion=0.2
)
# rf_model is a path to the saved model file

# Step 2: predict on the full image (can be a different image/date)
classified_rf = wbe.raster.general.random_forest_classification_predict(
    input_rasters=bands,
    model=rf_model
)
wbe.write_raster(classified_rf, 'classified_rf.tif')

The fit step prints an accuracy report including the confusion matrix, Kappa coefficient, and overall accuracy.

Support Vector Machine (SVM) Classification

SVMs find the maximum-margin hyperplane separating classes and are particularly effective with high-dimensional data and small training sets:

classified_svm = wbe.remote_sensing.classification.svm_classification(
    input_rasters=bands,
    training=training_polys,
    field='CLASS',
    scaling_method='z_score',
    test_proportion=0.2,
    create_output=True
)
wbe.write_raster(classified_svm, 'classified_svm.tif')

Logistic Regression Classification

Logistic regression is a fast and interpretable baseline classifier, useful as a benchmark before applying more complex models:

classified_lr = wbe.remote_sensing.classification.logistic_regression(
    input_rasters=bands,
    training_data=training_polys,
    class_field_name='CLASS',
    scaling_method='z_score',
    test_proportion=0.2,
    create_output=True
)

Accuracy Assessment

Compare a classified raster against a validation point dataset:

# Kappa index of agreement between classified image and reference data
accuracy = wbe.raster.general.kappa_index(
    classified=classified_rf,
    reference=wbe.read_raster('reference_classification.tif'),
    output_html_file='accuracy_report.html'
)

Generalising Classification Outputs

Classified rasters often contain salt-and-pepper noise — isolated pixels assigned to a class inconsistent with their neighbours. Two tools remove this:

# Remove small patches by merging them into surrounding majority class
generalised = wbe.remote_sensing.classification.generalize_classified_raster(
    classified=classified_rf,
    min_class_size=5  # minimum patch size in cells
)

# Alternative: merge small patches into most spectrally similar neighbour
generalised2 = wbe.remote_sensing.classification.generalize_with_similarity(
    input_rasters=bands,
    classified=classified_rf,
    min_class_size=5
)

# Remove holes (background pixels encircled by foreground)
no_holes = wbe.conversion.raster_vector_conversion.remove_raster_polygon_holes(
    input_raster=classified_rf,
    threshold=25          # cells
)
wbe.write_raster(generalised, 'classified_rf_clean.tif')

Change Detection

Multi-temporal analysis detects land-cover change between two acquisitions.

Image Differencing

The simplest approach differences co-registered images. NDVI differencing, for example, highlights vegetation gain and loss:

ndvi_t1 = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(nir_t1, red_t1)
ndvi_t2 = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(nir_t2, red_t2)
ndvi_change = wbe.raster.general.raster_calculator("'t2' - 't1'", [ndvi_t2, ndvi_t1])
wbe.write_raster(ndvi_change, 'ndvi_change.tif', compress=True)

Change Vector Analysis (CVA)

CVA computes the magnitude and direction of change in multidimensional feature space between two dates. The output direction angle indicates the type of change (e.g., vegetation gain vs. urban growth) while magnitude reflects its intensity:

magnitude, direction = wbe.remote_sensing.change_detection.change_vector_analysis(
    input_rasters_t1=[red_t1, nir_t1, swir1_t1],
    input_rasters_t2=[red_t2, nir_t2, swir1_t2]
)
wbe.write_raster(magnitude, 'cva_magnitude.tif')
wbe.write_raster(direction, 'cva_direction.tif')

Post-Classification Comparison

Classify both dates independently and difference the class maps. This preserves the semantics of each date's land-cover map:

# Train on t1 and apply to t2 using the same saved RF model
classified_t1 = wbe.raster.general.random_forest_classification_predict(bands_t1, rf_model)
classified_t2 = wbe.raster.general.random_forest_classification_predict(bands_t2, rf_model)

# Produce a change raster (unique code for each from-to class transition)
change_map = wbe.raster.general.raster_calculator(
    "'t1' * 100 + 't2'",
    [classified_t1, classified_t2]
)
wbe.write_raster(change_map, 'change_map.tif')

Advanced Change Detection Tools

The sprint additions expose dedicated change tools that return richer diagnostics than simple raster subtraction:

# Multiband image differencing with optional signed and mask outputs
diff_result = wbe.remote_sensing.change_detection.image_difference_change_detection(
    t1_inputs=[red_t1, nir_t1, swir1_t1],
    t2_inputs=[red_t2, nir_t2, swir1_t2],
    output='img_diff_mag.tif',
    options={
        'mode': 'magnitude',
        'threshold_sigma': 2.0,
        'output_signed': 'img_diff_signed.tif',
        'output_mask': 'img_diff_mask.tif'
    }
)

# Post-classification transition table + remap support
post_class_result = wbe.remote_sensing.change_detection.post_classification_change(
    t1_classified=classified_t1,
    t2_classified=classified_t2,
    output='post_class_transition.tif',
    options={
        'transition_scale': 1000,
        't1_class_remap': {'11': 1, '12': 1},
        't2_class_remap': {'41': 4, '42': 4}
    }
)

# PCA-based change with optional mask/report outputs
pca_change_result = wbe.remote_sensing.change_detection.pca_based_change_detection(
    t1_inputs=[red_t1, nir_t1, swir1_t1],
    t2_inputs=[red_t2, nir_t2, swir1_t2],
    output='pca_change_pc1.tif',
    options={
        'component': 1,
        'threshold_sigma': 2.0,
        'output_mask': 'pca_change_mask.tif',
        'output_report': 'pca_change_report.json'
    }
)

Radiometric and Thermal Emissivity Tools

For physically grounded thermal workflows, run radiometric correction and emissivity estimation before LST:

# Atmospheric haze reduction
dos_result = wbe.remote_sensing.radiometric_correction.dark_object_subtraction(
    inputs=[blue, green, red, nir],
    output='dos_stack.tif',
    options={'percentile': 1.0, 'output_diagnostic_offsets': 'dos_offsets.tif'}
)

# DN to TOA reflectance using bundle metadata where available
toa_result = wbe.remote_sensing.radiometric_correction.dn_to_toa_reflectance(
    inputs=[blue, green, red, nir],
    output='toa_stack.tif',
    options={'sensor_bundle_root': '/data/LC09_L1TP_017030_20240420_20240426_02_T1'}
)

# NDVI-based emissivity + LST products
emiss_result = wbe.remote_sensing.thermal_emissivity.ndvi_based_emissivity(
    red_input=red,
    nir_input=nir,
    output='emissivity.tif'
)

lst_sc_result = wbe.remote_sensing.thermal_emissivity.land_surface_temperature_single_channel(
    thermal_input=wbe.read_raster('LC09_B10.TIF'),
    output='lst_single_channel.tif',
    options={'sensor_bundle_root': '/data/LC09_L1TP_017030_20240420_20240426_02_T1'}
)

lst_sw_result = wbe.remote_sensing.thermal_emissivity.land_surface_temperature_split_window(
    thermal1_input=wbe.read_raster('LC09_B10.TIF'),
    thermal2_input=wbe.read_raster('LC09_B11.TIF'),
    output='lst_split_window.tif',
    options={'emissivity_mean_constant': 0.98, 'emissivity_delta_constant': 0.0}
)

Spectral Analytics and PolSAR Decomposition

The new spectral analytics subcategory covers endmember-driven and denoising workflows:

sam_result = wbe.remote_sensing.spectral_analytics.spectral_angle_mapper(
    inputs=[blue, green, red, nir],
    output='sam_classes.tif',
    options={
        'endmembers': [
            {'name': 'water', 'values': [0.03, 0.02, 0.01, 0.00]},
            {'name': 'veg', 'values': [0.05, 0.10, 0.06, 0.40]}
        ],
        'output_angle': 'sam_angle.tif'
    }
)

cont_result = wbe.remote_sensing.spectral_analytics.continuum_removal(
    inputs=[wbe.read_raster('hyp_b1.tif'), wbe.read_raster('hyp_b2.tif'), wbe.read_raster('hyp_b3.tif')],
    output='continuum_removed.tif',
    options={'wavelengths': [450.0, 550.0, 650.0]}
)

unmix_result = wbe.remote_sensing.spectral_analytics.linear_spectral_unmixing(
    inputs=[blue, green, red, nir],
    output='unmix_frac.tif',
    options={
        'endmembers': [
            {'name': 'soil', 'values': [0.18, 0.20, 0.22, 0.24]},
            {'name': 'veg', 'values': [0.05, 0.09, 0.06, 0.40]}
        ],
        'output_residual': 'unmix_residual.tif'
    }
)

mnf_result = wbe.remote_sensing.spectral_analytics.minimum_noise_fraction(
    inputs=[blue, green, red, nir],
    output='mnf_components.tif',
    options={'num_components': 3, 'output_inverse': 'mnf_inverse.tif'}
)

lib_result = wbe.remote_sensing.spectral_analytics.spectral_library_matching(
    inputs=[blue, green, red, nir],
    output='lib_class.tif',
    options={
        'metric': 'sam',
        'library': [
            {'name': 'water', 'values': [0.03, 0.02, 0.01, 0.00]},
            {'name': 'soil', 'values': [0.18, 0.20, 0.22, 0.24]}
        ],
        'output_score': 'lib_score.tif'
    }
)

# SAR decomposition tools are available under remote_sensing.sar
cp_result = wbe.remote_sensing.sar.cloude_pottier_decomposition(
    inputs=[wbe.read_raster('t11.tif'), wbe.read_raster('t22.tif'), wbe.read_raster('t33.tif')],
    output='cloude_pottier_haa.tif',
    options={'matrix_format': 'diag3'}
)

fd_result = wbe.remote_sensing.sar.freeman_durden_decomposition(
    inputs=[wbe.read_raster('c11.tif'), wbe.read_raster('c22.tif'), wbe.read_raster('c33.tif')],
    output='freeman_durden.tif',
    options={'matrix_format': 'diag3', 'output_clip_mask': 'freeman_clip.tif'}
)

Water Extraction and River Mapping

Combining NDWI thresholding with morphological post-processing extracts water bodies:

# Threshold MNDWI — water pixels where mndwi > 0
water = wbe.raster.general.raster_calculator("if('mndwi' > 0.0, 1.0, nodata)", [mndwi])

# Remove small spurious water patches
water_clean = wbe.raster.general.sieve(water, threshold=50)

# Remove islands in water polygons
water_filled = wbe.conversion.raster_vector_conversion.remove_raster_polygon_holes(water_clean, threshold=100)

# Extract river centrelines from the water raster
river_lines = wbe.streams.network_extraction.river_centerlines(water_filled, min_length=5, search_radius=9)
wbe.write_vector(river_lines, 'river_centerlines.shp')

Image Correlation and Regression

WbW-Py supports several image correlation and regression tools useful for sensor cross-calibration, quality control, and change analysis:

# Pearson correlation matrix between all bands
wbe.raster.general.image_correlation(bands, output_html_file='correlation_matrix.html')

# Spatial autocorrelation (Moran's I) per band
wbe.raster.general.image_autocorrelation(bands, contiguity='Rooks', output_html_file='autocorr.html')

# Neighbourhood correlation analysis between two images
wbe.raster.local_neighborhood.image_correlation_neighbourhood_analysis(
    img1=ndvi_t1, img2=ndvi_t2,
    filter_size=11,
    output_html_file='neighbourhood_corr.html'
)

# Simple linear regression of one image on another
slope, intercept, r2 = wbe.raster.general.image_regression(img1=ndvi_t1, img2=ndvi_t2,
                                              output_html_file='regression.html')

WbW-Pro Spotlight: In-Season Crop Stress Intervention Planning

  • Problem: Turn in-season crop stress signals into actionable intervention priorities.
  • Tool: in_season_crop_stress_intervention_planning
  • Typical inputs: NDVI raster, canopy-temperature raster, soil-moisture raster.
  • Typical outputs: Intervention-priority and intervention-class products with summary reporting.
import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

result = wbe.run_tool(
    'in_season_crop_stress_intervention_planning',
    {
        'ndvi': 'ndvi_latest.tif',
        'canopy_temperature': 'lst_latest.tif',
        'soil_moisture': 'soil_moisture_latest.tif',
        'output_prefix': 'field_07_stress'
    }
)
print(result)

Note: This workflow requires a WbEnvironment initialized with a valid Pro licence.


Complete Land-Cover Classification Workflow

The following end-to-end example uses a sensor bundle for ingestion and a random-forest classifier for land-cover mapping:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.verbose = True

# 1. Open scene as a bundle — works with S2, Landsat 9, PlanetScope, etc.
bundle = wbe.read_bundle('/data/S2B_MSIL2A_20240601T105619_N0510_R094_T32TPT.SAFE')
print(f"Family: {bundle.family}, tile: {bundle.tile_id()}, "
      f"clouds: {bundle.cloud_cover_percent():.1f}%")

# Skip scenes with excessive cloud cover
if bundle.cloud_cover_percent() > 20.0:
    raise RuntimeError("Too cloudy for classification")

# 2. Read bands by key (family-agnostic)
blue  = bundle.read_band('B02')
green = bundle.read_band('B03')
red   = bundle.read_band('B04')
nir   = bundle.read_band('B08')
swir1 = wbe.remote_sensing.enhancement_contrast.resample(bundle.read_band('B11'), base_raster=red, method='bilinear')
swir2 = wbe.remote_sensing.enhancement_contrast.resample(bundle.read_band('B12'), base_raster=red, method='bilinear')
bands = [blue, green, red, nir, swir1, swir2]

# 3. Mask clouds using SCL
scl = bundle.read_qa_layer('SCL')
cloud_mask = wbe.raster.general.raster_calculator(
    "if('scl' == 3 or 'scl' == 8 or 'scl' == 9 or 'scl' == 10, 1.0, 0.0)", [scl]
)

# 4. Compute indices
ndvi  = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(nir, red)
mndwi = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(green, swir1)
nbr   = wbe.remote_sensing.enhancement_contrast.normalized_difference_index(nir, swir2)

# 5. Build PCA decorrelation on 6 spectral bands
pc_rasters = wbe.raster.general.principal_component_analysis(
    input_rasters=bands,
    output_html_file='pca.html',
    num_comp=4,
    standardize=True
)

# 6. Combine spectral bands + indices + PCs into feature stack
feature_stack = bands + [ndvi, mndwi, nbr] + pc_rasters

# 7. Evaluate training separability
training = wbe.read_vector('training_polygons.shp')
wbe.remote_sensing.classification.evaluate_training_sites(feature_stack, training, 'CLASS', 'separability.html')

# 8. Train random forest
rf_model_path = wbe.raster.general.random_forest_classification_fit(
    input_rasters=feature_stack,
    training_data=training,
    class_field_name='CLASS',
    n_trees=500,
    test_proportion=0.25
)

# 9. Predict
classified = wbe.raster.general.random_forest_classification_predict(feature_stack, rf_model_path)

# 10. Generalise
classified_clean = wbe.remote_sensing.classification.generalize_classified_raster(classified, min_class_size=9)
classified_clean = wbe.conversion.raster_vector_conversion.remove_raster_polygon_holes(classified_clean, threshold=25)

# 11. Save and assess accuracy
wbe.write_raster(classified_clean, 'classified_final.tif', compress=True)
wbe.raster.general.kappa_index(classified_clean,
                wbe.read_raster('validation_reference.tif'),
                'accuracy_report.html')

# 12. Save a quick-look composite for QC
bundle.true_colour_composite(wbe, output_path='quicklook_truecolour.tif')

print('Land-cover classification complete.')

Tips for Effective Remote Sensing Workflows

Tips

  • Use bundles for scene-level ingestion: wbe.read_bundle() eliminates hardcoded band filenames and works identically across Sentinel-2, Landsat, PlanetScope, and other supported families.
  • Screen cloud cover before processing: Check bundle.cloud_cover_percent() before loading all bands to skip unusable scenes early in a batch workflow.
  • Atmospheric correction is iterative: Raw digital numbers and even surface reflectance products may still carry illumination and atmospheric artefacts. Histogram matching across scenes is a simple relative normalisation that works well when no reference spectrum is available.
  • Align band resolution before stacking: Sentinel-2 delivers 10 m (Blue, Green, Red, NIR) and 20 m (Red Edge, SWIR) bands. Upscale the 20 m bands to 10 m using bilinear resampling before combining them in a feature stack.
  • Always mask clouds and cloud shadows: Use quality bands (Sentinel-2 SCL or Landsat QA_PIXEL) and apply bitwise tests via raster_calculator() — e.g. "('qa' & 0b1000) != 0" — to isolate valid pixels.
  • Balance training data: Training datasets often over-represent dominant classes (e.g., forest) relative to rare classes (e.g., wetland). Sample training polygons proportional to expected class area, or oversample rare classes to improve model accuracy.
  • Check spectral separability: If the evaluate_training_sites report shows Jeffries-Matusita distance < 1.5 between any two classes, consider merging classes or collecting more spectrally diverse training polygons.
  • Use time-series techniques for change detection: Multi-date classifications can show spurious change due to atmospheric variation. Spectral indices are more robust; consider computing NDVI or NDWI time series and detecting change directly in index space.
  • Memory is your bottleneck: Large multispectral stacks fill RAM quickly. Use read_raster_band_by_band() or out-of-memory processing for scenes > 1 GB.

Raster Analysis

Raster data are the backbone of most geospatial analysis workflows. They encode continuous or categorical phenomena as regular grids of cell values, allowing mathematical, statistical, and spatial operations to be applied efficiently across an entire landscape. Whitebox Workflows for Python (WbW-Py) provides an extensive raster processing toolkit covering basic arithmetic, focal and zonal statistics, reclassification, resampling, interpolation, proximity analysis, morphological operations, and raster-to-vector conversion.


Core Concepts

Raster analysis requires understanding these fundamental terms:

  • Cell (pixel): The smallest unit of a raster. Each cell stores a single value (integer or floating-point) and has a uniform spatial extent (e.g. 10 m × 10 m).
  • Data type: Integer (Int8, Int16, Int32) for categorical data; Float32 or Float64 for continuous measurements. Data type affects precision, file size, and computation speed.
  • NoData value: Sentinel value representing missing or invalid data (e.g. -9999 or NaN). Critical for masking water, clouds, or invalid measurements in focal operations.
  • Spatial reference (CRS): Coordinate system and projection. Mismatched CRS between rasters causes silent misalignment; always verify before overlay operations.
  • Extent: The bounding box (xmin, ymin, xmax, ymax) of the raster in real-world coordinates.
  • Cell size (resolution): Cell width and height in map units. Coarser resolution is faster but loses detail; finer resolution requires more memory and computation.
  • Focal operation: Uses neighbourhood values (e.g. 3×3 kernel) to compute output. Examples: moving average, Sobel edge detection, local extrema.
  • Zonal operation: Aggregates grid values by zone (polygon or categorical layer). Examples: mean by land-cover class, sum by administrative boundary.
  • Reclassification: Reassigning cell values according to lookup rules. Common for categorizing continuous data (e.g. slope classes) or remapping land-cover codes.
  • Resampling: Changing cell size or alignment. Methods: nearest-neighbour (preserves categories), bilinear (smooth), cubic (smoother).

Reading and Writing Rasters

Every raster workflow begins with reading data into memory:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/rasters'
wbe.verbose = True

dem = wbe.read_raster('dem.tif')
landcover = wbe.read_raster('landcover.tif')

# Read multiple files at once — returns a list
[slope_r, aspect_r, curvature_r] = wbe.read_rasters('slope.tif',
                                                      'aspect.tif',
                                                      'curvature.tif')

Write results with optional LZW compression (recommended for floating-point grids):

wbe.write_raster(dem, 'dem_processed.tif', compress=True)

Printing GeoTIFF Metadata

Inspect the spatial reference and encoding of any GeoTIFF:

wbe.raster.general.print_geotiff_tags(dem)

Creating New Rasters

Use new_raster() or new_raster_from_base_raster() to create blank grids for accumulation or custom calculations:

# Create a raster with the same extent and resolution as the DEM, filled with 0
output = wbe.conversion.raster_vector_conversion.new_raster_from_base_raster(base=dem, initial_value=0.0)

# Iterate cell-by-cell (illustrative; use raster_calculator for large grids)
for row in range(dem.configs.rows):
    for col in range(dem.configs.columns):
        val = dem[row, col]
        if val != dem.configs.nodata:
            output[row, col] = val * 0.001  # convert mm to m

For most cell-by-cell transforms, raster_calculator() is many times faster because it operates in compiled Rust without Python loop overhead.


Raster Calculator

raster_calculator() evaluates an expression string against one or more input rasters. Rasters are referenced by quoted variable names whose order must match the input_rasters list:

# Scale DEM from centimetres to metres
dem_m = wbe.raster.general.raster_calculator("'dem' / 100.0", [dem])

# Compute HAND (height above nearest drainage) from DEM and stream mask
hand_expr = "if('stream' > 0.0, 0.0, 'dem' - 'stream_elev')"
hand = wbe.raster.general.raster_calculator(hand_expr, [stream_raster, dem, stream_elev])

The expression supports:

  • Arithmetic operators: +, -, *, /, ^ (power), % (modulo)
  • Comparison operators: <, >, <=, >=, ==, !=
  • Logical operators: &&, ||, !
  • Mathematical functions: sqrt(), abs(), ln(), log(), exp(), sin(), cos(), tan(), atan(), atan2()
  • Conditional expression: if(condition, true_value, false_value)
  • Special tokens: nodata, null, rows, columns, row, column, cellsize, north, south, east, west

Practical Examples

# Mask out NoData and values below sea level
masked = wbe.raster.general.raster_calculator(
    "if('dem' == nodata || 'dem' < 0.0, nodata, 'dem')",
    [dem]
)

# Compute normalised slope (0–1)
slope = wbe.terrain.derivatives.slope(dem)
slope_norm = wbe.raster.general.raster_calculator(
    "'slope' / maxvalue",
    [slope]
)

# Create binary mask for steep slopes (>30°)
steep = wbe.raster.general.raster_calculator("if('slope' > 30.0, 1.0, 0.0)", [slope])

Reclassification

Reclassification converts continuous values into categorical classes, or remaps existing category codes.

Manual Reclassification

# reclass() takes new_value, min, max triplets
# Format: [[new_val, min_exclusive, max_inclusive], ...]
# Reclassify slope into five morphology classes
slope_class = wbe.raster.reclass_mask.reclass(
    raster=slope,
    reclass_vals=[
        [1, 0, 5],      # flat: 0–5°
        [2, 5, 15],     # gentle: 5–15°
        [3, 15, 30],    # moderate: 15–30°
        [4, 30, 45],    # steep: 30–45°
        [5, 45, 90],    # very steep: >45°
    ]
)
wbe.write_raster(slope_class, 'slope_classes.tif')

Equal-Interval Reclassification

# Automatically divide the value range into n equal-width intervals
dem_classes = wbe.raster.reclass_mask.reclass_equal_interval(dem, num_intervals=10)
wbe.write_raster(dem_classes, 'dem_equal_interval.tif')

Set NoData Values

# Convert all pixels equal to -9999 to NoData
corrected = wbe.conversion.raster_vector_conversion.set_nodata_value(dem, back_value=-9999.0)

# Convert NoData back to zero (useful for accumulation grids)
zero_bg = wbe.conversion.raster_vector_conversion.convert_nodata_to_zero(dem)

Focal (Neighbourhood) Statistics

Focal statistics compute a statistic within a moving window centred on each cell, producing a smoothed or derivative surface.

Filter Operations

# Mean filter (low-pass smoothing)
dem_smooth = wbe.remote_sensing.filters.mean_filter(dem, filter_size_x=5, filter_size_y=5)

# Gaussian filter — weighted mean using Gaussian kernel
dem_gauss = wbe.remote_sensing.filters.gaussian_filter(dem, sigma=2.0)

# Median filter — robust against outliers
dem_median = wbe.remote_sensing.filters.median_filter(dem, filter_size_x=5, filter_size_y=5)

# Feature-preserving smoothing — preserves ridges and channels
dem_fp = wbe.terrain.general.feature_preserving_smoothing(dem, filter_size=11,
                                           normal_diff_threshold=30.0)

# Standard deviation filter — highlights textural variation
sd_texture = wbe.remote_sensing.filters.standard_deviation_filter(dem, filter_size_x=9, filter_size_y=9)

# Range filter — local elevation range (micro-roughness)
local_range = wbe.remote_sensing.filters.range_filter(dem, filter_size_x=9, filter_size_y=9)

# Percentile filter — local quantile (robust position index)
ep = wbe.remote_sensing.filters.percentile_filter(dem, filter_size_x=11, filter_size_y=11)

Diversity and Majority Filters

# Count the number of unique values in a neighbourhood (for categorical rasters)
diversity = wbe.remote_sensing.filters.diversity_filter(landcover, filter_size_x=7, filter_size_y=7)

# Majority filter — replace each cell with the most frequent class in neighbourhood
smoothed_lc = wbe.remote_sensing.filters.majority_filter(landcover, filter_size_x=5, filter_size_y=5)

Morphological Filters (Binary/Raster Objects)

Morphological operations on raster objects (connected foreground regions) are essential for post-classification cleanup.

# Dilation — grow foreground by one cell in each direction
dilated = wbe.remote_sensing.filters.closing(binary_raster, filter_size_x=3, filter_size_y=3)

# Erosion — shrink foreground
eroded = wbe.remote_sensing.filters.opening(binary_raster, filter_size_x=3, filter_size_y=3)

# Top-hat transform — isolates bright or dark features within a local window
tophat_white = wbe.remote_sensing.filters.tophat_transform(dem, filter_size_x=21, filter_size_y=21,
                                    variant='white')  # bright features above background
tophat_black = wbe.remote_sensing.filters.tophat_transform(dem, filter_size_x=21, filter_size_y=21,
                                    variant='black')  # dark depressions below background

Summary and Zonal Statistics

Global Summary Statistics

wbe.raster.general.raster_summary_stats(dem)  # prints count, mean, std, min, max, range to console

Histogram

wbe.raster.general.raster_histogram(dem, output_html_file='dem_histogram.html')

Zonal Statistics

Zonal statistics compute per-zone summary metrics for one raster given a second raster that defines zones:

# Compute mean, St. dev., min, max of the DEM within each land-cover class
zonal_stats = wbe.raster.general.zonal_statistics(
    raster=dem,
    zones=landcover,
    stat='mean',           # 'mean', 'min', 'max', 'std', 'var', 'count', 'sum'
    cell_size_is_area=False
)
wbe.write_raster(zonal_stats, 'mean_elevation_per_class.tif')

Percent Overlays

# Fraction of neighbourhood cells below/above/equal to focal cell value
pct_less  = wbe.raster.overlay_math.percent_less_than(dem, filter_size_x=9, filter_size_y=9)
pct_great = wbe.raster.overlay_math.percent_greater_than(dem, filter_size_x=9, filter_size_y=9)
pct_equal = wbe.raster.overlay_math.percent_equal_to(dem, filter_size_x=9, filter_size_y=9)

Unique-Value Enumeration

wbe.raster.general.list_unique_values_raster(
    landcover,
    output_path='landcover_unique_values.csv',
)  # writes category counts to CSV and returns report JSON

Overlay Operations

Overlay operations combine multiple rasters into a single output, handling conflicting values with a defined rule.

# Sum overlay — add all values at each cell
sum_result = wbe.raster.overlay_math.sum_overlay(rasters=[r1, r2, r3])

# Average overlay — mean of all rasters
avg = wbe.raster.overlay_math.average_overlay(rasters=[r1, r2, r3])

# Maximum overlay — highest value among all rasters
max_r = wbe.raster.overlay_math.max_overlay(rasters=[r1, r2, r3])

# Pick from a list based on an index raster (values 1..N index which raster to use)
selected = wbe.raster.overlay_math.pick_from_list(index=index_raster, rasters=[r1, r2, r3])

# Weighted sum — apply a weight to each contributing raster
weighted = wbe.raster.overlay_math.weighted_sum(rasters=[r1, r2], weights=[0.6, 0.4])

Multi-Criteria Weighted Overlay

weighted_overlay() normalises each factor raster, applies class weights, and sums the products — a standard MCE technique in site suitability analysis:

# Suitability analysis: each raster already reclassified 1–5 scale
suitability = wbe.raster.overlay_math.weighted_overlay(
    factor_rasters=[slope_suitability, aspect_suitability, soil_suitability],
    weights=[0.4, 0.2, 0.4],
    scale_max=5.0,
    cost_factors=[False, False, False]   # True = cost (lower = better)
)
wbe.write_raster(suitability, 'suitability.tif')

Aggregation and Resampling

Aggregate Raster

Reduce resolution by a specified factor using a summary statistic. Useful for multi-scale analyses:

# Aggregate to 5× coarser resolution using mean
coarse_dem = wbe.raster.general.aggregate_raster(dem, agg_factor=5, type='mean')

# Other types: 'sum', 'max', 'min'
coarse_lc = wbe.raster.general.aggregate_raster(landcover, agg_factor=5, type='majority')

Resample

Resample a raster to match the grid of another raster or to a specified cell size. Supports several interpolation methods:

# Bilinear interpolation for continuous data
resampled = wbe.remote_sensing.enhancement_contrast.resample(source_raster, base_raster=dem, method='bilinear')

# Nearest neighbour — preserves discrete categories
resampled_cat = wbe.remote_sensing.enhancement_contrast.resample(landcover, base_raster=dem, method='nn')

# Cubic convolution — smooth surfaces
resampled_cc = wbe.remote_sensing.enhancement_contrast.resample(dem, base_raster=fine_base, method='cc')

Proximity Analysis

Proximity tools compute distances, directions, and allocations based on the locations of source cells.

Euclidean Distance and Direction

# Distance of every cell from the nearest stream cell
streams_raster = wbe.streams.network_extraction.rasterize_streams(streams_vector, base_raster=dem)
dist_to_streams = wbe.raster.distance_cost.euclidean_distance(streams_raster)
wbe.write_raster(dist_to_streams, 'dist_to_streams.tif')

# Which stream cell is each cell nearest to?
allocated = wbe.raster.distance_cost.euclidean_allocation(streams_raster)

Cost-Distance Analysis

Cost-distance analysis finds the least-cost path across a landscape where movement is not uniform. The cost raster encodes the cost of traversing one cell:

# Build cost and source layers
cost_surface = wbe.raster.general.raster_calculator(
    "'slope' * 0.1 + 'landcover_cost'",
    [slope, landcover_cost]
)
# Accumulate cost from source points
cost_dist = wbe.raster.distance_cost.cost_distance(source_raster, cost_surface)
wbe.write_raster(cost_dist, 'cost_distance.tif')

# Allocate each cell to the nearest source by cost
cost_alloc = wbe.raster.distance_cost.cost_allocation(source_raster, cost_distance=cost_dist)

# Trace the optimal path between two points
cost_path = wbe.raster.distance_cost.cost_pathway(source=start_raster, destination=end_raster,
                              cost_surface=cost_surface)
wbe.write_raster(cost_path, 'optimal_path.tif')

Buffer Distance

Create a buffer zone around all features in a raster at a specified distance:

buffered = wbe.raster.distance_cost.buffer_raster(streams_raster, size=100.0, gridcells=False)
wbe.write_raster(buffered, 'stream_buffer_100m.tif')

Raster Object Analysis

The clump tool identifies connected groups of cells with the same value and assigns each group a unique identifier. This is analogous to spatial dissolve on a raster:

# Identify connected patches in the land-cover raster
clumped = wbe.raster.general.clump(landcover, diag=True, zero_back=True)

# Filter out small patches (<10 cells) from a binary mask
large_patches = wbe.raster.general.filter_raster_features_by_area(binary_mask,
                                                     threshold=10,
                                                     background_val=0)

# Shape complexity of each raster object
complexity = wbe.raster.general.shape_complexity_index_raster(clumped)

# Raster area per clump
clump_area = wbe.raster.general.raster_area(clumped, out_text=False)

# Highest or lowest position among several rasters
highest = wbe.raster.overlay_math.highest_position(rasters=[r1, r2, r3])   # which raster has max value?
lowest  = wbe.raster.overlay_math.lowest_position(rasters=[r1, r2, r3])

Raster-to-Vector Conversion

# Convert raster polygons to vector polygons
polygons = wbe.conversion.raster_vector_conversion.raster_to_vector_polygons(landcover)
wbe.write_vector(polygons, 'landcover_polygons.shp')

# Convert raster lines to vector lines
lines = wbe.conversion.raster_vector_conversion.raster_to_vector_lines(stream_raster)
wbe.write_vector(lines, 'stream_lines.shp')

# Convert raster points (non-zero cells) to vector points
pts = wbe.conversion.raster_vector_conversion.raster_to_vector_points(peak_cells)
wbe.write_vector(pts, 'peaks.shp')

Interpolation from Point Clouds

When field observation points or vector point layers represent a surface, interpolate them to a raster:

sample_pts = wbe.read_vector('soil_sample_points.shp')

# Inverse Distance Weighting (IDW)
idw = wbe.raster.general.idw_interpolation(points=sample_pts, field='OM_PCT',
                             cell_size=10.0, radius=250.0, weight=2.0)
wbe.write_raster(idw, 'soil_om_idw.tif')

# Natural Neighbour (Sibson) interpolation
nn = wbe.raster.local_neighborhood.natural_neighbour_interpolation(points=sample_pts, field='OM_PCT',
                                          cell_size=10.0)
wbe.write_raster(nn, 'soil_om_nn.tif')

# Radial Basis Function interpolation
rbf = wbe.raster.general.radial_basis_function_interpolation(points=sample_pts, field='OM_PCT',
                                               cell_size=10.0, radius=250.0)
wbe.write_raster(rbf, 'soil_om_rbf.tif')

# TIN interpolation from vector points
tin = wbe.raster.general.tin_interpolation(points=sample_pts, field_name='OM_PCT', cell_size=10.0)
wbe.write_raster(tin, 'soil_om_tin.tif')

Geostatistical Simulation

The turning-bands simulation creates spatially autocorrelated random fields — useful for uncertainty analysis and Monte Carlo simulation of landscape processes:

sim = wbe.raster.general.turning_bands_simulation(
    base_raster=dem,
    range=500.0,       # autocorrelation range (metres)
    sill_height=1.0,   # sill variance
    num_lines=1000
)
wbe.write_raster(sim, 'random_field_simulated.tif')

Statistical Tests on Raster Distributions

# Test whether a raster's values are Gaussian
wbe.raster.general.ks_normality_test(dem, output_html_file='normality_test.html', num_samples=5000)

# Paired-sample t-test to compare two rasters cell-by-cell
wbe.raster.general.paired_sample_t_test(dem, dem_lidar,
                          output_html_file='ttest.html', num_samples=5000)

# Two-sample KS test for distributional differences
wbe.raster.general.two_sample_ks_test(dem, dem_lidar,
                        output_html_file='ks_test.html', num_samples=5000)

# Wilcoxon signed-rank test (non-parametric alternative to t-test)
wbe.raster.general.wilcoxon_signed_rank_test(dem, dem_lidar,
                               output_html_file='wilcoxon.html', num_samples=5000)

Contour Generation

# Contours from DEM raster
contours = wbe.vector.sampling_gridding.contours_from_raster(dem, contour_interval=5.0, base_contour=0.0,
                                     smooth=9, tolerance=5.0)
wbe.write_vector(contours, 'contours_5m.shp')

WbW-Pro Spotlight: Field Trafficability and Operation Planning

  • Problem: Plan equipment timing and field access under variable moisture and weather conditions.
  • Tool: field_trafficability_and_operation_planning
  • Typical inputs: DEM, normalized soil-moisture raster, optional rainfall-risk raster.
  • Typical outputs: Trafficability score raster, operation-class raster, and summary outputs.
import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

result = wbe.run_tool(
    'field_trafficability_and_operation_planning',
    {
        'dem': 'field_dem.tif',
        'soil_moisture': 'soil_moisture_norm.tif',
        'rainfall_forecast': 'rainfall_risk_norm.tif',
        'output_prefix': 'field_12_trafficability'
    }
)
print(result)

Note: This workflow requires a WbEnvironment initialized with a valid Pro licence.


Complete Raster Analysis Pipeline

The following script demonstrates a typical DEM-derived terrain model workflow including correction, classification, and proximity analysis:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/analysis'
wbe.verbose = True
wbe.max_procs = -1  # use all available cores

# 1. Load raw DEM and correct NoData encoding
dem = wbe.read_raster('raw_dem.tif')
dem = wbe.conversion.raster_vector_conversion.set_nodata_value(dem, back_value=-9999.0)
dem = wbe.terrain.general.fill_missing_data(dem, filter_size=11)

# 2. Smooth to suppress sensor noise
dem_smooth = wbe.terrain.general.feature_preserving_smoothing(dem, filter_size=11,
                                               normal_diff_threshold=30.0,
                                               iterations=3)

# 3. Derive primary terrain attributes
slope      = wbe.terrain.derivatives.slope(dem_smooth, units='degrees')
aspect     = wbe.terrain.derivatives.aspect(dem_smooth)
tpi        = wbe.terrain.general.deviation_from_mean_elevation(dem_smooth, filter_size_x=21,
                                               filter_size_y=21)
relrough   = wbe.terrain.multiscale_signatures.multiscale_roughness(dem_smooth, min_scale=1, max_scale=50, step=2)

# 4. Classify slope into stability classes
slope_class = wbe.raster.reclass_mask.reclass(slope, reclass_vals=[
    [1, 0, 10],   # low risk
    [2, 10, 25],  # moderate risk
    [3, 25, 90],  # high risk
])

# 5. Compute Euclidean distance from streams
streams = wbe.read_raster('streams.tif')
dist_streams = wbe.raster.distance_cost.euclidean_distance(streams)

# 6. Site suitability overlay
# Normalise all factors to a 1–5 scale first ...
suitability = wbe.raster.overlay_math.weighted_overlay(
    factor_rasters=[slope_class, dist_streams_class],
    weights=[0.7, 0.3],
    scale_max=3.0
)

wbe.write_raster(suitability, 'site_suitability.tif', compress=True)
print('Raster analysis pipeline complete.')

Tips

  • Choose your data type: Use integers for categorical data (land cover, classifications) to minimize file size and computation time. Use floating-point (Float32 or Float64) only for continuous measurements (elevation, temperature, probability).
  • Set NoData explicitly: Ensure your source rasters carry a valid NoData value. Missing NoData declarations can corrupt statistics and focal operations by including invalid pixels as zeros or false elevations.
  • Compress carefully: LZW and DEFLATE compression work well for most data; avoid if you need rapid random access to interior tiles. Use COMPRESS=JPEG for photographic data only (lossy, unsuitable for analysis).
  • Focal operations require buffering: Cells at raster edges cannot compute full neighbourhoods. Use expand() or accept edge effects; never assume borders are valid in derivative rasters.
  • Zonal statistics are only as good as your zones: Ensure zone boundaries are topologically clean (no overlaps, no gaps). Overlapping zones cause double-counting; gaps cause NoData regions in output.
  • Reclassification is fast but risky: Always validate output distributions (histogram) after reclassification. Off-by-one errors in class boundaries can silently produce wrong land-cover or suitability classes.
  • Memory is the constraint for large rasters: Tiles > 2 GB require out-of-core or streaming processing. Use read_by_block() for large files; avoid loading entire rasters into memory if they exceed available RAM.
  • Upsampling introduces artifacts: Never upsample (finer resolution) without a valid interpolation method. Nearest-neighbour upsampling creates blocky artefacts; bilinear is smoother but may violate data range (e.g. probability values > 1.0).

Vector Analysis

Vector data are the primary format for discrete geographic features — points, lines, and polygons representing everything from sample locations and road networks to property parcels and watershed boundaries. Whitebox Workflows for Python (WbW-Py) provides a comprehensive set of vector analysis tools covering attribute management, geometric measurement, spatial overlay, proximity analysis, topology repair, shape analysis, and vector-to-raster conversion.


Core Concepts

Vector analysis depends on understanding these core concepts:

  • Feature geometry: Points (single coordinate pairs), lines (ordered sequences of coordinate pairs), and polygons (rings of coordinates forming closed boundaries). Each feature type supports different analyses.
  • Topology: The spatial relationships between features (adjacency, containment, intersection). Topological errors (overshoots, undershoots, self-intersections) corrupt overlay operations and topology queries.
  • Attribute table: The database associated with each feature layer, carrying descriptive fields and values. Attribute queries filter features; joins link external tables.
  • Spatial index: Internal index structure (R-tree or quadtree) enabling fast spatial queries. Used by intersection, containment, and proximity operations. Always build spatial indices on frequently queries layers.
  • Envelope (bounding box): The minimum rectangular boundary of a feature or layer; used for quick spatial culling before geometry tests.
  • Buffer: A polygon created at a fixed distance around a feature. Buffers model proximity zones and are fundamental to distance-based analysis.
  • Overlay (intersection, union, difference): Combining two polygon layers to create a new layer. Union merges boundaries; intersection keeps overlapping area only; difference removes one layer from another.
  • Dissolve (aggregation): Merging adjacent features with identical attribute values, creating larger aggregate features. Reduces feature count and simplifies geometry.
  • Spatial join: Associating features from one layer with features from another based on spatial relationship (overlap, containment, proximity). Assigns attributes across layers.
  • Proximity analysis: Finding nearest features, distances, or connectivity. Foundation for network analysis, market analysis, and accessibility studies.

Reading and Writing Vectors

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/vectors'

# Read a single vector
watersheds = wbe.read_vector('watersheds.shp')
streams    = wbe.read_vector('streams.shp')
outlets    = wbe.read_vector('outlets.shp')

# Read multiple at once
[roads, buildings, parks] = wbe.read_vectors('roads.shp', 'buildings.shp', 'parks.shp')

# Write results
wbe.write_vector(watersheds, 'watersheds_processed.shp')

Attribute Table Management

Adding and Removing Fields

# Add a new numeric field
watersheds = wbe.vector.attribute_analysis.add_field(watersheds, field_name='AREA_KM2', field_type='Float')

# Rename a field
watersheds = wbe.vector.attribute_analysis.rename_field(watersheds,
                               old_field_name='OBJECTID',
                               new_field_name='WS_ID')

# Delete a field
watersheds = wbe.vector.attribute_analysis.delete_field(watersheds, field_name='TEMP_FIELD')

# Reset the entire attribute table to only an FID column
watersheds = wbe.conversion.vector_table_io.reinitialize_attribute_table(watersheds)

Filtering by Attribute

# Select features where upstream area exceeds 50 km²
large_ws = wbe.vector.attribute_analysis.extract_by_attribute(watersheds,
                                     field_name='AREA_KM2',
                                     operator='>',
                                     value=50.0)
wbe.write_vector(large_ws, 'large_watersheds.shp')

Joining Tables

# Merge a CSV attribute table into a vector by a shared key field
import csv
merged = wbe.conversion.vector_table_io.merge_table_with_csv(watersheds,
                                   csv_file='watershed_stats.csv',
                                   join_field='WS_ID')

Exporting the Attribute Table

wbe.conversion.vector_table_io.export_table_to_csv(watersheds, 'watershed_attributes.csv')

Listing Unique Values

wbe.vector.attribute_analysis.list_unique_values(
    watersheds,
    field_name='REGION',
    output_path='watersheds_region_unique_values.csv',
)

Geometric Measurement

Polygon Area and Perimeter

# Compute polygon area (adds AREA field to attribute table)
watersheds = wbe.vector.shape_metrics.polygon_area(watersheds)

# Compute perimeter (adds PERIMETER field)
watersheds = wbe.vector.shape_metrics.polygon_perimeter(watersheds)

Shape Indices

Shape indices quantify the geometric complexity and elongation of polygon features. They are widely used in ecology (patch metrics), hydrology (watershed form), and urban analysis:

# Compactness ratio — measures how closely a polygon approximates a circle
# Perfectly circular = 1.0; lower values = more elongated
watersheds = wbe.vector.shape_metrics.compactness_ratio(watersheds)

# Elongation ratio — based on minimum bounding box dimensions
watersheds = wbe.vector.shape_metrics.elongation_ratio(watersheds)

# Linearity index — R² of an RMA regression through hull vertices
# Higher values indicate long, narrow linear shapes
watersheds = wbe.vector.shape_metrics.linearity_index(watersheds)

# Related circumscribing circle
watersheds = wbe.vector.shape_metrics.related_circumscribing_circle(watersheds)

# Boundary shape complexity
watersheds = wbe.raster.general.boundary_shape_complexity(watersheds)

# Hole proportion — fraction of polygon area that is holes
watersheds = wbe.vector.shape_metrics.hole_proportion(watersheds)

# Shape complexity (vector)
watersheds = wbe.vector.shape_metrics.shape_complexity_index_vector(watersheds)

# Patch orientation (degrees from north of long axis)
watersheds = wbe.vector.shape_metrics.patch_orientation(watersheds)

# Narrowness index
watersheds = wbe.vector.shape_metrics.narrowness_index(watersheds)

# Radius of gyration (area-weighted centroid distance)
watersheds = wbe.raster.general.radius_of_gyration(watersheds)

Point Coordinate Addition

# Add X, Y (and optionally Z) coordinate columns to a point vector
sample_pts = wbe.conversion.vector_table_io.add_point_coordinates_to_table(sample_pts)

Centroids, Bounding Boxes, and Convex Hulls

# Point centroid of each polygon
centroids = wbe.vector.geometry_processing.centroid_vector(watersheds)
wbe.write_vector(centroids, 'watershed_centroids.shp')

# Minimum bounding box for each polygon
bboxes = wbe.vector.geometry_processing.minimum_bounding_box(watersheds)

# Minimum bounding circle
circles = wbe.vector.geometry_processing.minimum_bounding_circle(watersheds)

# Minimum bounding envelope (overall)
envelope = wbe.vector.geometry_processing.minimum_bounding_envelope(watersheds)

# Minimum convex hull
hull = wbe.vector.geometry_processing.minimum_convex_hull(watersheds)

# Layer footprint (bounding box of entire layer)
footprint = wbe.vector.sampling_gridding.layer_footprint_vector(watersheds)

# Long axis and short axis lines
long_axis  = wbe.vector.shape_metrics.polygon_long_axis(watersheds)
short_axis = wbe.vector.shape_metrics.polygon_short_axis(watersheds)

Smoothing, Simplification, and Geometry Operations

# Smooth vertices by averaging — reduces digitising artefacts
smooth = wbe.vector.geometry_processing.smooth_vectors(streams, filter_size=5)

# Douglas-Peucker line simplification
simplified = wbe.vector.geometry_processing.simplify_features(streams, snap_distance=10.0)

# Split long lines into segments of maximum length
segmented = wbe.vector.geometry_processing.split_vector_lines(streams, segment_length=1000.0)

# Extend line endpoints by a specified distance
extended = wbe.vector.geometry_processing.extend_vector_lines(streams, dist=50.0, extend_type='both')

# Split polygons or lines using another line layer
split_polys = wbe.vector.geometry_processing.split_with_lines(watersheds, split_lines=roads)

# Lines to polygon conversion (close and fill each polyline)
polys_from_lines = wbe.conversion.geometry_topology.lines_to_polygons(outline_lines)

# Polygons to lines (extract boundary lines)
lines_from_polys = wbe.conversion.geometry_topology.polygons_to_lines(watersheds)

# Convert multipart features to singlepart
single = wbe.conversion.geometry_topology.multipart_to_singlepart(watersheds)

# Convert singlepart to multipart by shared attribute value
multi = wbe.conversion.geometry_topology.singlepart_to_multipart(parcels, field_name='OWNER_ID')

# Merge all features in two or more files into one layer
merged_streams = wbe.conversion.vector_table_io.merge_vectors(streams_a, streams_b)

# Clean topology (remove duplicate vertices and degenerate features)
cleaned = wbe.conversion.vector_table_io.clean_vector(streams)

# Remove polygon holes smaller than a threshold
no_holes = wbe.conversion.geometry_topology.remove_polygon_holes(watersheds)

Spatial Overlay

WbW-Py supports the full suite of vector set-theoretic overlay operations:

Clip

Cuts one layer to the extent of another, retaining only features within the clip polygon:

# Clip roads to a study area polygon
roads_clipped = wbe.vector.overlay_analysis.clip(input=roads, clip=study_area)
wbe.write_vector(roads_clipped, 'roads_study_area.shp')

Intersect

Returns the geometric intersection of two layers, keeping the portions where they overlap and combining attributes from both:

soil_in_watershed = wbe.vector.overlay_analysis.intersect(input=soil_polygons, overlay=watershed_boundary,
                                   snap_tolerance=1e-6)
wbe.write_vector(soil_in_watershed, 'soil_in_watershed.shp')

Erase (Difference)

Removes the area of one layer from another:

# Remove urban areas from the vegetation layer
rural_veg = wbe.vector.overlay_analysis.erase(input=vegetation, erase_layer=urban_boundaries)

Union

Combines two polygon layers and divides overlapping areas, retaining all features from both:

combined = wbe.vector.overlay_analysis.union(input=zoning, overlay=flood_zones)
wbe.write_vector(combined, 'zoning_flood_overlay.shp')

Symmetrical Difference

Returns only the non-overlapping portions of each layer:

sym_diff = wbe.vector.overlay_analysis.symmetrical_difference(input=year1_polygons, overlay=year2_polygons)

Dissolve

Merges features that share a common attribute value:

# Merge all polygons of the same land-cover class
dissolved = wbe.vector.overlay_analysis.dissolve(input=landcover_polygons, field_name='CLASS')
wbe.write_vector(dissolved, 'landcover_dissolved.shp')

Proximity and Near Analysis

Euclidean Distance to Nearest Feature

# Find the distance from each sample point to the nearest road
near_result = wbe.vector.overlay_analysis.near(input=sample_pts, feature=roads)
# Adds NEAR_DIST and NEAR_FID fields to sample_pts
wbe.write_vector(near_result, 'samples_near_roads.shp')

Voronoi Diagram (Thiessen Polygons)

Thiessen polygons partition space so every location is assigned to the nearest source point:

voronoi = wbe.vector.sampling_gridding.voronoi_diagram(sample_pts)
wbe.write_vector(voronoi, 'thiessen_polygons.shp')

Convex Hull and Medoid

hull_pts = wbe.vector.geometry_processing.minimum_convex_hull(sample_pts)  # minimum convex hull of point set
med      = wbe.vector.sampling_gridding.medoid(sample_pts)               # geometric median of a set of points

Select by Location

Spatial queries allow selection of features based on their geometric relationship to a second layer:

# Select all stream segments that intersect wetland polygons
streams_in_wetlands = wbe.vector.overlay_analysis.select_by_location(
    input=streams,
    comparison=wetlands,
    geometry_type='intersects'
)
wbe.write_vector(streams_in_wetlands, 'streams_in_wetlands.shp')

Spatial Join

Spatial join transfers attributes from a join layer to an input layer based on spatial proximity or overlap:

# Join soil class to sample points based on the polygon they fall within
pts_with_soil = wbe.vector.overlay_analysis.spatial_join(
    input=sample_pts,
    join_layer=soil_polygons,
    join_type='within',       # 'within', 'intersects', 'nearest'
    strategy='first',         # 'first', 'last', 'count', 'sum', 'mean', 'min', 'max'
    field_name='SOIL_CLASS'
)
wbe.write_vector(pts_with_soil, 'samples_with_soil.shp')

Vector Grids

Create regular grids of vector polygons covering a raster or vector extent. Useful for stratified sampling and landscape analysis at fixed spatial scales:

# Hexagonal grid with resolution based on an existing raster
hex_grid = wbe.vector.sampling_gridding.hexagonal_grid_from_raster_base(dem)
wbe.write_vector(hex_grid, 'hexgrid.shp')

# Rectangular grid
rec_grid = wbe.vector.sampling_gridding.rectangular_grid_from_raster_base(dem)
wbe.write_vector(rec_grid, 'recgrid.shp')

# Hexagonal grid with resolution based on a vector extent
hex_v = wbe.vector.sampling_gridding.hexagonal_grid_from_vector_base(watersheds, width=500.0)

Vector-to-Raster Conversion

# Rasterize polygon layer (burn polygon attribute value into grid cells)
lc_raster = wbe.conversion.raster_vector_conversion.vector_polygons_to_raster(
    input=landcover_polygons,
    field_name='CLASS_ID',
    cell_size=30.0
)
wbe.write_raster(lc_raster, 'landcover_raster.tif')

# Rasterize line layer
roads_raster = wbe.conversion.raster_vector_conversion.vector_lines_to_raster(
    input=roads,
    field_name='FID',
    cell_size=10.0
)

# Rasterize point layer
pts_raster = wbe.conversion.raster_vector_conversion.vector_points_to_raster(
    input=sample_pts,
    field_name='YIELD',
    assign_op='mean',  # 'first', 'last', 'min', 'max', 'sum', 'mean', 'number'
    cell_size=5.0
)

Field Calculator

The field calculator supports SQL-style and expression-style updates for vector attributes, including:

  • searched CASE WHEN ... THEN ... ELSE ... END
  • simple CASE field WHEN value THEN ... END
  • UPDATE ... SET ... [WHERE ...] wrapper syntax
  • SQL operators (=, <>, AND, OR, NOT), plus IS NULL / IS NOT NULL
  • CAST(... AS integer|float|text|boolean)
  • preview-first execution with preview_rows (no output write required)

Use it to create or update a field from existing attributes and geometry variables ($area, $length, $perimeter, centroid coordinates).

# Compute/update SPEED from TYPE using SQL-style CASE
watersheds = wbe.vector.attribute_analysis.field_calculator(
    input=watersheds,
    field='SPEED',
    field_type='integer',
    expression="CASE WHEN TYPE == 'motorway' THEN 100 WHEN TYPE == 'primary' THEN 80 ELSE 60 END",
    overwrite=True,
    output='watersheds_speed.gpkg'
)

# Preview-only evaluation (returns preview payload, omits output write)
preview = wbe.vector.attribute_analysis.field_calculator(
    input=watersheds,
    field='SPEED',
    field_type='integer',
    expression="CASE TYPE WHEN 'motorway' THEN 100 ELSE 60 END",
    overwrite=True,
    preview_rows=10
)

When preview_rows > 0, the tool returns preview records and normalized expression details that can be surfaced in UI workflows before committing final output writes.


Topological Utilities

Repair and Validation

# Snap nearby line endpoints to within a tolerance distance
streams_clean = wbe.streams.network_extraction.repair_stream_vector_topology(streams, snap_distance=1.0)

# Fix dangling arcs (lines that overshoot or undershoot intersections)
fixed = wbe.conversion.geometry_topology.fix_dangling_arcs(streams, snap_distance=1.0)

Line Intersections

# Find all intersection points between two line layers
intersections = wbe.vector.overlay_analysis.line_intersections(roads, rivers)
wbe.write_vector(intersections, 'road_river_crossings.shp')

Extract Nodes

# Extract all vertices of a line layer as points
nodes = wbe.vector.sampling_gridding.extract_nodes(streams)
wbe.write_vector(nodes, 'stream_nodes.shp')

Polygon Topology

# Polygonise a raster — convert raster regions to vector polygons
polys = wbe.vector.geometry_processing.polygonize(classified_raster)
wbe.write_vector(polys, 'class_polygons.shp')

Point Cluster Analysis

# Heat map (kernel density estimation)
density = wbe.raster.general.heat_map(sample_pts, bandwidth=500.0)
wbe.write_raster(density, 'point_density.tif')

# Vector hexagonal binning — count points per hexagon
hex_counts = wbe.vector.sampling_gridding.vector_hex_binning(sample_pts, width=1000.0, orientation='vertical')
wbe.write_vector(hex_counts, 'hex_counts.shp')

WbW-Pro Spotlight: Market Access and Site Intelligence

  • Problem: Rank candidate sites using repeatable network-access and demand logic.
  • Tool: market_access_and_site_intelligence_workflow
  • Typical inputs: Network, existing sites, candidate sites, demand surface, drive-time rings.
  • Typical outputs: Catchment polygons, competitive-overlap layer, candidate-ranking CSV, executive summary JSON.
import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

result = wbe.run_tool(
    'market_access_and_site_intelligence_workflow',
    {
        'network': 'street_network.shp',
        'sites_existing': 'existing_sites.shp',
        'sites_candidates': 'candidate_sites.shp',
        'demand_surface': 'demand_points.shp',
        'ring_costs': [5.0, 10.0, 15.0],
        'catchments_output': 'candidate_catchments.shp',
        'overlap_analysis_output': 'competitive_overlap.shp',
        'candidate_rank_csv': 'candidate_rankings.csv',
        'executive_summary_json': 'market_summary.json'
    }
)
print(result)

Note: This workflow requires a WbEnvironment initialized with a valid Pro licence.


Complete Vector Analysis Workflow

The following script illustrates a full workflow from raw survey points to a clipped, dissolved, and enriched polygon layer:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/vector_analysis'
wbe.verbose = True

# 1. Load layers
parcels       = wbe.read_vector('parcels.shp')
study_boundary = wbe.read_vector('study_boundary.shp')
soil_map      = wbe.read_vector('soil_types.shp')
sample_pts    = wbe.read_vector('sample_points.shp')

# 2. Clip parcels to study boundary
parcels_clip = wbe.vector.overlay_analysis.clip(input=parcels, clip=study_boundary)

# 3. Compute geometric attributes
parcels_clip = wbe.vector.shape_metrics.polygon_area(parcels_clip)
parcels_clip = wbe.vector.shape_metrics.polygon_perimeter(parcels_clip)
parcels_clip = wbe.vector.shape_metrics.compactness_ratio(parcels_clip)

# 4. Spatial join — assign soil type to each parcel
parcels_with_soil = wbe.vector.overlay_analysis.spatial_join(
    input=parcels_clip,
    join_layer=soil_map,
    join_type='intersects',
    strategy='first',
    field_name='SOIL_CODE'
)

# 5. Dissolve by soil code to get soil extents within study area
soil_dissolved = wbe.vector.overlay_analysis.dissolve(input=parcels_with_soil, field_name='SOIL_CODE')
wbe.write_vector(soil_dissolved, 'soil_study_area.shp')

# 6. Spatial join sample points with soil polygons
samples_enriched = wbe.vector.overlay_analysis.spatial_join(
    input=sample_pts,
    join_layer=soil_dissolved,
    join_type='within',
    strategy='first',
    field_name='SOIL_CODE'
)
samples_enriched = wbe.conversion.vector_table_io.add_point_coordinates_to_table(samples_enriched)

# 7. Export for external analysis
wbe.conversion.vector_table_io.export_table_to_csv(samples_enriched, 'samples_with_soil.csv')
print('Vector analysis pipeline complete.')

Tips

  • Always validate topology before analysis: Run check_vector_topology() to detect overshoots, undershoots, self-intersections, and sliver polygons. Topological errors propagate through overlay and spatial join operations.
  • Build spatial indices on large layers: Large datasets (> 10,000 features) benefit from spatial indexing. Use build_spatial_index() explicitly before repeated spatial queries; operations like containment or proximity are fast with indices.
  • Choose your overlay operation carefully: Union retains all boundaries and combines attributes (can create many small slivers). Intersection keeps only overlapping regions. Difference retains Polygon A minus Polygon B. Test on small subsets first.
  • Dissolve reduces feature count and file size: After overlay, dissolve by ownership or category to collapse unnecessary edges. Dissolved layers render faster and are cleaner for publication.
  • Spatial joins are sensitive to alignment: Ensure both input layers use the same CRS and are free of topology errors. Reproject to equal-area projection before computing buffer distances or areas for analysis.
  • Buffer distance and units matter: Buffer distances are in map units (meters, feet, degrees). Use an equal-area projection if precise areas or distances are critical. Negative buffers can collapse small polygons (inset); test with small buffer values first.
  • Attribute table size is a memory constraint: Attribute tables with millions of rows and dozens of fields consume RAM. Export to CSV or database for large tables; work with summaries or samples when memory is limited.
  • Point-in-polygon operations scale with complexity: Containment tests are O(n) per point; on large datasets (> 1 million points), consider spatial index binning or vector-to-raster conversion for speed.

Online Data Downloads

This chapter focuses on downloading vector data directly from online providers into Whitebox workflows. The initial implementation is OpenStreetMap (OSM) via Overpass API using download_osm_vector.

Scope and Current Provider

Current tool:

  • wbe.vector.online_data.download_osm_vector(...)

The tool downloads OSM features within a longitude/latitude bounding box (EPSG:4326), optionally filters by theme, and writes output in any supported vector format based on output extension.

Quick Start

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()

roads = wbe.vector.online_data.download_osm_vector(
    west=-80.54,
    south=43.41,
    east=-80.47,
    north=43.47,
    filter_preset="roads",
    include_points=False,
    include_lines=True,
    include_polygons=False,
)

wbe.write_vector(roads, "kitchener_roads.geojson")

Presets and Filters

Preset classes:

  • all
  • roads
  • buildings
  • water
  • landuse
  • trails
  • parks
  • rail
  • amenities
  • boundaries
  • transit
  • poi

Optional custom filters:

  • filter_key="amenity"
  • filter_key_value="amenity=school"

If custom filters are supplied, they take precedence over preset filtering.

Geometry Controls

Use geometry toggles to reduce result size and parsing overhead:

  • include_points
  • include_lines
  • include_polygons

Typical examples:

  • Road centerlines only: points off, lines on, polygons off
  • Building footprints only: points off, lines off, polygons on

Phase 2 options:

  • split_output_by_geometry=True writes separate files with _points, _lines, and _polygons suffixes.

Caching and Provenance

Use optional caching when iterating on the same AOI/filter query repeatedly:

  • cache_dir=".wbw_cache/osm"
  • cache_ttl_hours=24 (set 0 to disable TTL checks)

Use provenance_output to write a JSON sidecar with endpoint, bbox, filters, feature counts, and cache usage metadata.

roads = wbe.vector.online_data.download_osm_vector(
    west=-80.54,
    south=43.41,
    east=-80.47,
    north=43.47,
    filter_preset="trails",
    include_points=False,
    include_lines=True,
    include_polygons=False,
    split_output_by_geometry=True,
    cache_dir=".wbw_cache/osm",
    cache_ttl_hours=24,
    provenance_output="kitchener_trails_provenance.json",
    output="kitchener_trails.geojson",
)

Projection and Output

Rules:

  • Query extent is interpreted as EPSG:4326 (lon/lat).
  • Set input_extent_epsg to provide west/south/east/north in another CRS (the bbox is transformed to EPSG:4326 before querying Overpass).
  • Output stays EPSG:4326 unless output_epsg is provided.
  • Output format is inferred from filename extension (.shp, .gpkg, .geojson, .topojson, ...).

Endpoint selection:

  • overpass_profile supports: main, kumi, fr, custom.
  • overpass_url overrides the selected profile URL when provided.

Large-AOI chunking:

  • chunk_large_aoi=True (default) automatically tiles large query extents.
  • chunk_max_area_deg2=4.0 controls maximum area per chunk.
  • max_chunk_count=64 caps the number of generated chunk requests.
  • chunk_parallel_requests=1 (default) controls bounded parallel chunk fetch; set >1 to fetch chunks concurrently.
buildings = wbe.vector.online_data.download_osm_vector(
    west=-80.54,
    south=43.41,
    east=-80.47,
    north=43.47,
    filter_preset="buildings",
    include_points=False,
    include_lines=False,
    include_polygons=True,
    output_epsg=32617,
)

wbe.write_vector(buildings, "kitchener_buildings_utm17n.gpkg")

Operational Guidance

Overpass public endpoints enforce rate limits. Prefer smaller AOIs and bounded requests.

Recommended practice:

  • Keep AOIs compact
  • Use thematic filters
  • Set max_elements defensively
  • Increase timeout_seconds for denser urban queries

Attribution and Licensing

OSM data are provided under ODbL. When distributing derived datasets or maps, ensure proper OpenStreetMap attribution and verify downstream licensing obligations for your use case.

Companion Example

See:

  • crates/wbw_python/examples/osm_download_vector.py

Network Analysis

Whitebox Next Gen has deep capabilities across the full network-analysis spectrum: topology auditing, point-to-point routing, service areas, closest facility, OD cost matrices, location-allocation, accessibility metrics, sensitivity analysis, multimodal transit modelling, map matching, and fleet dispatch optimization. This chapter walks through those capabilities in the order you would encounter them in a real project.

Capability Note (Open Tier)

The workflows in this chapter target the open-tier engine and include advanced network controls such as turn/u-turn penalties, node-entry costs, and optional time-dependent edge profiles (temporal_cost_profile + departure_time) for scenario and peak-period analysis.


Core Concepts You Should Know First

Before running tools, it helps to align on a few core terms used throughout this chapter.

  • Network: A graph made of edges (road or transit segments) and nodes (intersections, stops, junctions).
  • Cost / impedance: The value minimized during routing. This can be distance, travel time, generalized cost, or another friction metric.
  • Origin / destination (OD): Origins are trip start points; destinations are trip end points.
  • OD matrix: A table of costs from many origins to many destinations. This is the standard structure for accessibility, market access, and assignment analyses.
  • Shortest path: The minimum-cost path between one origin and one destination.
  • K-shortest paths: The best k distinct alternatives between the same OD pair, useful for resilience and choice modelling.
  • Service area (isochrone): The portion of the network reachable from an origin within a cost threshold (for example 10 minutes).
  • Closest facility: For each incident or demand point, the least-cost route to the nearest candidate facility on the network.
  • Location-allocation: Selecting facility sites that optimize a demand objective, such as minimizing total travel cost or maximizing coverage.
  • Connectivity: Whether all required origins and destinations are in the same connected component. Disconnected components cause failed routes.
  • Node degree: The number of edges touching a node. Degree supports basic network centrality interpretation and QA for odd junction structure.
  • Multimodal routing: Pathfinding across multiple transport modes (walk/bus/rail) with transfer penalties and mode constraints.
  • Map matching: Snapping GPS trajectories to the most plausible sequence of network edges.

If you keep these definitions in mind, each workflow step below becomes easier to interpret and validate.

Modeling Intersection Delay With Node Costs

Network tools in this chapter support optional node-entry cost modeling for intersections, gates, crossings, or turn-heavy junctions:

  • node_cost_points: point layer containing node-cost observations.
  • node_cost_field: numeric field in node_cost_points with non-negative entry cost values.
  • node_cost_snap_distance: optional max assignment distance from each node-cost point to the nearest network node.

Use node costs when edge impedance alone underestimates urban delay at intersections.


Step 1 — Prepare and Audit the Network

Every routing workflow should begin with a topology check. A single dangling endpoint or disconnected island can silently invalidate a shortest-path result.

Topology Audit

network_topology_audit() scans a line network for common errors — dead ends, pseudo-nodes, overshoots, and isolated islands — and writes each flagged location as a point feature. It also produces an optional text report.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/network'
wbe.verbose = True

roads = wbe.read_vector('roads.shp')

errors, report_path = wbe.vector.network_analysis.network_topology_audit(
    roads,
    snap_tolerance=0.5,
    one_way_field='ONEWAY',
    report='topology_report.txt'
)
wbe.write_vector(errors, 'topology_errors.shp')

Review topology_report.txt before continuing. Understanding the error count and class distribution will guide how much cleaning the network needs.

Connected Components

An isolated cluster of road segments that cannot reach the main network will cause any OD or closest-facility query to fail for origins or destinations on that cluster. network_connected_components() labels every edge with its component identifier.

roads_comps = wbe.vector.network_analysis.network_connected_components(roads, snap_tolerance=0.5)
wbe.write_vector(roads_comps, 'roads_components.shp')
# Edges not in the dominant component are candidates for removal or bridging.

Node Degree

network_node_degree() writes the degree (number of connected edges) of every node as a point layer. Degree-1 nodes are dead ends; unusually high-degree nodes may indicate duplicate arcs.

nodes = wbe.vector.network_analysis.network_node_degree(roads, snap_tolerance=0.5)
wbe.write_vector(nodes, 'node_degree.shp')

Building Network Topology

If your raw network lacks proper topology (node points, edge connectivity structure), use build_network_topology() to construct nodes and validate edges. This is essential before running advanced analysis like service areas or facility location.

edges, nodes = wbe.vector.network_analysis.build_network_topology(
    roads,
    snap_tolerance=0.5,
    output_nodes=True
)
wbe.write_vector(edges, 'roads_noded.shp')
wbe.write_vector(nodes, 'network_nodes.shp')

Snapping Facilities and Demand Points

Before routing from facilities or demand points, snap them to the nearest network location. This ensures routing queries don't fail on "off-network" origins.

facilities = wbe.read_vector('fire_stations.shp')

snapped = wbe.vector.network_analysis.snap_points_to_network(
    network=edges,
    points=facilities,
    snap_distance=50.0,  # meters
    search_by_nearest=True
)
wbe.write_vector(snapped, 'fire_stations_snapped.shp')
# Output includes SNAP_DIST (offset to network) and snapped geometry.

Step 2 — Shortest Path and Alternatives

Single Shortest Path

shortest_path_network() finds the minimum-cost path between two coordinates using Dijkstra's algorithm. Supply an edge_cost_field to use travel-time or impedance; omit it to route by Euclidean arc length.

path = wbe.vector.network_analysis.shortest_path_network(
    roads,
    start_x=454230.0, start_y=4823150.0,
    end_x=458900.0,   end_y=4819700.0,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY'
)
wbe.write_vector(path, 'route_shortest.shp')

Turn penalties model the real-world cost of left, right, and U-turns — these can substantially alter optimal routes in dense urban networks.

path_turns = wbe.vector.network_analysis.shortest_path_network(
    roads,
    start_x=454230.0, start_y=4823150.0,
    end_x=458900.0,   end_y=4819700.0,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY',
    node_cost_points='intersection_delay_points.shp',
    node_cost_field='DELAY_MIN',
    node_cost_snap_distance=25.0,
    turn_penalty=0.5,
    u_turn_penalty=3.0,
    forbid_u_turns=True
)
wbe.write_vector(path_turns, 'route_with_turns.shp')

K-Shortest Alternative Paths

k_shortest_paths_network() returns the k least-cost distinct paths between the same endpoints. Use this for resilience analysis, route-choice modelling, or presenting alternatives to planners.

alt_paths = wbe.vector.network_analysis.k_shortest_paths_network(
    roads,
    start_x=454230.0, start_y=4823150.0,
    end_x=458900.0,   end_y=4819700.0,
    k=3,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY'
)
wbe.write_vector(alt_paths, 'routes_k3.shp')
# Each feature carries a PATH_RANK attribute (1 = shortest).

Step 3 — Service Areas

network_service_area() delineates every part of the network reachable within a cost threshold from one or more origins. Typical uses include drive-time catchments for emergency services, walking isochrones for transit stops, and delivery zones.

fire_stations = wbe.read_vector('fire_stations.shp')

catchment = wbe.vector.network_analysis.network_service_area(
    roads,
    origins=fire_stations,
    max_cost=5.0,               # 5 minutes
    snap_tolerance=20.0,
    output_mode='polygon',      # 'nodes', 'edges', or 'polygon'
    polygon_merge_origins=True, # dissolve overlapping catchments
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY'
)
wbe.write_vector(catchment, 'fire_catchment_5min.shp')

If your network encodes one-way streets, pass one_way_field and use FT/TF/B style values when available (FT = first-to-last only, TF = last-to-first only, B = bidirectional). Legacy boolean-style values are still accepted.

To model rush-hour conditions, pass a temporal speed profile and apply turn penalties. Edge speeds are scaled by the profile multipliers at the specified departure time.

catchment_peak = wbe.vector.network_analysis.network_service_area(
    roads,
    origins=fire_stations,
    max_cost=5.0,
    snap_tolerance=20.0,
    output_mode='polygon',
    polygon_merge_origins=True,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY',
    node_cost_points='intersection_delay_points.shp',
    node_cost_field='DELAY_MIN',
    node_cost_snap_distance=25.0,
    turn_penalty=0.3,
    u_turn_penalty=2.0,
    forbid_u_turns=True,
    temporal_cost_profile='rush_hour_profiles.csv',
    temporal_edge_id_field='EDGE_ID',
    departure_time='2024-06-15T08:00:00Z',
    temporal_mode='multiplier',
    temporal_fallback='static_cost'
)
wbe.write_vector(catchment_peak, 'fire_catchment_5min_am_peak.shp')

Use output_mode='edges' to retain the actual road arcs inside the catchment rather than fill a polygon — more appropriate when the network is sparse or when the arc-level result is needed for reporting.


Step 4 — Closest Facility

closest_facility_network() routes each incident point to its nearest facility, measuring cost along the network rather than in straight-line distance. This is the core tool for emergency-response siting, healthcare access studies, and school-catchment delineation.

accidents   = wbe.read_vector('accidents.shp')
hospitals   = wbe.read_vector('hospitals.shp')

routes_to_hosp = wbe.vector.network_analysis.closest_facility_network(
    roads,
    incidents=accidents,
    facilities=hospitals,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY'
)
wbe.write_vector(routes_to_hosp, 'routes_to_hospital.shp')
# Output carries INCIDENT_FID, FACILITY_FID, and COST fields per route.

If your network uses explicit one-way encodings, closest_facility_network() accepts FT/TF/B values as well as legacy boolean-style one-way fields.

For peak-hour response-time analysis, combine turn penalties with a temporal speed profile.

routes_peak = wbe.vector.network_analysis.closest_facility_network(
    roads,
    incidents=accidents,
    facilities=hospitals,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY',
    node_cost_points='intersection_delay_points.shp',
    node_cost_field='DELAY_MIN',
    node_cost_snap_distance=25.0,
    turn_penalty=0.5,
    u_turn_penalty=3.0,
    forbid_u_turns=True,
    temporal_cost_profile='rush_hour_profiles.csv',
    temporal_edge_id_field='EDGE_ID',
    departure_time='2024-06-15T08:00:00Z',
    temporal_mode='multiplier',
    temporal_fallback='static_cost'
)
wbe.write_vector(routes_peak, 'routes_to_hospital_am_peak.shp')

Step 5 — OD Cost Matrix and Batch Route Export

When you need costs between many origins and many destinations simultaneously, an OD matrix is far more efficient than looping over shortest_path_network().

OD Cost Matrix

network_od_cost_matrix() solves all pairwise paths and writes the results to a CSV. Each row contains an origin identifier, a destination identifier, and the network cost between them.

schools   = wbe.read_vector('schools.shp')
libraries = wbe.read_vector('libraries.shp')

cost_csv = wbe.vector.network_analysis.network_od_cost_matrix(
    roads,
    origins=schools,
    destinations=libraries,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY'
)
print('OD matrix written to:', cost_csv)

If your network uses explicit one-way encodings, network_od_cost_matrix() accepts FT/TF/B values as well as legacy boolean-style one-way fields.

The CSV is directly usable in pandas or any tabular analysis tool.

import pandas as pd
df = pd.read_csv(cost_csv)
print(df.groupby('ORIGIN_FID')['COST'].min().describe())

For a time-of-day comparison, run a second matrix at AM-peak departure and compare cost distributions.

cost_csv_am = wbe.vector.network_analysis.network_od_cost_matrix(
    roads,
    origins=schools,
    destinations=libraries,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY',
    node_cost_points='intersection_delay_points.shp',
    node_cost_field='DELAY_MIN',
    node_cost_snap_distance=25.0,
    turn_penalty=0.5,
    temporal_cost_profile='am_peak_profiles.csv',
    temporal_edge_id_field='EDGE_ID',
    departure_time='2024-06-15T08:00:00Z',
    temporal_mode='multiplier',
    temporal_fallback='static_cost'
)
print('AM-peak OD matrix written to:', cost_csv_am)

Materializing OD Routes as Geometry

To visualize or spatially analyse the actual path lines between OD pairs, use network_routes_from_od().

od_routes = wbe.vector.network_analysis.network_routes_from_od(
    roads,
    origins=schools,
    destinations=libraries,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    one_way_field='ONEWAY'
)
wbe.write_vector(od_routes, 'od_routes_schools_to_libraries.shp')

If your network uses explicit one-way encodings, network_routes_from_od() accepts FT/TF/B values as well as legacy boolean-style one-way fields.


Step 6 — Location-Allocation

location_allocation_network() solves the classic p-median problem: given candidate facility locations and weighted demand points, which p facilities minimise total travel cost? Use this for clinic siting, school consolidation, warehouse network design, and similar strategic planning problems.

demand     = wbe.read_vector('demand_points.shp')  # population-weighted
candidates = wbe.read_vector('candidate_sites.shp')

sited = wbe.vector.network_analysis.location_allocation_network(
    roads,
    demand_points=demand,
    facilities=candidates,
    facility_count=4,
    solver_mode='minimize_impedance',
    demand_weight_field='POP',
    snap_tolerance=20.0,
    edge_cost_field='MINUTES'
)
wbe.write_vector(sited, 'selected_facilities.shp')
# SELECTED == 1 on the four chosen candidate sites.
# Demand points carry ASSIGNED_FID linking each to its nearest selected site.

To optimise facility placement under peak-hour travel times rather than free-flow speeds, pass a temporal profile.

sited_peak = wbe.vector.network_analysis.location_allocation_network(
    roads,
    demand_points=demand,
    facilities=candidates,
    facility_count=4,
    solver_mode='minimize_impedance',
    demand_weight_field='POP',
    snap_tolerance=20.0,
    edge_cost_field='MINUTES',
    node_cost_points='intersection_delay_points.shp',
    node_cost_field='DELAY_MIN',
    node_cost_snap_distance=25.0,
    temporal_cost_profile='am_peak_profiles.csv',
    temporal_edge_id_field='EDGE_ID',
    departure_time='2024-06-15T08:00:00Z',
    temporal_mode='multiplier',
    temporal_fallback='static_cost'
)
wbe.write_vector(sited_peak, 'selected_facilities_am_peak.shp')

Solver modes include minimize_impedance (p-median), maximize_coverage, and maximize_attendance. Required and forbidden facility flags let you fix certain sites open or closed before the solver runs.


Step 7 — Network Accessibility Metrics

compute_network_accessibility() measures how accessible a set of destinations is from each origin, applying a decay function that down-weights distant facilities. The result is a gravity-model or cumulative-opportunity accessibility score per origin — a standard indicator in transport equity analysis.

residents    = wbe.read_vector('resident_centroids.shp')
supermarkets = wbe.read_vector('supermarkets.shp')

accessibility = wbe.compute_network_accessibility(
    roads,
    origins=residents,
    destinations=supermarkets,
    edge_cost_field='MINUTES',
    one_way_field='DIR',
    node_cost_points='intersection_delay_points.shp',
    node_cost_field='DELAY_MIN',
    node_cost_snap_distance=25.0,
    impedance_cutoff=30.0,
    decay_function='negative_exponential',
    decay_parameter=0.1
)
wbe.write_vector(accessibility, 'food_accessibility.shp')
# Each origin point carries an ACCESS_SCORE field.

When a one_way_field is provided, one-way values can use FT/TF/B conventions (FT = first-to-last only, TF = last-to-first only, B = bidirectional), as well as legacy boolean-style encodings.


Step 8 — OD Sensitivity Analysis

analyze_od_cost_sensitivity() quantifies how stable OD costs are under stochastic perturbation of edge weights. Use it to stress-test a routing model against uncertainty in travel-time estimates, or to assess the impact of hypothetical congestion or road-closure scenarios.

sensitivity = wbe.analyze_od_cost_sensitivity(
    roads,
    origins=schools,
    destinations=libraries,
    edge_cost_field='MINUTES',
    node_cost_points='intersection_delay_points.shp',
    node_cost_field='DELAY_MIN',
    node_cost_snap_distance=25.0,
    impedance_disturbance_range=0.2,  # ±20 % perturbation
    monte_carlo_samples=500
)
wbe.write_vector(sensitivity, 'od_sensitivity.shp')

Step 9 — Multimodal Analysis

Whitebox Next Gen supports networks that carry a MODE field on each edge (e.g. walk, cycle, bus, rail). The multimodal tools honour mode-specific speeds, transfer penalties, and time-of-day profiles.

Multimodal OD Scenarios

analyze_multimodal_od_scenarios() runs a batch of named scenarios defined by a CSV, each specifying different mode allowances, speed overrides, or departure times. The output is a combined cost table across all scenarios for rapid before/after or modal-mix comparisons.

transit_net    = wbe.read_vector('transit_network.shp')
bus_stops      = wbe.read_vector('bus_stops.shp')
destinations   = wbe.read_vector('key_destinations.shp')

result = wbe.analyze_multimodal_od_scenarios(
    input=transit_net,
    origins=bus_stops,
    destinations=destinations,
    output='multimodal_od_scenarios.shp',
    mode_field='MODE',
    allowed_modes='walk,bus,rail',
    transfer_penalty=3.0,
    edge_cost_field='MINUTES',
    scenario_bundle_csv='scenarios.csv',
    departure_time='08:00',
    temporal_mode='scheduled'
)

Exporting Multimodal Route Geometry

export_multimodal_routes_for_od_pairs() materializes the optimal multimodal route for each OD pair as a line feature with per-segment mode attributes.

mm_routes = wbe.export_multimodal_routes_for_od_pairs(
    input=transit_net,
    origins=bus_stops,
    destinations=destinations,
    output='multimodal_routes.shp',
    mode_field='MODE',
    allowed_modes='walk,bus,rail',
    transfer_penalty=3.0,
    edge_cost_field='MINUTES'
)

Step 10 — Map Matching

map_matching_v1() snaps a raw GPS trajectory to the most plausible sequence of network edges using a hidden Markov model with candidate expansion. It is the first step in any floating-vehicle data or probe-data workflow.

gps_points = wbe.read_vector('gps_probe_points.shp')

matched_path, match_report = wbe.vector.network_analysis.map_matching_v1(
    roads,
    trajectory_points=gps_points,
    timestamp_field='TIMESTAMP',
    search_radius=30.0,
    candidate_k=5,
    snap_tolerance=10.0,
    edge_cost_field='MINUTES',
    matched_points_output='matched_points.shp',
    match_report='match_report.txt'
)
wbe.write_vector(matched_path, 'matched_route.shp')

The match report summarises per-point confidence scores and the percentage of trajectory points that were successfully snapped to the network.


Step 11 — Fleet and Vehicle Routing (Pro)

fleet_routing_and_dispatch_optimizer solves Capacitated Vehicle Routing Problems (CVRP) and Vehicle Routing with Time Windows (VRPTW): given a fleet of vehicles at one or more depots and a set of service or delivery stops, it assigns stops to vehicles and sequences each route to minimise total travel cost subject to capacity and time-window constraints.

result = wbe.run_tool(
    'fleet_routing_and_dispatch_optimizer',
    {
        'network':               'roads.shp',
        'depots':                'depots.shp',
        'stops':                 'delivery_stops.shp',
        'vehicles_csv':          'fleet.csv',
        'route_output':          'fleet_routes.shp',
        'route_kpis_csv_output': 'fleet_kpis.csv',
        'edge_cost_field':       'MINUTES',
        'one_way_field':         'ONEWAY',
        'vrp_mode':              'VRPTW'
    }
)
print(result)

The KPI CSV reports per-route capacity utilization, total distance, time, and stop count — ready for import into logistics dashboards.

Note: This tool requires a WbEnvironment initialised with a valid Pro licence.


Complete Workflow: Emergency Response Planning

The following example chains topology audit → service-area catchment → closest-facility → location-allocation into a single emergency-planning analysis.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/emergency_planning'

roads      = wbe.read_vector('roads.shp')
stations   = wbe.read_vector('fire_stations.shp')
candidates = wbe.read_vector('candidate_stations.shp')
incidents  = wbe.read_vector('historical_incidents.shp')

# 1. Audit topology before running any queries.
errors, _ = wbe.vector.network_analysis.network_topology_audit(
    roads, snap_tolerance=0.5, report='topology_report.txt'
)
wbe.write_vector(errors, 'topology_errors.shp')

# 2. Map 5-minute drive catchments from existing stations.
catchment = wbe.vector.network_analysis.network_service_area(
    roads,
    origins=stations,
    max_cost=5.0,
    output_mode='polygon',
    polygon_merge_origins=True,
    edge_cost_field='MINUTES',
    snap_tolerance=20.0
)
wbe.write_vector(catchment, 'existing_catchment_5min.shp')

# 3. Route each historical incident to its nearest station.
routes = wbe.vector.network_analysis.closest_facility_network(
    roads,
    incidents=incidents,
    facilities=stations,
    snap_tolerance=20.0,
    edge_cost_field='MINUTES'
)
wbe.write_vector(routes, 'incident_routes.shp')

# 4. Find two additional station locations that maximise coverage.
sited = wbe.vector.network_analysis.location_allocation_network(
    roads,
    demand_points=incidents,
    facilities=candidates,
    facility_count=2,
    solver_mode='maximize_coverage',
    snap_tolerance=20.0,
    edge_cost_field='MINUTES'
)
wbe.write_vector(sited, 'new_station_sites.shp')

Tips

  • Always run network_topology_audit() first — even one disconnected segment can cause a path query to return no result without an explicit error.
  • Use network_connected_components() to confirm that all origins and destinations belong to the same component before running OD queries.
  • Supply edge_cost_field pointing to a pre-computed travel-time field for realistic routing; omit it only for pure geometric distance problems.
  • For time-sensitive routing, use temporal_cost_profile and departure_time to load scheduled speeds at the time of travel.
  • For multimodal networks, store the mode identifier in a field called MODE and use allowed_modes to control which modes are permitted per query.
  • The fleet_routing_and_dispatch_optimizer Pro tool requires a WbEnvironment initialised with a valid Pro licence.

Linear Referencing

Linear referencing is the practice of locating observations, measurements, or events along a route using a distance-based measure rather than absolute coordinates. A road asset database might record a pothole at 2.4 km from the start of route R-12; a utility corridor might flag a pressure anomaly at 847 m along a pipeline. Whitebox Next Gen provides the tools to build measured routes, locate observations against them, place events from tables or spatial layers, and — with a Pro licence — audit the consistency and governance of large linear asset datasets.


Core Concepts

A linear-referencing workflow has three parts:

  1. Routes — line features that define the measurement axis. Each route has a unique identifier and carries M-values (measures) representing cumulative distance from its start point.
  2. Measures — the distance value used to locate a position along a route.
  3. Events — point or line observations located by (route_id, measure) or (route_id, from_measure, to_measure) pairs.

Common Whitebox Next Gen applications include:

  • road-pavement condition assessment by segment
  • pipeline corridor integrity monitoring
  • trail difficulty and visibility reporting
  • environmental sampling along survey transects
  • GPS probe data quality control and kilometrage reporting

Route Calibration and M-Value Management

Measures are only useful when anchored to real-world control points. If your raw routes lack calibration, or have been edited, use the calibration tools to establish stable, field-verified measures.

Initial Calibration from Control Points

route_calibrate() establishes measure values on routes using control points with known measures. For example, if you have kilometre posts at known distances along a highway, calibration ensures your event locations align with field reality.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/linear_referencing'

routes = wbe.read_vector('highway_centerlines.shp')
km_posts = wbe.read_vector('km_post_locations.shp')  # with ROUTE_ID and KNOWN_MEASURE fields

calibrated = wbe.vector.linear_referencing.route_calibrate(
    routes=routes,
    control_points=km_posts,
    control_measure_field='KNOWN_MEASURE',
    route_id_field='ROUTE_ID',
    snap_tolerance=10.0  # max control-point offset from route (meters)
)
wbe.write_vector(calibrated, 'highway_calibrated.shp')
# Output includes FROM_MEASURE and TO_MEASURE fields.

Recalibration After Edits

If you edit routes (split, merge, or regeometrize), use route_recalibrate() to scale measures proportionally and maintain event alignment.

edited_routes = wbe.read_vector('highway_edited.shp')  # after geometric changes

recalibrated = wbe.vector.linear_referencing.route_recalibrate(
    original_routes=calibrated,     # reference with valid measures
    edited_routes=edited_routes,
    route_id_field='ROUTE_ID'
)
wbe.write_vector(recalibrated, 'highway_recalibrated.shp')

Validating Event Snapping

Before placing events on routes, diagnose snapping issues with snap_events_to_routes(). This reports snap distance, offset, and any unmatched events.

obs_points = wbe.read_vector('field_observations.shp')

diag = wbe.vector.linear_referencing.snap_events_to_routes(
    routes=calibrated,
    events=obs_points,
    max_offset_distance=15.0
)
wbe.write_vector(diag, 'observations_snap_diagnostics.shp')
# Output includes ROUTE_ID, MEASURE, and OFFSET fields; unmatched features are excluded.

Step 1 — Understand Your Route Geometry

Routes must be single-part polylines with a consistent digitizing direction. Before dropping events, confirm:

  • Each route has a unique identifier stored in a field (e.g. ROUTE_ID).
  • No route self-intersects.
  • Routes that form a corridor are merged into one feature per route identifier.

Use snap_endnodes and merge_line_segments to clean ragged street-centreline inputs before treating them as routes.


Step 2 — Locate Points Along Routes

locate_points_along_routes() takes an existing point layer and finds the nearest position on each matching route, writing back the M-value (measure) for every point. This is the first tool to reach for when your field team has collected GPS observation points and you need to convert them to route-distance offsets for further analysis.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/linear_referencing'

routes      = wbe.read_vector('roads_measured.shp')
obs_points  = wbe.read_vector('field_observations.shp')

located = wbe.vector.linear_referencing.locate_points_along_routes(
    routes=routes,
    points=obs_points,
    max_offset_distance=15.0   # max perpendicular snap distance in map units
)
wbe.write_vector(located, 'observations_located.shp')
# Output adds ROUTE_ID, MEASURE, and OFFSET fields to every input point.

The MEASURE field in the output is the along-route distance from the route start. OFFSET is the perpendicular distance from the point to the route. Points beyond max_offset_distance are not matched and are excluded from the output.


Step 3 — Place Events from a Table

Point Events

route_event_points_from_table() reads a CSV (or other tabular file) where each row specifies a route identifier and a measure value, and places a point feature at that position along the matching route. This is the standard import path for lab results, inspection records, or maintenance logs stored in external databases.

# events.csv columns: ROUTE_ID, MEASURE, SEVERITY, NOTES
pts = wbe.vector.linear_referencing.route_event_points_from_table(
    routes=routes,
    events='pavement_defects.csv',
    event_route_field='ROUTE_ID',
    measure_field='MEASURE'
)
wbe.write_vector(pts, 'pavement_defects_located.shp')

Line (Interval) Events

route_event_lines_from_table() works the same way but reads FROM_MEASURE and TO_MEASURE columns to produce line segments — useful for pavement condition ratings, speed zones, or any attribute that applies to a stretch of route rather than a single point.

# condition.csv columns: ROUTE_ID, FROM_MEASURE, TO_MEASURE, IRI, CONDITION
segs = wbe.vector.linear_referencing.route_event_lines_from_table(
    routes=routes,
    events='pavement_condition.csv',
    event_route_field='ROUTE_ID',
    from_measure_field='FROM_MEASURE',
    to_measure_field='TO_MEASURE'
)
wbe.write_vector(segs, 'pavement_condition_segments.shp')

Step 4 — Place Events from a Spatial Layer

When your event data is already a vector layer rather than a plain table, use the _from_layer variants. These carry across all attributes of the source feature and can optionally write the feature's original FID and XY coordinates into the output.

Point Events from a Layer

inspections = wbe.read_vector('manhole_inspections.shp')

pts_from_layer = wbe.vector.linear_referencing.route_event_points_from_layer(
    routes=routes,
    events=inspections,
    event_route_field='ROUTE_ID',
    measure_field='MEASURE',
    write_event_fid=True,   # retain original feature ID in output
    write_event_xy=True     # also store original XY in output
)
wbe.write_vector(pts_from_layer, 'manholes_on_routes.shp')

Line Events from a Layer

speed_zones = wbe.read_vector('speed_zone_events.shp')

segs_from_layer = wbe.vector.linear_referencing.route_event_lines_from_layer(
    routes=routes,
    events=speed_zones,
    event_route_field='ROUTE_ID',
    from_measure_field='FROM_M',
    to_measure_field='TO_M',
    write_event_fid=True
)
wbe.write_vector(segs_from_layer, 'speed_zones_on_routes.shp')

Step 5 — Linear Asset Governance (Pro)

route_event_governance_for_linear_assets audits a complete linear asset dataset for measure gaps, overlaps, duplicate events, orphaned route references, and out-of-range measures. It produces a flagged event output and a structured report — essential for maintaining the integrity of a production road or utility asset database.

result = wbe.run_tool(
    'route_event_governance_for_linear_assets',
    {
        'routes':             'roads_measured.shp',
        'events':             'pavement_condition.shp',
        'route_id_field':     'ROUTE_ID',
        'from_measure_field': 'FROM_MEASURE',
        'to_measure_field':   'TO_MEASURE',
        'flagged_output':     'event_flags.shp',
        'report':             'governance_report.csv'
    }
)
print(result)

The flagged output marks each event with an error code and description. The report CSV summarises error counts by class and route, ready for integration into a maintenance management system.

Note: This tool requires a WbEnvironment initialised with a valid Pro licence.


Complete Workflow: Road Pavement Assessment

The following example takes a road network, locates inspection points collected in the field, overlays a condition rating table, and exports both a point layer and a segment layer ready for pavement management reporting.

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
wbe.working_directory = '/data/pavement_assessment'

routes         = wbe.read_vector('roads_measured.shp')
field_gps      = wbe.read_vector('field_inspection_gps.shp')

# Step 1: Snap GPS observation points onto routes and extract M-values.
located = wbe.vector.linear_referencing.locate_points_along_routes(
    routes=routes,
    points=field_gps,
    max_offset_distance=10.0
)
wbe.write_vector(located, 'gps_on_routes.shp')

# Step 2: Place point defect records from the inspection database.
defects = wbe.vector.linear_referencing.route_event_points_from_table(
    routes=routes,
    events='defect_records.csv',
    event_route_field='ROUTE_ID',
    measure_field='MEASURE'
)
wbe.write_vector(defects, 'defects_located.shp')

# Step 3: Place condition rating intervals from the same database.
condition = wbe.vector.linear_referencing.route_event_lines_from_table(
    routes=routes,
    events='condition_ratings.csv',
    event_route_field='ROUTE_ID',
    from_measure_field='FROM_M',
    to_measure_field='TO_M'
)
wbe.write_vector(condition, 'condition_segments.shp')

# Step 4 (Pro): Audit the condition layer for gaps and overlaps.
result = wbe.run_tool(
    'route_event_governance_for_linear_assets',
    {
        'routes':             'roads_measured.shp',
        'events':             'condition_segments.shp',
        'route_id_field':     'ROUTE_ID',
        'from_measure_field': 'FROM_M',
        'to_measure_field':   'TO_M',
        'flagged_output':     'condition_flags.shp',
        'report':             'governance_report.csv'
    }
)
print('Governance report:', result)

Tips

  • Routes must have a consistent digitizing direction. If your source network was assembled from multiple editors, run snap_endnodes and check that all segments in a single route are digitized in the same direction before computing M-values.
  • locate_points_along_routes() excludes points that exceed max_offset_distance. Inspect unmatched points to identify GPS outliers or route coverage gaps.
  • Use route_event_points_from_table() and route_event_lines_from_table() for bulk imports from asset management databases where the event locations are already stored as route+measure pairs.
  • Use the _from_layer variants when you have existing vector event layers that already carry a route identifier and measure fields.
  • The route_event_governance_for_linear_assets Pro tool scales to production road-asset databases with millions of events and produces actionable error reports ready for integration into maintenance workflows.

API Reference

This section provides API-first documentation for:

  • Tool wrappers (every available tool by theme).
  • Non-tool methods on WbEnvironment.

The goal is to make API discovery reliable without depending on autocomplete.

Sections

Source of Truth

  • Typed API surface: whitebox_workflows/whitebox_workflows.pyi
  • Shared tool docs: docs/tools_*.md
  • Broad API reference: TOOLS.md

When updating wrapper signatures or runtime contracts, regenerate/update those sources first, then refresh these manual chapters.

Non-Tool WbEnvironment API

This chapter documents the non-tool surface on WbEnvironment and related utility namespaces. Tool wrappers are documented in Tool API Reference (All Tools).

Runtime And Licensing Constructors

  • WbEnvironment()
  • WbEnvironment.from_floating_license_id(...)
  • WbEnvironment.from_signed_entitlement_file(...)
  • WbEnvironment.from_signed_entitlement_json(...)

Runtime Introspection And Discovery

  • version()
  • license_type()
  • license_info()
  • list_tools()
  • list_tools_json()
  • list_tool_catalog_json()
  • list_tools_detailed(include_locked=False)
  • describe_tool(tool_id, include_locked=False)
  • get_tool_metadata_json(tool_id)
  • get_tool_info_json(tool_id)
  • search_tools(query, include_locked=False)
  • categories()
  • category(name)
  • domain_namespaces()
  • domain(name)

Data Readers

  • read_raster(file_name, file_mode='r')
  • read_rasters(file_names, parallel=True, file_mode='r')
  • read_vector(file_name, options=None, file_mode='r')
  • read_vectors(file_names, parallel=True, options=None, file_mode='r')
  • read_lidar(file_name, file_mode='r')
  • read_lidars(file_names, parallel=True, file_mode='r')

Sensor Bundle Readers

  • read_bundle(bundle_root)
  • read_landsat(bundle_root)
  • read_sentinel2(safe_root)
  • read_sentinel1(safe_root)
  • read_planetscope(bundle_root)
  • read_iceye(bundle_root)
  • read_dimap(bundle_root)
  • read_maxar_worldview(bundle_root)
  • read_radarsat2(bundle_root)
  • read_rcm(bundle_root)

Reprojection Helpers

  • reproject_raster(...)
  • reproject_vector(...)
  • reproject_lidar(...)
  • reproject_rasters(...)
  • reproject_vectors(...)
  • reproject_lidars(...)
  • georeference_raster_from_control_points(...)

Writers

  • write_raster(raster, output_path, options=None, remove_after_write=False)
  • write_rasters(rasters, output_paths, options=None, remove_after_write=False)
  • write_vector(vector, output_path, options=None)
  • write_lidar(lidar, output_path, options=None)
  • write_text(text, file_name)

Memory Management

  • remove_raster_from_memory(raster)
  • clear_raster_memory()
  • raster_memory_count()
  • raster_memory_bytes()
  • remove_vector_from_memory(vector)
  • clear_vector_memory()
  • vector_memory_count()
  • remove_lidar_from_memory(lidar)
  • clear_lidar_memory()
  • lidar_memory_count()
  • clear_memory()

Utility Namespaces (Non-Tool)

Projection Utility Namespace

Access via wbe.projection:

  • to_ogc_wkt(epsg)
  • identify_epsg(crs_text)
  • reproject_points(points, src_epsg, dst_epsg)
  • reproject_point(x, y, src_epsg, dst_epsg)

Topology Utility Namespace

Access via wbe.topology:

  • intersects_wkt(a_wkt, b_wkt)
  • contains_wkt(a_wkt, b_wkt)
  • within_wkt(a_wkt, b_wkt)
  • touches_wkt(a_wkt, b_wkt)
  • disjoint_wkt(a_wkt, b_wkt)
  • crosses_wkt(a_wkt, b_wkt)
  • overlaps_wkt(a_wkt, b_wkt)
  • covers_wkt(a_wkt, b_wkt)
  • covered_by_wkt(a_wkt, b_wkt)
  • relate_wkt(a_wkt, b_wkt)
  • distance_wkt(a_wkt, b_wkt)
  • vector_feature_relation(a_vector, a_feature_index, b_vector, b_feature_index)
  • is_valid_polygon_wkt(wkt)
  • make_valid_polygon_wkt(wkt, epsilon=1e-9)
  • buffer_wkt(wkt, distance)

Note On Tool Namespaces

Tool namespaces such as wbe.raster, wbe.hydrology, wbe.vector, wbe.remote_sensing, and nested taxonomy-driven categories are documented in:

Tool API Reference (All Tools)

This chapter documents tool wrappers by theme. It is sourced from the shared tool-reference markdown files to reduce drift between wrappers and manual docs.

Important call-style note:

  • Names shown in the included lists (for example d8_flow_accum) are canonical tool identifiers, not flat global methods on WbEnvironment.

  • Preferred invocation is:

    • for general subcategory tools: category-level form (for example wbe.raster.arctan(...))
    • for non-general tools: nested category/subcategory form
  • Examples of nested category/subcategory style:

    • wbe.hydrology.flow_routing.d8_flow_accum(...)
    • wbe.hydrology.depressions_storage.fill_depressions(...)
  • Category-level calls are supported across the API surface and are preferred for general tools.

  • Generic invocation always works through wbe.run_tool(tool_id, args).

For an exhaustive tool_id-to-call-path lookup, see Tool Call Paths (Python).

Math And Statistics

Math and Statistical Tools

This document covers the Math tools currently ported into the new backend.

Unary Raster Math

These tools apply an element-wise mathematical operation to every non-nodata cell of a single input raster and write the result to an output raster.

Unary Tool Index

  • abs
  • arccos
  • arcosh
  • arcsin
  • arctan
  • arsinh
  • artanh
  • bool_not
  • ceil
  • cos
  • cosh
  • decrement
  • exp
  • exp2
  • floor
  • increment
  • is_nodata
  • ln
  • log10
  • log2
  • negate
  • reciprocal
  • round
  • sin
  • sinh
  • sqrt
  • square
  • tan
  • tanh
  • to_degrees
  • to_radians
  • truncate

abs

Calculates the absolute value of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.abs(input_raster, output_path="abs_dem.tif")

arccos

Computes the inverse cosine (in radians) of each non-nodata raster cell. Input values must be in the range [-1, 1].

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.arccos(input_raster, output_path="arccos_dem.tif")

arcosh

Computes the inverse hyperbolic cosine of each non-nodata raster cell. Input values must be ≥ 1.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.arcosh(input_raster, output_path="arcosh_dem.tif")

arcsin

Computes the inverse sine (in radians) of each non-nodata raster cell. Input values must be in the range [-1, 1].

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.arcsin(input_raster, output_path="arcsin_dem.tif")

arctan

Computes the inverse tangent (in radians) of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.arctan(input_raster, output_path="arctan_dem.tif")

arsinh

Computes the inverse hyperbolic sine of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.arsinh(input_raster, output_path="arsinh_dem.tif")

artanh

Computes the inverse hyperbolic tangent of each non-nodata raster cell. Input values must be in the range (-1, 1).

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.artanh(input_raster, output_path="artanh_dem.tif")

ceil

Rounds each non-nodata raster cell upward to the nearest integer.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.ceil(input_raster, output_path="ceil_dem.tif")

cos

Computes the cosine (input in radians) of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.cos(input_raster, output_path="cos_dem.tif")

cosh

Computes the hyperbolic cosine of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.cosh(input_raster, output_path="cosh_dem.tif")

decrement

Subtracts 1 from each non-nodata raster cell value.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.decrement_raster(input_raster, output_path="dem_minus1.tif")

Note: The WbEnvironment method is named decrement_raster to avoid a name clash with the cell-level decrement helper method.

exp

Computes e raised to the power of each non-nodata raster cell value.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.exp(input_raster, output_path="exp_dem.tif")

exp2

Computes 2 raised to the power of each non-nodata raster cell value.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.exp2(input_raster, output_path="exp2_dem.tif")

floor

Rounds each non-nodata raster cell downward to the nearest integer.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.floor(input_raster, output_path="floor_dem.tif")

increment

Adds 1 to each non-nodata raster cell value.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.increment_raster(input_raster, output_path="dem_plus1.tif")

Note: The WbEnvironment method is named increment_raster to avoid a name clash with the cell-level increment helper method.

is_nodata

Outputs 1.0 for every nodata cell and 0.0 for every valid cell. Useful for creating nodata masks.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

mask = wbe.is_nodata_raster(input_raster, output_path="dem_nodata_mask.tif")

Note: The WbEnvironment method is named is_nodata_raster to avoid a name clash with the Raster-class is_nodata predicate.

ln

Computes the natural logarithm of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.ln(input_raster, output_path="ln_dem.tif")

log10

Computes the base-10 logarithm of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.log10(input_raster, output_path="log10_dem.tif")

log2

Computes the base-2 logarithm of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.log2(input_raster, output_path="log2_dem.tif")

negate

Negates each non-nodata raster cell value (multiplies by -1).

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.negate(input_raster, output_path="neg_dem.tif")

reciprocal

Computes the reciprocal (1/x) of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.reciprocal(input_raster, output_path="recip_dem.tif")

round

Rounds each non-nodata raster cell to the nearest integer.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.round(input_raster, output_path="round_dem.tif")

sin

Computes the sine (input in radians) of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.sin(input_raster, output_path="sin_dem.tif")

sinh

Computes the hyperbolic sine of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.sinh(input_raster, output_path="sinh_dem.tif")

sqrt

Computes the square root of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.sqrt(input_raster, output_path="sqrt_dem.tif")

square

Squares each non-nodata raster cell value (x²).

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.square(input_raster, output_path="square_dem.tif")

tan

Computes the tangent (input in radians) of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.tan(input_raster, output_path="tan_dem.tif")

tanh

Computes the hyperbolic tangent of each non-nodata raster cell.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.tanh(input_raster, output_path="tanh_dem.tif")

to_degrees

Converts each non-nodata raster cell from radians to degrees.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.to_degrees(input_raster, output_path="deg_dem.tif")

to_radians

Converts each non-nodata raster cell from degrees to radians.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.to_radians(input_raster, output_path="rad_dem.tif")

truncate

Truncates each non-nodata raster cell to its integer part (rounds toward zero).

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.truncate(input_raster, output_path="trunc_dem.tif")

bool_not

Computes a logical NOT of each non-nodata raster cell, outputting 1 where the input cell value is 0 and 0 otherwise.

Parameters

NameTypeRequiredDescription
inputstringyesInput raster file path.
outputstringyesOutput raster file path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.bool_not(input_raster, output_path="bool_not_dem.tif")

Binary Raster Math

These tools combine two rasters on a cell-by-cell basis.

Binary Tool Index

  • add
  • atan2
  • bool_and
  • bool_or
  • bool_xor
  • divide
  • equal_to
  • greater_than
  • integer_division
  • less_than
  • modulo
  • multiply
  • not_equal_to
  • power
  • subtract

All binary raster math tools share the same core parameter shape: input1, input2, and optional output.

WbEnvironment usage examples

sum_raster = wbe.raster.overlay_math.add(raster_a, raster_b, output_path="sum.tif")
pow_raster = wbe.raster.overlay_math.power(raster_a, raster_b, output_path="power.tif")
mask = wbe.raster.greater_than(raster_a, raster_b, output_path="gt_mask.tif")
logic = wbe.raster.overlay_math.bool_and(raster_a, raster_b, output_path="and_mask.tif")

Tool semantics:

  • atan2: four-quadrant inverse tangent, cell by cell.
  • bool_and, bool_or, bool_xor: treat any non-zero value as true and return 1.0 or 0.0.
  • equal_to, not_equal_to, greater_than, less_than: comparison predicates that return 1.0 or 0.0.
  • integer_division: divides and truncates the result toward zero.
  • modulo: returns the remainder of division.
  • power: raises input1 to the power of input2.

See tools_gis.md for the older documentation context around add, subtract, multiply, and divide.


Statistical Raster Tools

Tool Index

  • raster_summary_stats
  • raster_histogram
  • list_unique_values_raster
  • z_scores
  • rescale_value_range
  • max
  • min
  • quantiles
  • list_unique_values
  • root_mean_square_error
  • random_field
  • random_sample
  • cumulative_distribution
  • crispness_index
  • ks_normality_test
  • inplace_add
  • inplace_subtract
  • inplace_multiply
  • inplace_divide
  • attribute_histogram
  • attribute_scattergram
  • attribute_correlation
  • cross_tabulation
  • zonal_statistics
  • turning_bands_simulation
  • trend_surface
  • trend_surface_vector_points
  • raster_calculator
  • principal_component_analysis
  • inverse_pca

raster_summary_stats

Computes summary statistics for valid raster cells and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.raster_summary_stats(input_raster)

raster_histogram

Builds a fixed-bin histogram for valid raster cells and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.
binsintnoNumber of bins (default 256).

Outputs

  • return: str

WbEnvironment usage

hist_json = wbe.raster.raster_histogram(input_raster, bins=256)

list_unique_values_raster

Lists unique raster values (integers) up to a maximum count and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.
max_valuesintnoMaximum values to return (default 10000).
output_pathstringnoOptional output CSV path.

Outputs

  • return: str

WbEnvironment usage

unique_json = wbe.raster.list_unique_values_raster(
    classified_raster,
    max_values=5000,
    output_path="classified_unique_values.csv",
)

z_scores

Standardizes raster values to z-scores using global mean and standard deviation.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

z = wbe.raster.z_scores(input_raster, output_path="z_scores.tif")

rescale_value_range

Linearly rescales raster values into a target output range.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.
out_minfloatyesTarget minimum output value.
out_maxfloatyesTarget maximum output value.
clip_minfloatnoOptional input clip minimum.
clip_maxfloatnoOptional input clip maximum.
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

rescaled = wbe.raster.rescale_value_range(input_raster, 0.0, 255.0, output_path="rescaled.tif")

max

Computes cellwise maximum using raster/raster or raster/constant operands.

Parameters

NameTypeRequiredDescription
input1RasteryesFirst operand.
input2RasteryesSecond operand.
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

maxed = wbe.raster.max(dem_a, dem_b, output_path="max_ab.tif")
maxed_const = wbe.raster.max(dem_a, 100.0, output_path="max_const.tif")

min

Computes cellwise minimum using raster/raster or raster/constant operands.

Parameters

NameTypeRequiredDescription
input1RasteryesFirst operand.
input2RasteryesSecond operand.
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

mined = wbe.raster.min(dem_a, dem_b, output_path="min_ab.tif")
mined_const = wbe.raster.min(dem_a, 0.0, output_path="min_const.tif")

quantiles

Assigns each valid raster cell to a quantile class from 1..num_quantiles.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.
num_quantilesintnoNumber of classes (default 5).
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

q = wbe.raster.quantiles(input_raster, num_quantiles=5, output_path="quantiles.tif")

list_unique_values

Reports unique value counts for a vector attribute field and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector object.
field_namestringyesAttribute field name to summarize.
output_pathstringnoOptional output CSV path.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.vector.attribute_analysis.list_unique_values(
    parcels,
    "landuse",
    output_path="parcels_landuse_unique_values.csv",
)

root_mean_square_error

Computes RMSE and related vertical-accuracy metrics between comparison and base rasters.

Parameters

NameTypeRequiredDescription
inputRasteryesComparison raster.
baseRasteryesBase/reference raster.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.root_mean_square_error(dem_test, dem_reference)

random_field

Creates a raster filled with standard normal random values using a base raster for geometry.

Parameters

NameTypeRequiredDescription
baseRasteryesBase raster defining output geometry.
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

rand_img = wbe.raster.random_field(base_raster, output_path="random_field.tif")

random_sample

Creates a raster with randomly located valid sample cells labelled with unique IDs.

Parameters

NameTypeRequiredDescription
baseRasteryesBase raster used for output geometry and valid-cell mask.
num_samplesintnoNumber of sample cells to generate (default 1000).
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

sample = wbe.raster.random_sample(base_raster, num_samples=500, output_path="sample.tif")

cumulative_distribution

Transforms raster values into cumulative distribution probabilities in the range 0..1.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

cdf = wbe.raster.cumulative_distribution(input_raster, output_path="cdf.tif")

crispness_index

Calculates the crispness index for a membership-probability raster and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputRasteryesMembership-probability raster.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.crispness_index(probability_raster)

ks_normality_test

Runs a Kolmogorov-Smirnov normality test on raster values and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster object.
num_samplesintnoOptional random sample size; omit to use all valid cells.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.ks_normality_test(input_raster, num_samples=1000)

kappa_index

Computes Cohen's kappa, overall agreement, and per-class agreement metrics for two categorical rasters and returns a JSON report string.

Parameters

NameTypeRequiredDescription
input1RasteryesClassification raster.
input2RasteryesReference raster.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.kappa_index(classified_raster, reference_raster)

paired_sample_t_test

Runs a paired-sample t-test on two rasters using valid paired cells and returns a JSON report string.

Parameters

NameTypeRequiredDescription
input1RasteryesFirst raster in the pair.
input2RasteryesSecond raster in the pair.
num_samplesintnoOptional random sample size; omit to use all valid pairs.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.paired_sample_t_test(before_raster, after_raster, num_samples=2000)

phi_coefficient

Performs a binary-class agreement assessment between two rasters and returns a JSON report string containing contingency counts and the $\phi$ coefficient.

Parameters

NameTypeRequiredDescription
input1RasteryesFirst binary raster. Non-zero cells are treated as class presence.
input2RasteryesSecond binary raster. Non-zero cells are treated as class presence.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.phi_coefficient(predicted_binary, reference_binary)

image_correlation

Computes a Pearson correlation matrix among two or more input rasters and returns a JSON report string.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster handles or file paths (at least two).

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.image_correlation([band1, band2, band3])

image_autocorrelation

Computes global Moran's $I$ for one or more rasters and returns a JSON report string with normality/randomization statistics.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster handles or file paths (at least one).
contiguitystringnoNeighborhood rule: rook, king/queen, or bishop (default rook).

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.image_autocorrelation([elevation, slope], contiguity="king")

image_correlation_neighbourhood_analysis

Computes moving-window local correlation between two rasters and returns two rasters: local correlation values and local p-values.

Parameters

NameTypeRequiredDescription
input1RasteryesFirst input raster.
input2RasteryesSecond input raster.
filter_sizeintnoMoving window size in cells (default 11, minimum 3).
correlation_statstringnoCorrelation metric: pearson, spearman, or kendall (default pearson).
output1_pathstringnoOptional path for the local-correlation raster.
output2_pathstringnoOptional path for the local-significance raster.

Outputs

Returned as tuple[Raster, Raster] in this order:

  • output1: Raster
  • output2: Raster

WbEnvironment usage

local_r, local_p = wbe.raster.local_neighborhood.image_correlation_neighbourhood_analysis(
	band1,
	band2,
	filter_size=11,
	correlation_stat="spearman",
)

image_regression

Performs bivariate linear regression using two rasters and returns a residual raster plus a JSON report string containing model, ANOVA, and coefficient statistics.

Parameters

NameTypeRequiredDescription
independent_variableRasteryesIndependent variable raster (X).
dependent_variableRasteryesDependent variable raster (Y).
standardize_residualsboolnoStandardize residuals by model standard error (default False).
output_pathstringnoOptional output path for residual raster.

Outputs

Returned as tuple[Raster, str] in this order:

  • result: Raster
  • string_2: str

WbEnvironment usage

residuals, report_json = wbe.raster.image_regression(
    independent_raster,
    dependent_raster,
    standardize_residuals=True,
)

dbscan

Performs unsupervised DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering on a stack of input rasters. Each cell's feature vector spans all input bands. Cluster IDs (0-based, I16) are written to the output raster; noise cells and nodata cells receive the nodata value (-32768). A JSON report string is also returned with summary statistics.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesFeature-band rasters forming the multi-dimensional feature space.
scaling_methodstringnoFeature scaling: "none" (default), "normalize" (0–1), or "standardize" (z-scores).
search_distancefloatnoEpsilon neighbourhood radius in feature space (default 1.0).
min_pointsintnoMinimum number of neighbours within epsilon for a core point (default 5).
output_pathstringnoOptional output raster path.

Outputs

Returned as tuple[Raster, str] in this order:

  • result: Raster
  • string_2: str

WbEnvironment usage

clusters, report_json = wbe.raster.dbscan(
    [band1, band2, band3],
    scaling_method="normalize",
    search_distance=0.1,
    min_points=10,
)

| num_samples | int | no | Optional random sample size per raster; omit to use all valid values. |

WbEnvironment usage

report_json = wbe.two_sample_ks_test(raster_a, raster_b, num_samples=3000)

wilcoxon_signed_rank_test

Runs a Wilcoxon signed-rank test on paired raster differences and returns a JSON report string.

Parameters

NameTypeRequiredDescription
input1RasteryesFirst raster in the pair.
input2RasteryesSecond raster in the pair.
num_samplesintnoOptional random sample size; omit to use all valid pairs.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.wilcoxon_signed_rank_test(before_raster, after_raster, num_samples=2000)

conditional_evaluation

Evaluates a per-cell boolean statement and assigns TRUE/FALSE outputs from constants, rasters, or expressions.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster used for value and raster geometry variables.
statementstringyesConditional expression evaluated per cell.
true_valueRasternoValue/expression used when condition is true (defaults to NoData).
false_valueRasternoValue/expression used when condition is false (defaults to NoData).
output_pathstringnoOptional output raster path.

Outputs

  • return: Raster

WbEnvironment usage

out = wbe.raster.reclass_mask.conditional_evaluation(
	input_raster,
	"(value >= 25.0) && (value <= 75.0)",
	true_value=1.0,
	false_value=0.0,
	output_path="conditional.tif",
)

anova

Performs one-way ANOVA of raster values grouped by a class raster and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputRasteryesMeasurement raster.
featuresRasteryesClass/category raster defining groups.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.anova(measurement_raster, class_raster)

inplace_add

Performs the legacy in-place add operation input1 += input2 and returns the updated raster handle.

Parameters

NameTypeRequiredDescription
input1RasteryesRaster to modify.
input2RasteryesRaster or constant addend.

Outputs

  • return: Raster

WbEnvironment usage

updated = wbe.raster.inplace_add(input_raster, 10.0)

inplace_subtract

Performs the legacy in-place subtract operation input1 -= input2 and returns the updated raster handle.

Parameters

NameTypeRequiredDescription
input1RasteryesRaster to modify.
input2RasteryesRaster or constant subtrahend.

Outputs

  • return: Raster

WbEnvironment usage

updated = wbe.raster.inplace_subtract(input_raster, other_raster)

inplace_multiply

Performs the legacy in-place multiply operation input1 *= input2 and returns the updated raster handle.

Parameters

NameTypeRequiredDescription
input1RasteryesRaster to modify.
input2RasteryesRaster or constant multiplier.

Outputs

  • return: Raster

WbEnvironment usage

updated = wbe.raster.inplace_multiply(input_raster, 1.25)

inplace_divide

Performs the legacy in-place divide operation input1 /= input2 and returns the updated raster handle.

Parameters

NameTypeRequiredDescription
input1RasteryesRaster to modify.
input2RasteryesRaster or non-zero constant divisor.

Outputs

  • return: Raster

WbEnvironment usage

updated = wbe.raster.inplace_divide(input_raster, 2.0)

attribute_histogram

Builds histogram summary counts for a numeric vector attribute field and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector object.
field_namestringyesNumeric attribute field name.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.vector.attribute_analysis.attribute_histogram(parcels, "area")

attribute_scattergram

Computes scattergram summary statistics for two numeric vector fields and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector object.
field_name_xstringyesNumeric x-axis field name.
field_name_ystringyesNumeric y-axis field name.
trendlineboolnoInclude linear trendline metrics (default False).

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.vector.attribute_analysis.attribute_scattergram(parcels, "area", "perimeter", trendline=True)

attribute_correlation

Computes the Pearson correlation matrix among numeric vector attribute fields and returns a JSON report string.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector object.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.vector.attribute_analysis.attribute_correlation(parcels)

cross_tabulation

Creates a categorical contingency table between two rasters and returns a JSON report string.

Parameters

NameTypeRequiredDescription
input1RasteryesFirst categorical raster.
input2RasteryesSecond categorical raster.

Outputs

  • return: str

WbEnvironment usage

report_json = wbe.raster.cross_tabulation(classes_2000, classes_2020)

zonal_statistics

Computes statistics (mean, median, min, max, range, standard deviation, diversity, total) for zones defined by a features raster and returns results as a raster and JSON report.

Parameters

NameTypeRequiredDescription
data_rasterRasteryesRaster containing values to summarize.
features_rasterRasteryesRaster containing integer zone IDs.
stat_typestringnoStatistic to compute (default "mean"). Options: mean, median, min, max, range, std_dev, diversity, total.
zero_is_backgroundboolnoExclude zone ID 0 from analysis (default False).
output_pathstringnoOutput raster file path.
callbackfunctionnoProgress callback function.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.zonal_statistics(
    dem, 
    zone_raster, 
    stat_type="mean", 
    output_path="dem_zones_mean.tif"
)

turning_bands_simulation

Simulates a spatially-autocorrelated random field using Carr's turning bands algorithm. Useful for Monte Carlo uncertainty analysis and geostatistical simulation.

Parameters

NameTypeRequiredDescription
base_rasterRasteryesBase raster defining output extent and resolution.
rangefloatyesAutocorrelation range parameter (determines smoothness).
iterationsintnoNumber of random bands to accumulate (default 1000).
output_pathstringnoOutput raster file path.
callbackfunctionnoProgress callback function.

Outputs

  • return: Raster

WbEnvironment usage

simulated = wbe.raster.turning_bands_simulation(
    template_raster,
    range=100.0,
    iterations=500,
    output_path="simulated_field.tif"
)

trend_surface

Fits a polynomial trend surface to raster data via least-squares regression. Supports polynomial orders 1–10.

Parameters

NameTypeRequiredDescription
input_rasterRasteryesInput raster to fit.
polynomial_orderintnoPolynomial order 1–10 (default 1 for linear).
output_pathstringnoOutput raster file path.
callbackfunctionnoProgress callback function.

Outputs

  • return: Raster

WbEnvironment usage

trend = wbe.raster.trend_surface(
    dem,
    polynomial_order=2,
    output_path="dem_trend_quadratic.tif"
)

trend_surface_vector_points

Fits a polynomial trend surface to vector point data (with attribute values) and generates an output raster.

Parameters

NameTypeRequiredDescription
vector_inputVectoryesInput point vector layer.
cell_sizefloatyesOutput raster cell size.
field_namestringyesName of numeric attribute field to fit.
polynomial_orderintnoPolynomial order 1–10 (default 1 for linear).
output_pathstringnoOutput raster file path.
callbackfunctionnoProgress callback function.

Outputs

  • return: Raster

WbEnvironment usage

trend = wbe.raster.trend_surface_vector_points(
    sample_points,
    cell_size=10.0,
    field_name="elevation",
    polynomial_order=2,
    output_path="points_trend_surface.tif"
)

raster_calculator

Evaluates arbitrary mathematical expressions cell-by-cell over one or more input rasters.

Parameters

NameTypeRequiredDescription
expressionstringyesMathematical expression (e.g., "'nir' - 'red'" for NDVI).
input_rastersRasteryesList of input rasters in expression order.
output_pathstringnoOutput raster file path.
callbackfunctionnoProgress callback function.

Special Variables

Expression can reference: rows, columns, north, south, east, west, cellsizex, cellsizey, cellsize, nodata, null, minvalue, maxvalue, pi, e, row, column, rowy, columnx, and inputs as value1, value2, etc.

Outputs

  • return: Raster

WbEnvironment usage

# NDVI example with named rasters
ndvi = wbe.raster.raster_calculator(
    "'nir' - 'red' / ('nir' + 'red')",
    [nir_band, red_band],
    output_path="ndvi.tif"
)

principal_component_analysis

Performs PCA (dimensionality reduction) on 3 or more raster bands. Outputs component rasters and eigendecomposition report.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster bands (3 or more).
num_componentsintnoNumber of PCA components to output (default: all input bands).
standardizedboolnoUse correlation matrix (standardized) vs covariance (default True).
output_pathstringnoOutput directory for component rasters.
callbackfunctionnoProgress callback function.

Outputs

  • return: list[Raster]

WbEnvironment usage

# Perform PCA on multispectral bands
components = wbe.raster.principal_component_analysis(
    [band1, band2, band3, band4],
    num_components=3,
    standardized=True,
    output_path="pca_components/"
)

Output Files

Component rasters: {stem}_comp1.tif, {stem}_comp2.tif, etc. JSON report includes eigenvalues, eigenvectors, and factor loadings.

inverse_pca

Reconstructs original band images from PCA components, with optional noise reduction by excluding high-order components.

Parameters

NameTypeRequiredDescription
component_rastersRasteryesPCA component rasters (in order).
pca_reportstringyesJSON report string from principal_component_analysis().
output_pathstringnoOutput directory for reconstructed bands.
callbackfunctionnoProgress callback function.

Outputs

  • return: list[Raster]

WbEnvironment usage

# Reconstruct with denoising (exclude last 2 components)
reconstructed = wbe.raster.inverse_pca(
    [comp1, comp2, comp3],
    pca_report=report_json,
    output_path="reconstructed_bands/"
)

Output Files

Reconstructed rasters: {stem}_img1.tif, {stem}_img2.tif, etc.

Hydrology

Hydrology Tools

This document covers hydrology tools currently ported into the backend, including DEM depression removal/conditioning and flow-accumulation workflows.

Hydrology (Depression Removal)

These tools prepare DEMs for downstream flow-routing by removing pits, flats, or larger enclosed depressions. The short version is:

  • Prefer breach_depressions_least_cost when you want the lowest-impact correction and realistic cuts through barriers such as roads or embankments.
  • Use fill_depressions when you need a robust full-fill solution and are comfortable modifying all enclosed depressions up to their spill elevations.
  • Use fill_pits or breach_single_cell_pits as lightweight preprocessing for single-cell artifacts, not as a replacement for full depression conditioning.
  • Treat the Wang-and-Liu and Planchon-and-Darboux variants mainly as compatibility methods when you need those specific historical formulations.

Tool Index

  • breach_depressions_least_cost
  • breach_single_cell_pits
  • fill_depressions
  • fill_depressions_planchon_and_darboux
  • fill_depressions_wang_and_liu
  • fill_pits
  • depth_in_sink
  • sink

Hydrology (Flow Accumulation)

Tool Index

  • d8_pointer
  • d8_flow_accum
  • dinf_pointer
  • dinf_flow_accum
  • fd8_pointer
  • fd8_flow_accum
  • rho8_pointer
  • rho8_flow_accum
  • mdinf_flow_accum
  • qin_flow_accumulation
  • quinn_flow_accumulation
  • minimal_dispersion_flow_algorithm
  • flow_accum_full_workflow
  • d8_mass_flux
  • dinf_mass_flux

Hydrology (Diagnostics)

Tool Index

  • find_noflow_cells
  • num_inflowing_neighbours
  • find_parallel_flow
  • edge_contamination
  • flow_length_diff
  • downslope_flowpath_length
  • max_upslope_flowpath_length
  • average_upslope_flowpath_length
  • elevation_above_stream
  • elevation_above_stream_euclidean
  • downslope_distance_to_stream
  • average_flowpath_slope
  • max_upslope_value
  • longest_flowpath
  • depth_to_water
  • fill_burn
  • burn_streams_at_roads
  • trace_downslope_flowpaths
  • flood_order
  • insert_dams
  • raise_walls
  • topological_breach_burn
  • stochastic_depression_analysis
  • unnest_basins
  • upslope_depression_storage
  • flatten_lakes
  • hydrologic_connectivity
  • impoundment_size_index

Hydrology (Watersheds and Basins)

Tool Index

  • basins
  • watershed_from_raster_pour_points
  • watershed
  • jenson_snap_pour_points
  • snap_pour_points
  • subbasins
  • hillslopes
  • strahler_order_basins
  • isobasins

mdinf_flow_accum

mdinf_flow_accum(dem, out_type="sca", exponent=1.1, threshold=None, log=False, clip=False, output_path=None, callback=None)

Computes MD-Infinity triangular multiple-flow-direction accumulation from a DEM.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
out_typestringnoOne of "cells", "ca", "sca" (default).
exponentfloatnoSlope weighting exponent (default 1.1).
thresholdfloat|NonenoOptional convergence threshold in cells. If provided and exceeded, routing becomes convergent.
logboolnoIf true, log-transform output values.
clipboolnoCompatibility flag accepted by the API.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.mdinf_flow_accum(
    dem,
    out_type="value",
    exponent=1.0,
    threshold=1.0,
    output_path="result.tif",
)

qin_flow_accumulation

qin_flow_accumulation(dem, out_type="sca", exponent=10.0, max_slope=45.0, threshold=None, log=False, clip=False, output_path=None, callback=None)

Computes Qin MFD flow accumulation from a DEM using a gradient-dependent dynamic exponent.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
out_typestringnoOne of "cells", "ca", "sca" (default).
exponentfloatnoUpper-bound exponent parameter (default 10.0).
max_slopefloatnoUpper-bound slope in degrees used by the dynamic exponent function (default 45.0).
thresholdfloat|NonenoOptional convergence threshold in cells.
logboolnoIf true, log-transform output values.
clipboolnoCompatibility flag accepted by the API.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.qin_flow_accumulation(
    dem,
    out_type="value",
    exponent=1.0,
    max_slope=1.0,
    threshold=1.0,
    output_path="result.tif",
)

quinn_flow_accumulation

quinn_flow_accumulation(dem, out_type="sca", exponent=1.1, threshold=None, log=False, clip=False, output_path=None, callback=None)

Computes Quinn MFD flow accumulation from a DEM using accumulation-dependent convergence.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
out_typestringnoOne of "cells", "ca", "sca" (default).
exponentfloatnoExponent parameter (default 1.1).
thresholdfloat|NonenoOptional convergence threshold in cells.
logboolnoIf true, log-transform output values.
clipboolnoCompatibility flag accepted by the API.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.quinn_flow_accumulation(
    dem,
    out_type="value",
    exponent=1.0,
    threshold=1.0,
    output_path="result.tif",
)

minimal_dispersion_flow_algorithm

minimal_dispersion_flow_algorithm(raster, out_type="sca", path_corrected_direction_preference=0.0, log_transform=False, clip=False, esri_pntr=False, flow_dir_output_path=None, output_path=None, callback=None)

Computes the Minimal Dispersion Flow Algorithm (MDFA) from a DEM and returns both a flow-direction raster and flow-accumulation raster as a tuple.

Parameters

NameTypeRequiredDescription
rasterRasteryesInput depressionless DEM raster.
out_typestringnoOne of "cells", "ca", "sca" (default).
path_corrected_direction_preferencefloatnoPreference parameter p in [0, 1]; 1.0 is fully non-dispersive.
log_transformboolnoIf true, log-transform accumulation values.
clipboolnoCompatibility flag accepted by the API.
esri_pntrboolnoIf true, encode flow-direction output in Esri pointer style.
flow_dir_output_pathstringnoOptional output path for the flow-direction raster.
output_pathstringnoOptional output path for the flow-accumulation raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Raster, Raster] in this order:

  • flow_dir: Raster
  • result: Raster

WbEnvironment usage

raster_1, raster_2 = wbe.hydrology.flow_routing.minimal_dispersion_flow_algorithm(
    raster,
    out_type="value",
    path_corrected_direction_preference=1.0,
    flow_dir_output_path="flow_dir.tif",
    output_path="result.tif",
)

flow_accum_full_workflow

flow_accum_full_workflow(dem, out_type="sca", log_transform=False, clip=False, esri_pntr=False, breached_dem_output_path=None, flow_dir_output_path=None, output_path=None, callback=None)

Runs a full non-divergent flow workflow in one call and returns a tuple containing a depressionless DEM, a D8 pointer raster, and a D8 accumulation raster.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
out_typestringnoOne of "cells", "ca", "sca" (default).
log_transformboolnoIf true, log-transform accumulation values.
clipboolnoIf true, clip accumulation display maximum (compatibility behavior).
esri_pntrboolnoIf true, encode flow-direction output in Esri pointer style.
breached_dem_output_pathstringnoOptional output path for the depressionless DEM raster.
flow_dir_output_pathstringnoOptional output path for the flow-direction raster.
output_pathstringnoOptional output path for the flow-accumulation raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Raster, Raster, Raster] in this order:

  • breached_dem: Raster
  • flow_dir: Raster
  • result: Raster

WbEnvironment usage

raster_1, raster_2, raster_3 = wbe.hydrology.flow_routing.flow_accum_full_workflow(
    dem,
    out_type="value",
    breached_dem_output_path="breached_dem.tif",
    flow_dir_output_path="flow_dir.tif",
    output_path="result.tif",
)

find_noflow_cells

find_noflow_cells(dem, output_path=None, callback=None, interior_only=False)

Finds DEM cells that have no lower D8 neighbour. On a fully conditioned DEM this should usually be limited to valid edge-drainage cases; interior hits often indicate remaining pits or flats.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.
interior_onlyboolnoIf true, only flags true interior no-flow cells (excluding raster-border and NoData-adjacent outlets).

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.hydrologic_indices.find_noflow_cells(
    dem,
    output_path="result.tif",
)

dinf_mass_flux

dinf_mass_flux(dem, loading, efficiency, absorption, output_path=None, callback=None)

Routes mass downslope using D-Infinity flow-routing, accumulating loading while applying per-cell efficiency and absorption losses.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
loadingRasteryesInput loading raster.
efficiencyRasteryesInput efficiency raster (0-1 or percent values).
absorptionRasteryesInput absorption raster in loading units.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.dinf_mass_flux(
    dem,
    loading,
    efficiency,
    absorption,
    output_path="result.tif",
)

trace_downslope_flowpaths

trace_downslope_flowpaths(seed_points, d8_pntr, esri_pntr=False, zero_background=False, output_path=None, callback=None)

Traces downslope D8 flowpaths from seed points to no-flow cells or the raster edge. Output values are visit counts where overlapping traces occur.

Parameters

NameTypeRequiredDescription
seed_pointsVectoryesInput point vector of seed locations.
d8_pntrAnyyesInput D8 pointer raster.
esri_pntrboolnoIf true, interpret D8 pointers with ESRI encoding.
zero_backgroundboolnoIf true, background is 0; otherwise background is NoData.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.trace_downslope_flowpaths(
    seed_points,
    d8_pointer,
    output_path="result.tif",
)

flood_order

flood_order(dem, output_path=None, callback=None)

Computes flood order from a DEM using a priority-flood traversal from edges inward, assigning each valid cell its visitation sequence.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.flood_order(
    dem,
    output_path="result.tif",
)

flatten_lakes

flatten_lakes(dem, lakes, output_path=None, callback=None)

Flattens lake polygons in a DEM by setting each lake interior to its minimum perimeter elevation.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
lakesVectoryesInput polygon vector of lake features.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.flatten_lakes(
    dem,
    lakes,
    output_path="result.tif",
)

insert_dams

insert_dams(dem, dam_points, dam_length, output_path=None, callback=None)

Inserts localized dam embankments at specified point locations using profile-based crest selection constrained by maximum dam length.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
dam_pointsVectoryesInput point vector of dam locations.
dam_lengthfloatyesMaximum dam length in map units.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.insert_dams(
    dem,
    dam_points,
    dam_length=1.0,
    output_path="result.tif",
)

raise_walls

raise_walls(dem, walls, breach_lines=None, wall_height=100.0, output_path=None, callback=None)

Raises DEM elevations along wall features by a specified height increment, with optional breach lines used to carve openings through raised walls.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
wallsVectoryesInput line or polygon vector defining wall segments.
breach_linesVectornoOptional vector defining breach locations.
wall_heightfloatnoElevation increment applied to wall cells.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.raise_walls(
    dem,
    walls,
    breach_lines,
    wall_height=1.0,
    output_path="result.tif",
)

topological_breach_burn

topological_breach_burn(streams, dem, snap_distance=0.001, out_streams_path=None, out_dem_path=None, out_dir_path=None, out_fa_path=None, callback=None)

Performs topological stream burning using a stream vector and DEM, producing stream raster, burned/conditioned DEM, D8 pointer, and D8 accumulation outputs.

Parameters

NameTypeRequiredDescription
streamsVectoryesInput stream network vector.
demRasteryesInput DEM raster.
snap_distancefloatnoOptional stream snapping distance used in burn-depth scaling.
out_streams_pathstringnoOptional output path for rasterized streams.
out_dem_pathstringnoOptional output path for burned/conditioned DEM.
out_dir_pathstringnoOptional output path for D8 pointer raster.
out_fa_pathstringnoOptional output path for flow-accumulation raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Raster, Raster, Raster, Raster] in this order:

  • raster_1: Raster
  • raster_2: Raster
  • raster_3: Raster
  • raster_4: Raster

WbEnvironment usage

raster_1, raster_2, raster_3, raster_4 = wbe.hydrology.depressions_storage.topological_breach_burn(
    dem,
    streams,
    snap_distance=1.0,
    output_streams_path="output_streams.dat",
    output_dem_path="output_dem.dat",
    output_dir_path="output_dir.dat",
    output_flow_accum_path="output_flow_accum.dat",
)

stochastic_depression_analysis

stochastic_depression_analysis(dem, rmse, range, iterations=100, output_path=None, callback=None)

Estimates depression-membership probability for each DEM cell using Monte Carlo perturbation of elevation error and repeated depression filling.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
rmsefloatyesElevation RMSE used for Gaussian perturbation.
rangefloatyesError autocorrelation range in map units.
iterationsintnoNumber of Monte Carlo iterations.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.stochastic_depression_analysis(
    dem,
    rmse=1.0,
    range=1.0,
    iterations=1,
    output_path="result.tif",
)

unnest_basins

unnest_basins(d8_pointer, pour_points, esri_pntr=False, output_path=None, callback=None)

Delineates full nested basins for pour points over a D8 pointer raster, producing one raster per nesting level.

Parameters

NameTypeRequiredDescription
d8_pointerRasteryesInput D8 pointer raster.
pour_pointsVectoryesInput point vector of outlets/pour points.
esri_pntrboolnoIf true, interpret pointer values with ESRI encoding.
output_pathstringnoOptional base output path used to write numbered outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: list[Raster]

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.unnest_basins(
    d8_pointer,
    pour_points,
    output_path="result.tif",
)

upslope_depression_storage

upslope_depression_storage(dem, output_path=None, callback=None)

Estimates average upslope depression-storage depth by conditioning depressions and routing storage depth downslope.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.upslope_depression_storage(
    dem,
    output_path="result.tif",
)

hydrologic_connectivity

hydrologic_connectivity(dem, exponent=1.1, convergence_threshold=0.0, z_factor=1.0, output1_path=None, output2_path=None, callback=None)

Computes two hydrologic-connectivity indices from a DEM: downslope unsaturated length (DUL) and upslope disconnected saturated area (UDSA).

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
exponentfloatnoCompatibility parameter for dispersion control.
convergence_thresholdfloatnoOptional stream-initiation threshold in contributing cells.
z_factorfloatnoOptional vertical scaling factor.
output1_pathstringnoOptional output path for DUL raster.
output2_pathstringnoOptional output path for UDSA raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Raster, Raster] in this order:

  • output1: Raster
  • output2: Raster

WbEnvironment usage

raster_1, raster_2 = wbe.hydrology.hydrologic_indices.hydrologic_connectivity(
    dem,
    exponent=1.0,
    convergence_threshold=1.0,
    z_factor=1.0,
    output1="value",
    output2="value",
)

impoundment_size_index

impoundment_size_index(dem, max_dam_length, output_mean=False, output_max=False, output_volume=False, output_area=False, output_height=False, callback=None)

Estimates impoundment metrics for potential dams of a given maximum length at each DEM cell.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
max_dam_lengthfloatyesMaximum dam length in map units.
output_meanboolnoInclude mean flooded-depth raster in output tuple.
output_maxboolnoInclude max flooded-depth raster in output tuple.
output_volumeboolnoInclude flooded-volume raster in output tuple.
output_areaboolnoInclude flooded-area raster in output tuple.
output_heightboolnoInclude dam-height raster in output tuple.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Raster | None, Raster | None, Raster | None, Raster | None, Raster | None] in this order:

  • mean: Raster | None
  • max: Raster | None
  • volume: Raster | None
  • area: Raster | None
  • dam_height: Raster | None

WbEnvironment usage

raster_1, raster_2, raster_3, raster_4, raster_5 = wbe.hydrology.depressions_storage.impoundment_size_index(
    dem,
    max_dam_length=1.0,
    mean_output_path="mean.tif",
    max_output_path="max.tif",
    volume_output_path="volume.tif",
    area_output_path="area.tif",
    dam_height_output_path="dam_height.tif",
)

num_inflowing_neighbours

num_inflowing_neighbours(dem, output_path=None, callback=None)

Counts the number of inflowing D8 neighbours for each DEM cell by deriving a D8 flow field from the DEM internally.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.num_inflowing_neighbours(
    dem,
    output_path="result.tif",
)

find_parallel_flow

find_parallel_flow(d8_pointer, streams=None, output_path=None, callback=None)

Flags stream cells that have neighboring stream cells with the same local D8 flow direction, which can indicate D8 directional bias and suspect parallel channel routing.

Parameters

NameTypeRequiredDescription
d8_pointerRasteryesInput D8 pointer raster.
streamsRasternoOptional stream raster mask. If omitted, all valid cells are considered.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.hydrologic_indices.find_parallel_flow(
    d8_pointer,
    streams,
    output_path="result.tif",
)

edge_contamination

edge_contamination(dem, flow_type="mfd", z_factor=-1.0, output_path=None, callback=None)

Identifies edge-contaminated cells, i.e., cells whose upslope contributing area extends beyond the DEM boundary or boundary-connected NoData areas.

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
flow_typestringnoRouting method to use: one of "d8", "mfd"/"fd8", or "dinf".
z_factorfloatnoOptional vertical scaling factor. Values <= 0 are treated as 1.0.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.hydrologic_indices.edge_contamination(
    dem,
    flow_type="value",
    z_factor=1.0,
    output_path="result.tif",
)

flow_length_diff

flow_length_diff(d8_pointer, esri_pntr=False, log_transform=False, output_path=None, callback=None)

Calculates the local maximum absolute difference in downslope flowpath length, which is useful for highlighting drainage divides and ridgelines.

Parameters

NameTypeRequiredDescription
d8_pointerAnyyesInput D8 pointer raster.
esri_pntrboolnoIf true, interpret pointer values using ESRI D8 encoding.
log_transformAnyyesIf true, apply natural-log transform to the output.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.flow_length_diff(
    d8_pntr,
    output_path="result.tif",
)

downslope_flowpath_length

downslope_flowpath_length(d8_pointer, watersheds=None, weights=None, esri_pntr=False, output_path=None, callback=None)

Computes downslope flowpath length from each cell in a D8 pointer raster to its outlet. Optionally constrains paths within watershed IDs and applies per-cell distance weighting.

Parameters

NameTypeRequiredDescription
d8_pointerAnyyesInput D8 pointer raster.
watershedsRasternoOptional watershed raster. When supplied, flowpath accumulation is truncated at watershed boundaries.
weightsRasternoOptional raster multiplier applied to each traversed step length.
esri_pntrboolnoIf true, interpret pointer values using ESRI D8 encoding.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.downslope_flowpath_length(
    d8_pntr,
    output_path="result.tif",
    watersheds,
    weights,
)

max_upslope_flowpath_length

max_upslope_flowpath_length(dem, output_path=None, callback=None)

Computes the maximum upslope flowpath length passing through each DEM cell using D8 routing derived from the input DEM.

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.max_upslope_flowpath_length(
    dem,
    output_path="result.tif",
)

average_upslope_flowpath_length

average_upslope_flowpath_length(dem, output_path=None, callback=None)

Computes the average upslope flowpath length passing through each DEM cell using D8 routing derived from the input DEM.

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.average_upslope_flowpath_length(
    dem,
    output_path="result.tif",
)

elevation_above_stream

elevation_above_stream(dem, streams, output_path=None, callback=None)

Computes elevation above nearest stream measured along downslope D8 flowpaths (a HAND-like terrain index).

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
streamsRasteryesInput stream raster; stream cells are values > 0 and not NoData.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.hydrologic_indices.elevation_above_stream(
    dem,
    streams,
    output_path="result.tif",
)

elevation_above_stream_euclidean

elevation_above_stream_euclidean(dem, streams, output_path=None, callback=None)

Computes elevation above nearest stream using Euclidean proximity to assign each cell to the nearest stream cell, then subtracts stream elevation.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
streamsRasteryesInput stream raster; stream cells are values > 0 and not NoData.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.hydrologic_indices.elevation_above_stream_euclidean(
    dem,
    streams,
    output_path="result.tif",
)

downslope_distance_to_stream

downslope_distance_to_stream(dem, streams, dinf=False, output_path=None, callback=None)

Computes distance from each cell to the nearest stream along downslope flowpaths. Supports D8 routing by default and optional D-infinity routing when dinf=True.

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
streamsRasteryesInput stream raster; stream cells are values > 0 and not NoData.
dinfboolnoIf true, use D-infinity routing; otherwise uses D8 routing.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.hydrologic_indices.downslope_distance_to_stream(
    dem,
    streams,
    output_path="result.tif",
)

average_flowpath_slope

average_flowpath_slope(dem, output_path=None, callback=None)

Calculates average slope gradient in degrees for flowpaths passing through each DEM cell, using D8 flow routing derived from the DEM.

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.average_flowpath_slope(
    dem,
    output_path="result.tif",
)

max_upslope_value

max_upslope_value(dem, values, output_path=None, callback=None)

Propagates the maximum upslope value along D8 flowpaths over a DEM. Useful for carrying source characteristics downslope while preserving maxima.

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
valuesRasteryesInput values raster to propagate.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.max_upslope_value(
    dem,
    values,
    output_path="result.tif",
)

longest_flowpath

longest_flowpath(dem, basins, output_path, callback=None)

Delineates one longest downslope flowpath polyline for each basin in a basin raster. Output includes basin ID, upstream/downstream elevation, flowpath length, and average slope.

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster.
basinsRasteryesInput basin raster with non-zero IDs for basin cells.
output_pathstringyesOutput vector path (required).
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.longest_flowpath(
    dem,
    basins,
    output_path="result.tif",
)

depth_to_water

depth_to_water(dem, streams=None, lakes=None, output_path=None, callback=None)

Computes cartographic depth-to-water (DTW) by least-cost accumulation from mapped surface-water source features.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
streamsVectornoOptional stream vector layer (line or multiline).
lakesVectornoOptional waterbody vector layer (polygon or multipolygon).
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.hydrologic_indices.depth_to_water(
    dem,
    streams,
    lakes,
    output_path="result.tif",
)

fill_burn

fill_burn(dem, streams, output_path=None, callback=None)

Creates a hydro-enforced DEM by burning in stream locations and then filling depressions.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
streamsVectoryesInput streams vector layer.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.fill_burn(
    dem,
    streams,
    output_path="result.tif",
)

burn_streams_at_roads

burn_streams_at_roads(dem, streams, roads, road_width, output_path=None, callback=None)

Lowers stream elevations near stream-road intersections to breach embankment effects in a DEM.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
streamsVectoryesStream vector layer.
roadsVectoryesRoad vector layer.
road_widthAnyyesMaximum embankment width in map units used to set burn reach along the stream.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.burn_streams_at_roads(
    dem,
    streams,
    roads,
    output_path="result.tif",
    width=1.0,
)

d8_mass_flux

d8_mass_flux(dem, loading, efficiency, absorption, output_path=None, callback=None)

Performs D8-based mass-flux routing, suitable for modeling movement of sediment, nutrients, or contaminants over a DEM-defined flow network.

The routed mass per cell follows:

$$ ext{outflow} = (\text{loading} - \text{absorption} + \text{inflow}) \times \text{efficiency} $$

Parameters

NameTypeRequiredDescription
demRasteryesInput depressionless DEM raster used to derive D8 flow directions.
loadingRasteryesRaster of initial mass loading values.
efficiencyRasteryesRaster of transfer efficiency values, either in [0, 1] or percent.
absorptionRasteryesRaster of per-cell mass losses in loading units.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.flow_routing.d8_mass_flux(
    dem,
    loading,
    efficiency,
    absorption,
    output_path="result.tif",
)

basins

basins(d8_pointer, esri_pntr=False, output_path=None, callback=None)

Delineates all drainage basins in a D8 pointer raster by assigning each valid cell to the edge-draining outlet basin reached along its D8 flow path.

Parameters

NameTypeRequiredDescription
d8_pointerAnyyesInput D8 pointer raster.
esri_pntrboolnoIf true, interpret pointer values using ESRI D8 encoding.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.basins(
    d8_pntr,
    output_path="result.tif",
)

watershed_from_raster_pour_points

watershed_from_raster_pour_points(d8_pointer, pour_points, esri_pntr=False, output_path=None, callback=None)

Delineates watersheds from a D8 pointer raster and a raster of pour-point outlet IDs. Each non-zero, non-NoData cell in pour_points is treated as an outlet; its cell value becomes the watershed ID for all cells that drain to it.

Algorithm notes:

  • Same two-pass flow-path labeling as basins, but seeded from user-supplied pour points rather than edge outlets.
  • Watershed IDs are inherited directly from the pour-points raster values, making it easy to use stream-link or lake ID rasters as pour-point inputs.
  • Cells where the D8 pointer is NoData are propagated as NoData in the output.

Parameters

NameTypeRequiredDescription
d8_pointerRasteryesInput D8 pointer raster.
pour_pointsRasteryesPour-points raster; non-zero, non-NoData cell values become outlet IDs.
esri_pntrboolnoIf true, interpret pointer values using ESRI D8 encoding.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.watershed_from_raster_pour_points(d8_pointer, pour_points)

watershed

watershed(d8_pointer, pour_pts, esri_pntr=False, output_path=None, callback=None)

Delineates watersheds from a D8 pointer raster and a vector point file of pour points. Each vector feature is assigned a sequential 1-based watershed ID.

Algorithm notes:

  • Pour-point coordinates are converted to raster row/col via the pointer raster's geotransform.
  • Watershed IDs are 1-based sequential integers in feature insertion order.
  • Same two-pass flow-path labeling as watershed_from_raster_pour_points.
  • Only the first coordinate of each feature is used; MultiPoint features use their first point.

Parameters

NameTypeRequiredDescription
d8_pointerAnyyesInput D8 pointer raster.
pour_ptsVectoryesInput vector file of pour points (point or multipoint geometries).
esri_pntrboolnoIf true, interpret pointer values using ESRI D8 encoding.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.watershed(
    d8_pntr,
    pour_pts,
    output_path="result.tif",
)

jenson_snap_pour_points

jenson_snap_pour_points(pour_pts, streams, snap_dist=0.0, output_path=None, callback=None)

Moves each input pour point to the nearest stream cell within a configurable search radius, snapping it onto the stream network. Preserves all input feature attributes.

Algorithm notes:

  • For each point, a square window of floor((snap_dist / cell_size) / 2) cells is searched around the point's raster position.
  • The nearest stream cell (value > 0 and not NoData) by squared Euclidean distance is chosen.
  • If no stream cell is found within the window, the point is emitted at its original location.
  • Points outside the raster extent are passed through unchanged.

Parameters

NameTypeRequiredDescription
pour_ptsVectoryesInput vector file of pour points (point or multipoint geometries).
streamsRasteryesInput stream-network raster where stream cells have value > 0 and are not NoData.
snap_distfloatnoMaximum search radius in map units. Defaults to one cell width when omitted or zero.
output_pathstringnoOutput path for the snapped pour-point vector file (required; defaults to snapped_pour_points.geojson in the working directory when not supplied to the wrapper).
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.jenson_snap_pour_points(
    pour_pts,
    streams,
    snap_dist=1.0,
    output_path="result.tif",
)

snap_pour_points

snap_pour_points(pour_pts, flow_accum, snap_dist=0.0, output_path=None, callback=None)

Moves each pour point to the highest flow-accumulation cell within a local search window. Preserves all input feature attributes.

Algorithm notes:

  • For each point, the tool scans a square search window centered on the point's raster position.
  • The output location is set to the cell center of the maximum flow_accum value found in that window.
  • If no valid cell exists in the search window (for example, all NoData), the point is emitted unchanged.
  • Points outside the raster extent are emitted unchanged.

Parameters

NameTypeRequiredDescription
pour_ptsVectoryesInput vector file of pour points (point or multipoint geometries).
flow_accumRasteryesInput flow-accumulation raster.
snap_distfloatnoMaximum search radius in map units. Defaults to one cell width when omitted or zero.
output_pathstringnoOutput path for the snapped pour-point vector file (required; defaults to snapped_pour_points.geojson in the working directory when not supplied to the wrapper).
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.snap_pour_points(
    pour_pts,
    flow_accum,
    snap_dist=1.0,
    output_path="result.tif",
)

subbasins

subbasins(d8_pointer, streams, esri_pntr=False, output_path=None, callback=None)

Identifies the catchment area of each stream link in a D8 stream network, producing a raster where every cell is labelled with the ID of the sub-basin it drains to.

Algorithm notes:

  • Performs a stream-link ID operation followed by a watershed operation.
  • Headwater stream cells receive a unique link ID. At each downstream confluence (cell with more than one inflowing stream neighbour) a new link ID is assigned.
  • All non-stream cells are labelled by walking downstream to the nearest stream-link seed.
  • Differs from hillslopes in that stream cells themselves are also labelled (not zeroed) and no left/right bank separation is applied.

Parameters

NameTypeRequiredDescription
d8_pointerAnyyesD8 pointer raster produced by d8_pointer.
streamsRasteryesStream-network raster where stream cells have value > 0 and are not NoData.
esri_pntrboolnoIf true, interpret pointer values using ESRI encoding. Default False.
output_pathstringnoOptional output raster path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.subbasins(
    d8_pntr,
    streams,
    output_path="result.tif",
)

hillslopes

hillslopes(d8_pointer, streams, esri_pntr=False, output_path=None, callback=None)

Identifies hillslope regions draining to each stream link, distinguishing left-bank and right-bank areas. Stream cells themselves are set to 0.

Algorithm notes:

  • Performs the same stream-link ID and watershed labeling as subbasins.
  • After labeling, all stream cells are zeroed.
  • A flood-fill clump pass re-numbers spatially connected regions that share the same sub-basin ID, separating left- and right-bank hillslopes.
  • Diagonal clump expansion is blocked when both adjacent cardinal cells are stream cells, preventing hillslopes from merging across the stream.

Parameters

NameTypeRequiredDescription
d8_pointerAnyyesD8 pointer raster.
streamsRasteryesStream-network raster where stream cells have value > 0 and are not NoData.
esri_pntrboolnoESRI pointer encoding flag.
output_pathstringnoOptional output raster path.
callbackfunctionnoOptional progress callback.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.hillslopes(
    d8_pntr,
    streams,
    output_path="result.tif",
)

strahler_order_basins

strahler_order_basins(d8_pointer, streams, esri_pntr=False, output_path=None, callback=None)

Delineates watershed basins whose cells are labelled by the Horton-Strahler order of the stream link that drains them.

Algorithm notes:

  • Assigns Strahler stream orders to all stream cells: headwaters receive order 1; at a confluence where two or more inflowing streams share the same order, the downstream order is incremented by 1.
  • All non-stream cells are then labelled with the Strahler order of the stream link they drain into, using the same two-pass watershed labeling as watershed.

Parameters

NameTypeRequiredDescription
d8_pointerAnyyesD8 pointer raster.
streamsRasteryesStream-network raster where stream cells have value > 0 and are not NoData.
esri_pntrboolnoESRI pointer encoding flag.
output_pathstringnoOptional output raster path.
callbackfunctionnoOptional progress callback.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.streams.ordering_metrics.strahler_order_basins(
    d8_pntr,
    streams,
    output_path="result.tif",
)

isobasins

isobasins(dem, target_size, output_path=None, callback=None)

Divides a landscape into approximately equal-sized watersheds (isobasins) by placing pour points wherever flow accumulation first exceeds a target threshold.

Algorithm notes:

  • Computes D8 flow direction internally from the DEM using steepest descent.
  • Accumulates flow cell-by-cell in topological order from headwaters downstream.
  • When a cell's cumulative upstream area reaches target_size, a pour point is created at that cell or (if it produces a closer-to-target split) at its largest-accumulation inflowing neighbour.
  • All cells are then traced downstream to their nearest pour point and assigned that basin's ID.
  • The DEM must have been hydrologically conditioned (depressions filled or breached) before use.

Parameters

NameTypeRequiredDescription
demRasteryesInput hydrologically-conditioned DEM raster.
target_sizefloatyesTarget isobasin area in number of grid cells (positive integer or float).
output_pathstringnoOptional output raster path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.watersheds_basins.isobasins(
    dem,
    target_size=1.0,
    output_path="result.tif",
)

breach_depressions_least_cost

breach_depressions_least_cost(dem, max_cost=inf, max_dist=100, flat_increment=None, fill_deps=False, minimize_dist=False, output=None)

Breaches depressions using a constrained least-cost pathway search from pit cells.

Algorithm notes:

  • Searches outward from pit cells for a lower outlet cell and cuts the least-cost breach channel through intervening terrain.
  • Usually alters the DEM less than full filling because it carves narrow channels instead of raising entire depressions.
  • Well suited to artificial barriers such as roads, berms, and embankments where a culvert-like breach is more realistic than filling.
  • fill_deps=True is useful when a small number of depressions remain unresolved after breaching.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
max_costfloat|NonenoMaximum allowed breach cost.
max_distintnoMaximum search distance in cells.
flat_incrementfloat|NonenoOptional monotonic decrement increment.
fill_depsboolnoIf true, fill unresolved depressions after breaching.
minimize_distboolnoIf true, distance-weight breach costs.
outputstringnoOptional output path.

When to use:

  • First-choice preprocessing for hydrologic conditioning in many LiDAR-derived DEM workflows.
  • Best when preserving surrounding terrain is more important than enforcing a pure fill solution.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.breach_depressions_least_cost(
    dem,
    max_cost=1.0,
    max_dist=1,
    flat_increment=1.0,
    output_path="result.tif",
)

breach_single_cell_pits

breach_single_cell_pits(dem, output=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

Breaches single-cell pits by carving local one-cell channels toward lower second-ring neighbors.

Algorithm notes:

  • Only targets isolated one-cell pit artifacts.
  • Adjusts an adjacent cell to create a local breach path toward a lower cell in the surrounding 5x5 neighborhood.
  • Very fast, but intentionally limited in scope; it does not solve larger depressions.

When to use:

  • Cheap cleanup pass before a more complete breaching or filling step.
  • Useful when DEM artifacts are dominated by isolated single-cell pits.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.breach_single_cell_pits(
    dem,
    output_path="result.tif",
)

fill_depressions

fill_depressions(dem, fix_flats=True, flat_increment=0.0001, flat_resolution="garbrecht_martz", max_depth=inf, output=None)

Fills depressions using a priority-flood strategy with optional flat resolution and optional maximum fill depth.

Algorithm notes:

  • Identifies depressions, raises them to spill elevation, and optionally imposes a very small gradient across resulting flats.
  • fix_flats=True applies a small downstream gradient so later flow-routing tools do not stall on large flat surfaces.
  • flat_resolution="garbrecht_martz" is the default and produces a more structured, less meandering flat-resolution pattern for D8-style routing. Use "natural" to recover the older natural-path behaviour that follows original within-flat topography more closely.
  • max_depth can limit how much vertical filling is allowed, which is useful when deep excavations or reservoirs should not be completely removed.
  • More aggressive than breaching because every enclosed depression is raised rather than selectively cut.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
fix_flatsboolnoIf true, impose a small gradient across filled flats.
flat_incrementfloat|NonenoFlat increment (default 0.0001).
flat_resolutionLiteral["garbrecht_martz", "natural"]|NonenoFlat-resolution mode. One of "garbrecht_martz" or "natural".
max_depthfloat|NonenoMaximum allowed fill depth.
outputstringnoOptional output path.

When to use:

  • Good general-purpose fill workflow when a complete depressionless DEM is required.
  • Appropriate when breaching would create unrealistic long cuts or when a full-fill surface is preferred.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.fill_depressions(
    dem,
    flat_increment=1.0,
    max_depth=1.0,
    flat_resolution,
    output_path="result.tif",
)

fill_depressions_planchon_and_darboux

fill_depressions_planchon_and_darboux(dem, fix_flats=True, flat_increment=0.0001, output=None)

Planchon-and-Darboux-compatible interface using the shared optimized fill backend.

Algorithm notes:

  • Compatibility-oriented interface for the classic Planchon and Darboux depression-filling formulation.
  • Included mainly for parity with legacy workflows rather than because it is the preferred modern option.
  • In practice, fill_depressions or breach_depressions_least_cost will often be the better first choice.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
fix_flatsboolnoIf true, impose a small gradient across filled flats.
flat_incrementfloat|NonenoFlat increment (default 0.0001).
outputstringnoOptional output path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.fill_depressions_planchon_and_darboux(
    dem,
    flat_increment=1.0,
    output_path="result.tif",
)

fill_depressions_wang_and_liu

fill_depressions_wang_and_liu(dem, fix_flats=True, flat_increment=0.0001, output=None)

Wang-and-Liu-compatible interface using the shared optimized fill backend.

Algorithm notes:

  • Compatibility-oriented interface for the Wang and Liu priority-queue depression-filling method.
  • Processes cells by spill elevation and is historically important, but is not the preferred default in this port.
  • Best used when reproducing older Wang-and-Liu-based workflows or published methods.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
fix_flatsboolnoIf true, impose a small gradient across filled flats.
flat_incrementfloat|NonenoFlat increment (default 0.0001).
outputstringnoOptional output path.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.fill_depressions_wang_and_liu(
    dem,
    flat_increment=1.0,
    output_path="result.tif",
)

fill_pits

fill_pits(dem, output=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

Fills single-cell pits by raising pit cells to the minimum neighboring elevation plus a small increment.

Algorithm notes:

  • Only removes isolated one-cell pits.
  • Leaves larger depressions unchanged.
  • Minimal and fast, but much less complete than full depression filling or breaching.

When to use:

  • Very lightweight preprocessing for obvious single-cell artifacts.
  • A quick first pass before running fill_depressions or breach_depressions_least_cost.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.fill_pits(
    dem,
    output_path="result.tif",
)

depth_in_sink

depth_in_sink(dem, zero_background=False, output_path=None, callback=None)

Measures the vertical depth of each cell within topographic depressions by differencing a depression-filled DEM and the original DEM.

Algorithm notes:

  • Internally generates a filled DEM surface and computes filled_dem - dem for each valid cell.
  • Positive values indicate depression depth.
  • Non-sink cells are assigned NoData by default, or 0.0 when zero_background=True.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
zero_backgroundboolnoIf true, assign 0.0 to cells outside sinks; otherwise assign NoData.
output_pathstringnoOptional output raster path.
callbackfunctionnoOptional progress callback.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.depth_in_sink(
    dem,
    output_path="result.tif",
)

sink

sink(dem, zero_background=False, output_path=None, callback=None)

Creates a binary raster identifying cells that belong to topographic depressions.

Algorithm notes:

  • Uses the same filled-vs-original DEM differencing approach as depth_in_sink.
  • Cells with positive depth are classified as sink cells (1).
  • Non-sink cells are assigned NoData by default, or 0.0 when zero_background=True.

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
zero_backgroundboolnoIf true, assign 0.0 to cells outside sinks; otherwise assign NoData.
output_pathstringnoOptional output raster path.
callbackfunctionnoOptional progress callback.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.hydrology.depressions_storage.sink(
    dem,
    output_path="result.tif",
)

GIS And Vector

GIS Tools

This document covers the GIS tools currently ported into the backend.

GIS Workflow Products (Pro)

These workflow methods expose higher-level environmental monitoring and siting products.

Workflow Product Index

  • wetland_hydrogeomorphic_classification
  • urban_expansion_impact_assessment
  • wind_turbine_siting
  • solar_site_suitability_analysis
  • corridor_mapping_intelligence
  • landslide_susceptibility_assessment
  • river_corridor_health_assessment

wetland_hydrogeomorphic_classification

wetland_hydrogeomorphic_classification(dem, wetland_mask, max_polygon_features=10000, output_prefix=None, callback=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
wetland_maskRasteryesInput raster for wetland_mask.
max_polygon_featuresintnoNumeric parameter for max_polygon_features.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns (hgm_class_raster, wetland_polygons_vector, confidence_raster, summary_json_path).

Outputs

Returned as tuple[Raster, Vector, Raster, str] in this order:

  • cls: Raster
  • polys: Vector
  • conf: Raster
  • summary: str

Example:

hgm, polygons, confidence, summary = wbe.terrain.workflow_products.wetland_hydrogeomorphic_classification(
	dem=dem,
	wetland_mask=wetland_mask,
)

urban_expansion_impact_assessment

urban_expansion_impact_assessment(baseline_urban, scenario_urban, streams, habitat_sensitivity=None, output_prefix=None, callback=None)

Parameters

NameTypeRequiredDescription
baseline_urbanRasteryesInput raster for baseline_urban.
scenario_urbanRasteryesInput raster for scenario_urban.
streamsVectoryesInput vector layer for streams.
habitat_sensitivityRasternoInput raster for habitat_sensitivity.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns (impact_severity_raster, affected_streams_vector, habitat_loss_raster, summary_json_path).

Outputs

Returned as tuple[Raster, Vector, Raster, str] in this order:

  • impact: Raster
  • affected: Vector
  • habitat: Raster
  • summary: str

Example:

impact, streams_out, habitat_loss, summary = wbe.terrain.workflow_products.urban_expansion_impact_assessment(
	baseline_urban=urban_2020,
	scenario_urban=urban_2035,
	streams=streams,
	habitat_sensitivity=habitat_sensitivity,
)

wind_turbine_siting

wind_turbine_siting(dem, settlements, settlements_epsg=None, visibility_radius_meters=5000, min_slope_degrees=5.0, max_slope_degrees=35.0, profile="balanced", sweep_spec_json=None, output_prefix=None, callback=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
settlementsVectoryesInput vector layer for settlements.
settlements_epsgint |NonenoNumeric parameter for settlements_epsg.
visibility_radius_metersintnoNumeric parameter for visibility_radius_meters.
min_slope_degreesfloatnoNumeric parameter for min_slope_degrees.
max_slope_degreesfloatnoNumeric parameter for max_slope_degrees.
profilestringnoString parameter for profile.
sweep_spec_jsonstring |NonenoString parameter for sweep_spec_json.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns (siting_score_raster, confidence_raster, summary_json_path).

When sweep_spec_json is provided, the runtime also emits run_matrix_summary, sensitivity_report, sensitivity_report_html, and stability_map outputs. The sensitivity report includes metrics.primary_metric, metrics.primary_relative_span, and metrics.stability_class (high, medium, low).

Outputs

Returned as tuple[Raster, Raster, str, str] in this order:

  • score: Raster
  • confidence: Raster
  • summary: str
  • threshold_sensitivity: str

Example:

score, confidence, summary = wbe.terrain.workflow_products.wind_turbine_siting(
	dem=dem,
	settlements=settlements,
	profile="balanced",
)

solar_site_suitability_analysis

solar_site_suitability_analysis(dem, candidate_threshold=0.7, max_candidate_sites=200, sweep_spec_json=None, output_prefix=None, callback=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
transmission_linesVectornoInput vector layer for transmission_lines.
substationsVectornoInput vector layer for substations.
road_networkVectornoInput vector layer for road_network.
infra_weight_profilestringyesString parameter for infra_weight_profile.
candidate_thresholdfloatnoNumeric parameter for candidate_threshold.
max_candidate_sitesintnoNumeric parameter for max_candidate_sites.
sweep_spec_jsonstring |NonenoString parameter for sweep_spec_json.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns (suitability_score_raster, visual_impact_raster, candidate_sites_vector, summary_json_path).

When sweep_spec_json is provided, the runtime also emits run_matrix_summary, sensitivity_report, sensitivity_report_html, and stability_map outputs. The sensitivity report includes metrics.primary_metric, metrics.primary_relative_span, and metrics.stability_class (high, medium, low).

Outputs

Returned as tuple[Raster, Raster, Vector, str] in this order:

  • score: Raster
  • impact: Raster
  • sites: Vector
  • summary: str

Example:

score, impact, sites, summary = wbe.terrain.workflow_products.solar_site_suitability_analysis(
	dem=dem,
	candidate_threshold=0.7,
)

corridor_mapping_intelligence

corridor_mapping_intelligence(dem, start_features, end_features, constraints=None, cost_profile="slope_roughness", terminal_anchor_strategy="mixed", corridor_tolerance=0.15, output_prefix=None, callback=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
start_featuresVectoryesInput vector layer for start_features.
end_featuresVectoryesInput vector layer for end_features.
constraintsVectornoInput vector layer for constraints.
cost_profilestringnoString parameter for cost_profile.
terminal_anchor_strategystringnoString parameter for terminal_anchor_strategy.
corridor_tolerancefloatnoNumeric parameter for corridor_tolerance.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns (cost_surface_raster, accumulated_cost_raster, optimal_route_vector, corridor_suitability_raster, summary_json_path).

Finds the terrain least-cost route and corridor suitability band for siting linear infrastructure (roads, pipelines, utility lines). start_features and end_features are vector layers containing point and/or polygon features. cost_profile is one of "slope_only", "slope_roughness" (default), or "conservative". terminal_anchor_strategy is one of "mixed" (default), "centroid_only", or "boundary_only". corridor_tolerance is the fractional cost margin above optimal for the suitability band (default 0.15).

Value proposition vs OSS least-cost building blocks:

  • This is an end-to-end workflow product rather than a low-level routing primitive.
  • It derives a terrain cost surface from DEM slope/roughness, runs least-cost routing, and emits both route geometry and corridor alternatives in one call.
  • It supports polygon exclusion constraints and returns a summary JSON contract for reporting/automation.

Endpoint modeling note:

  • Current API is vector-first for terminal modeling.
  • Point features are used directly as candidate anchors.
  • Polygon features contribute sampled boundary/centroid candidates, and the tool chooses a traversable anchor pair.
  • terminal_anchor_strategy controls polygon anchor candidate generation.
  • If start/end layers differ from DEM CRS, they are reprojected to the DEM CRS before routing.
  • If constraints differ from DEM CRS, they are reprojected to the DEM CRS before exclusion masking.
  • DEM, start/end layers, and optional constraints must include EPSG metadata for CRS harmonization.

QA-style outputs:

  • cost_surface_raster, accumulated_cost_raster, and corridor_suitability_raster provide inspectable diagnostic surfaces.
  • optimal_route_vector includes comparative route attributes (ROUTE_LEN_M, MEAN_SLOPE, ROUTE_COST, PROFILE).
  • summary_json_path stores reproducible run metadata and key metrics.

Outputs

Returned as tuple[Raster, Raster, Vector, Raster, str] in this order:

  • cost_surface: Raster
  • accumulated_cost: Raster
  • optimal_route: Vector
  • corridor_suitability: Raster
  • summary: str

Example:

cost, acc_cost, route, suitability, summary = wbe.terrain.workflow_products.corridor_mapping_intelligence(
	dem=dem,
	start_features=start_features,
	end_features=end_features,
	cost_profile="slope_roughness",
	terminal_anchor_strategy="mixed",
	corridor_tolerance=0.15,
	output_prefix="output/access_road",
)

landslide_susceptibility_assessment

landslide_susceptibility_assessment(dem, rainfall_intensity=None, profile="balanced", susceptibility_threshold=0.65, max_zone_features=5000, output_prefix=None, callback=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
rainfall_intensityRasternoInput raster for rainfall_intensity.
profilestringnoString parameter for profile.
susceptibility_thresholdfloatnoNumeric parameter for susceptibility_threshold.
max_zone_featuresintnoNumeric parameter for max_zone_features.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns (susceptibility_raster, trigger_pressure_raster, confidence_raster, risk_zones_vector, summary_json_path).

Outputs

Returned as tuple[Raster, Raster, Raster, Vector, str] in this order:

  • susceptibility: Raster
  • trigger: Raster
  • confidence: Raster
  • zones: Vector
  • summary: str

Example:

sus, trigger, confidence, zones, summary = wbe.terrain.workflow_products.landslide_susceptibility_assessment(
	dem=dem,
	rainfall_intensity=rainfall,
	profile="balanced",
)

river_corridor_health_assessment

river_corridor_health_assessment(dem, streams, profile="balanced", output_prefix=None, callback=None)

Parameters

NameTypeRequiredDescription
demRasteryesInput DEM raster.
streamsVectoryesInput vector layer for streams.
profilestringnoString parameter for profile.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns (erosion_pressure_raster, corridor_confidence_raster, stream_health_score_raster, restoration_zones_vector, summary_json_path).

Outputs

Returned as tuple[Raster, Raster, Raster, Vector, str] in this order:

  • erosion: Raster
  • confidence: Raster
  • health: Raster
  • zones: Vector
  • summary: str

Example:

erosion, confidence, health, restoration, summary = wbe.terrain.workflow_products.river_corridor_health_assessment(
	dem=dem,
	streams=streams,
	profile="balanced",
)

GIS (Raster Overlay)

These tools compare or combine aligned raster stacks on a cell-by-cell basis. Use them when the rasters already share the same grid geometry and you want overlay-style summaries or index outputs.

Overlay Tool Index

  • average_overlay
  • count_if
  • highest_position
  • lowest_position
  • max_absolute_overlay
  • max_overlay
  • min_absolute_overlay
  • min_overlay
  • multiply_overlay
  • percent_equal_to
  • percent_greater_than
  • percent_less_than
  • pick_from_list
  • standard_deviation_overlay
  • sum_overlay
  • weighted_overlay
  • weighted_sum

GIS (Raster Aggregation and Point-Block Rasterization)

These tools are GIS raster utilities but are not raster overlay operations. They aggregate rasters, create synthetic rasters, find extrema, interpolate from points, rasterize point blocks, or derive footprint geometries.

Aggregation and Block Tool Index

  • aggregate_raster
  • buffer_raster
  • centroid_raster
  • clump
  • create_plane
  • find_lowest_or_highest_points
  • heat_map
  • hexagonal_grid_from_raster_base
  • hexagonal_grid_from_vector_base
  • idw_interpolation
  • layer_footprint_raster
  • layer_footprint_vector
  • map_features
  • rectangular_grid_from_raster_base
  • rectangular_grid_from_vector_base
  • natural_neighbour_interpolation
  • nearest_neighbour_interpolation
  • modified_shepard_interpolation
  • radial_basis_function_interpolation
  • raster_cell_assignment
  • nibble
  • sieve
  • tin_interpolation
  • block_maximum
  • block_minimum

find_lowest_or_highest_points

find_lowest_or_highest_points(input, output_type="lowest", output_path=None, callback=None)

Finds the lowest and/or highest raster cell locations and outputs them as vector points.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
output_typestringnoOne of lowest, highest, or both.
output_pathstringnoOptional output vector path. If omitted, an auto-derived GeoJSON path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.find_lowest_or_highest_points(
    input,
    output_type="value",
    output_path="result.tif",
)

aggregate_raster

aggregate_raster(input, aggregation_factor=2, aggregation_type="mean", output_path=None, callback=None)

Reduces raster resolution by aggregating fixed-size source blocks using mean, sum, maximum, minimum, or range.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
aggregation_factorintnoInteger block size in source cells.
aggregation_typestringnoAggregation statistic to compute.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.aggregate_raster(
    input,
    aggregation_factor=1,
    aggregation_type="value",
    output_path="result.tif",
)

create_plane

create_plane(base, gradient, aspect, constant, output_path=None, callback=None)

Creates a raster from a planar equation using a base raster for output geometry.

Parameters

NameTypeRequiredDescription
baseRasteryesBase raster providing output extent, resolution, and CRS.
gradientfloatyesPlane slope gradient in degrees.
aspectfloatyesPlane aspect in degrees.
constantfloatyesAdditive constant term.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.create_plane(
    base,
    gradient=1.0,
    aspect=1.0,
    constant=1.0,
    output_path="result.tif",
)

centroid_raster

centroid_raster(input, output_path=None, callback=None)

Calculates centroid cells for positive patch IDs in a raster and returns both output raster and a textual report.

Parameters

NameTypeRequiredDescription
inputRasteryesInput patch raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Raster, str] in this order:

  • result: Raster
  • string_2: str

WbEnvironment usage

raster_1, string_2 = wbe.raster.centroid_raster(
    input,
    output_path="result.tif",
)

buffer_raster

buffer_raster(input, buffer_size, grid_cell_units=False, output_path=None, callback=None)

Creates a binary buffer around non-zero, non-NoData raster cells.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster where non-zero cells are buffer targets.
buffer_sizefloatyesBuffer distance threshold.
grid_cell_unitsboolnoIf True, interprets buffer_size in grid-cell units instead of map units.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.distance_cost.buffer_raster(
    input,
    buffer_size=1.0,
    output_path="result.tif",
)

clump

clump(input, diag=False, zero_background=False, output_path=None, callback=None)

Groups contiguous equal-valued raster cells into unique patch IDs.

Parameters

NameTypeRequiredDescription
inputRasteryesInput categorical raster.
diagboolnoIf True, uses 8-neighbour connectivity; otherwise 4-neighbour.
zero_backgroundboolnoIf True, preserves zero-valued cells as background.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.clump(
    input,
    output_path="result.tif",
)

nibble

nibble(input, mask, use_nodata=False, nibble_nodata=True, output_path=None, callback=None)

Fills background regions in a raster by propagating values from nearest foreground cells, constrained by a mask raster.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster to fill.
maskRasteryesBinary mask raster (non-zero cells are preserved/eligible).
use_nodataboolnoIf True, treats input NoData as a class value during nibbling.
nibble_nodataboolnoIf True, restores NoData behavior for masked NoData regions.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.nibble(
    input,
    mask,
    output_path="result.tif",
)

sieve

sieve(input, threshold=1.0, zero_background=False, output_path=None, callback=None)

Removes small raster patches below a cell-count threshold by replacing them with neighbouring larger-patch values.

Parameters

NameTypeRequiredDescription
inputRasteryesInput categorical raster.
thresholdfloatnoMinimum patch size in grid cells to retain.
zero_backgroundboolnoIf True, preserves original zero-valued background as zero.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.sieve(
    input,
    threshold=1.0,
    output_path="result.tif",
)

heat_map

heat_map(points, bandwidth, field_name=None, cell_size=None, base_raster=None, kernel_function="quartic", output_path=None, callback=None)

Generates a kernel-density heat map raster from point occurrences.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestring|NonenoOptional numeric weight field; if omitted, each point contributes weight 1.
bandwidthfloatyesKernel bandwidth in map units.
cell_sizefloat|NonenoOutput cell size when base_raster is not provided.
base_rasterRasternoOptional base raster controlling output geometry.
kernel_functionstringnoKernel function type such as quartic, gaussian, triangular, or uniform.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.heat_map(
    points,
    bandwidth=1.0,
    field_name="value",
    cell_size=1.0,
    base_raster,
    kernel_function="value",
    output_path="result.tif",
)

idw_interpolation

idw_interpolation(points, field_name="FID", use_z=False, weight=2.0, radius=0.0, min_points=0, cell_size=None, base_raster=None, output_path=None, callback=None)

Interpolates a raster from point samples using inverse-distance weighting.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field; defaults to FID fallback.
use_zboolnoIf True, uses point Z values instead of attributes.
weightfloatnoIDW distance exponent.
radiusfloatnoOptional neighbourhood radius in map units.
min_pointsintnoMinimum number of neighbours to use.
cell_sizefloat|NonenoOutput cell size when base_raster is not provided.
base_rasterRasternoOptional base raster controlling output geometry.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.idw_interpolation(
    points,
    field_name="value",
    weight=1.0,
    radius=1.0,
    min_points=1,
    cell_size=1.0,
    base_raster,
    output_path="result.tif",
)

layer_footprint_raster

layer_footprint_raster(input, output_path=None, callback=None)

Creates a rectangular polygon footprint from the full spatial extent of a raster.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
output_pathstringnoOptional output vector path. If omitted, an auto-derived GeoJSON path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.layer_footprint_raster(
    input,
    output_path="result.tif",
)

layer_footprint_vector

layer_footprint_vector(input, output_path=None, callback=None)

Creates a rectangular polygon footprint from the full bounding box of a vector layer.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.layer_footprint_vector(
    input,
    output_path="result.tif",
)

hexagonal_grid_from_raster_base

hexagonal_grid_from_raster_base(base, width, orientation="h", output_path=None, callback=None)

Creates a hexagonal polygon grid using the extent of a base raster.

Parameters

NameTypeRequiredDescription
baseRasteryesBase raster controlling output extent.
widthfloatyesHexagon width in map units.
orientationstringnoHexagon orientation ("h"/horizontal or "v"/vertical).
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.hexagonal_grid_from_raster_base(
    base,
    width=1.0,
    orientation="value",
    output_path="result.tif",
)

hexagonal_grid_from_vector_base

hexagonal_grid_from_vector_base(base, width, orientation="h", output_path=None, callback=None)

Creates a hexagonal polygon grid using the bounding extent of a base vector layer.

Parameters

NameTypeRequiredDescription
baseVectoryesBase vector layer controlling output extent.
widthfloatyesHexagon width in map units.
orientationstringnoHexagon orientation ("h"/horizontal or "v"/vertical).
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.hexagonal_grid_from_vector_base(
    base,
    width=1.0,
    orientation="value",
    output_path="result.tif",
)

rectangular_grid_from_raster_base

rectangular_grid_from_raster_base(base, width, height, x_origin=0.0, y_origin=0.0, output_path=None, callback=None)

Creates a rectangular polygon grid using the extent of a base raster.

Parameters

NameTypeRequiredDescription
baseRasteryesBase raster controlling output extent.
widthfloatyesGrid cell width in map units.
heightfloatyesGrid cell height in map units.
x_originfloatnoOptional x-origin used to align the grid.
y_originfloatnoOptional y-origin used to align the grid.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.rectangular_grid_from_raster_base(
    base,
    width=1.0,
    height=1.0,
    x_origin=1.0,
    y_origin=1.0,
    output_path="result.tif",
)

rectangular_grid_from_vector_base

rectangular_grid_from_vector_base(base, width, height, x_origin=0.0, y_origin=0.0, output_path=None, callback=None)

Creates a rectangular polygon grid using the bounding extent of a base vector layer.

Parameters

NameTypeRequiredDescription
baseVectoryesBase vector layer controlling output extent.
widthfloatyesGrid cell width in map units.
heightfloatyesGrid cell height in map units.
x_originfloatnoOptional x-origin used to align the grid.
y_originfloatnoOptional y-origin used to align the grid.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.rectangular_grid_from_vector_base(
    base,
    width=1.0,
    height=1.0,
    x_origin=1.0,
    y_origin=1.0,
    output_path="result.tif",
)

map_features

map_features(input, min_feature_height, min_feature_size=1, output_path=None, callback=None)

Labels discrete terrain features in a raster using descending-priority region growth and small-feature merging.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
min_feature_heightfloatyesMinimum vertical separation required for separate features.
min_feature_sizeintnoMinimum retained feature size in cells.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.map_features(
    input,
    min_feature_height=1.0,
    min_feature_size=1,
    output_path="result.tif",
)

natural_neighbour_interpolation

natural_neighbour_interpolation(points, field_name="FID", use_z=False, cell_size=None, base_raster=None, clip_to_hull=True, output_path=None, callback=None)

Interpolates a raster from point samples using Delaunay-neighbour weighted interpolation.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field; defaults to FID fallback.
use_zboolnoIf True, uses point Z values instead of attributes.
cell_sizefloat|NonenoOutput cell size when base_raster is not provided.
base_rasterRasternoOptional base raster controlling output geometry.
clip_to_hullboolnoIf True, limits interpolation to the points' convex hull.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.local_neighborhood.natural_neighbour_interpolation(
    points,
    field_name="value",
    cell_size=1.0,
    base_raster,
    output_path="result.tif",
)

nearest_neighbour_interpolation

nearest_neighbour_interpolation(points, field_name="FID", use_z=False, cell_size=None, base_raster=None, max_dist=None, output_path=None, callback=None)

Interpolates a raster from point samples using nearest-neighbour assignment.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field; defaults to FID fallback.
use_zboolnoIf True, uses point Z values instead of attributes.
cell_sizefloat|NonenoOutput cell size when base_raster is not provided.
base_rasterRasternoOptional base raster controlling output geometry.
max_distfloat|NonenoOptional maximum search distance in map units.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.local_neighborhood.nearest_neighbour_interpolation(
    points,
    field_name="value",
    cell_size=1.0,
    base_raster,
    max_dist=1.0,
    output_path="result.tif",
)

modified_shepard_interpolation

modified_shepard_interpolation(points, field_name="FID", use_z=False, weight=2.0, radius=0.0, min_points=8, use_quadratic_basis=False, cell_size=None, base_raster=None, use_data_hull=False, output_path=None, callback=None)

Interpolates a raster from point samples using modified Shepard weighting.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field; defaults to FID fallback.
use_zboolnoIf True, uses point Z values instead of attributes.
weightfloatnoShepard weight exponent.
radiusfloatnoOptional neighbourhood radius in map units.
min_pointsintnoMinimum number of neighbours to use.
use_quadratic_basisboolnoOptional local basis flag (reserved for parity refinement).
cell_sizefloat|NonenoOutput cell size when base_raster is not provided.
base_rasterRasternoOptional base raster controlling output geometry.
use_data_hullboolnoIf True, limits interpolation to the points' convex hull.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.modified_shepard_interpolation(
    points,
    field_name="value",
    weight=1.0,
    radius=1.0,
    min_points=1,
    cell_size=1.0,
    base_raster,
    output_path="result.tif",
)

radial_basis_function_interpolation

radial_basis_function_interpolation(points, field_name="FID", use_z=False, radius=0.0, min_points=16, cell_size=None, base_raster=None, func_type="thinplatespline", poly_order="none", weight=0.1, approximate_mode=True, output_path=None, callback=None)

Interpolates a raster from point samples using local radial-basis similarity weighting.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field; defaults to FID fallback.
use_zboolnoIf True, uses point Z values instead of attributes.
radiusfloatnoOptional neighbourhood radius in map units.
min_pointsintnoMinimum number of neighbours to use.
cell_sizefloat|NonenoOutput cell size when base_raster is not provided.
base_rasterRasternoOptional base raster controlling output geometry.
func_typeLiteral["thinplatespline", "polyharmonic", "gaussian", "multiquadric", "inversemultiquadric"]noBasis type (thinplatespline, polyharmonic, gaussian, multiquadric, inversemultiquadric).
poly_orderLiteral["none", "constant", "quadratic"]noPolynomial order hint (none, constant, quadratic).
weightfloatnoBasis shape/exponent parameter.
approximate_modeboolnoIf True, uses the NG approximate local neighborhood strategy; if False, uses legacy-style exhaustive evaluation.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.radial_basis_function_interpolation(
    points,
    field_name="value",
    radius=1.0,
    min_points=1,
    cell_size=1.0,
    base_raster,
    func_type,
    poly_order,
    weight=1.0,
    output_path="result.tif",
)

tin_interpolation

tin_interpolation(points, field_name="FID", use_z=False, cell_size=None, base_raster=None, max_triangle_edge_length=None, output_path=None, callback=None)

Interpolates a raster from point samples using Delaunay triangulation and planar interpolation within each triangle.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field; defaults to FID fallback.
use_zboolnoIf True, uses point Z values instead of attributes.
cell_sizefloat|NonenoOutput cell size when base_raster is not provided.
base_rasterRasternoOptional base raster controlling output geometry.
max_triangle_edge_lengthfloat|NonenoOptional maximum allowed triangle edge length in map units.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.tin_interpolation(
    points,
    field_name="value",
    cell_size=1.0,
    base_raster,
    max_triangle_edge_length=1.0,
    output_path="result.tif",
)

raster_cell_assignment

raster_cell_assignment(input, what_to_assign="column", output_path=None, callback=None)

Creates a raster from a base raster by assigning each cell its row number, column number, x coordinate, or y coordinate.

Parameters

NameTypeRequiredDescription
inputRasteryesInput base raster.
what_to_assignLiteral["column", "row", "x", "y"]noOne of column, row, x, or y.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.raster_cell_assignment(
    input,
    what_to_assign,
    output_path="result.tif",
)

block_maximum

block_maximum(points, field_name=None, use_z=False, cell_size=None, base_raster=None, output_path=None, callback=None)

Rasterizes point features by assigning the maximum observed value within each output cell.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field. If omitted or unavailable, the tool falls back to feature IDs.
use_zboolnoWhen True, use point Z values instead of attributes.
cell_sizefloatnoOutput cell size when base_raster is not supplied.
base_rasterRasternoOptional raster supplying output geometry.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.block_maximum(
    points,
    field_name="value",
    cell_size=1.0,
    base_raster,
    output_path="result.tif",
)

block_minimum

block_minimum(points, field_name=None, use_z=False, cell_size=None, base_raster=None, output_path=None, callback=None)

Rasterizes point features by assigning the minimum observed value within each output cell.

Parameters

NameTypeRequiredDescription
pointsVectoryesInput points vector layer.
field_namestringnoOptional numeric attribute field. If omitted or unavailable, the tool falls back to feature IDs.
use_zboolnoWhen True, use point Z values instead of attributes.
cell_sizefloatnoOutput cell size when base_raster is not supplied.
base_rasterRasternoOptional raster supplying output geometry.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

GIS (Bounding And Reclassification)

These tools create vector bounding geometries and reclassify labelled rasters.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.block_minimum(
    points,
    field_name="value",
    cell_size=1.0,
    base_raster,
    output_path="result.tif",
)

Bounding And Reclassification Tool Index

  • minimum_convex_hull
  • minimum_bounding_box
  • minimum_bounding_circle
  • minimum_bounding_envelope
  • medoid
  • reclass
  • reclass_equal_interval
  • filter_raster_features_by_area

medoid

medoid(input, output_path=None, callback=None)

Creates medoid point output from vector geometries; for point layers this returns one medoid for the full set, and for non-point layers one medoid per feature.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.medoid(
    input,
    output_path="result.tif",
)

minimum_convex_hull

minimum_convex_hull(input, individual_feature_hulls=True, output_path=None, callback=None)

Creates convex hull polygons around vector features.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
individual_feature_hullsboolnoIf True, output one hull per input feature; if False, output one hull for the full layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.minimum_convex_hull(
    input,
    output_path="result.tif",
)

minimum_bounding_box

minimum_bounding_box(input, min_criteria="area", individual_feature_hulls=True, output_path=None, callback=None)

Creates oriented minimum bounding box polygons around vector features.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
min_criteriaLiteral["area", "perimeter", "length", "width"]noOptimization target ("area", "perimeter", "length", or "width").
individual_feature_hullsboolnoIf True, output one box per input feature; if False, output one box for the full layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.minimum_bounding_box(
    input,
    min_criteria,
    output_path="result.tif",
)

minimum_bounding_circle

minimum_bounding_circle(input, individual_feature_hulls=True, output_path=None, callback=None)

Creates minimum enclosing circle polygons around vector features.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
individual_feature_hullsboolnoIf True, output one circle per input feature; if False, output one circle for the full layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.minimum_bounding_circle(
    input,
    output_path="result.tif",
)

minimum_bounding_envelope

minimum_bounding_envelope(input, individual_feature_hulls=True, output_path=None, callback=None)

Creates axis-aligned minimum bounding envelope polygons around vector features.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
individual_feature_hullsboolnoIf True, output one envelope per input feature; if False, output one envelope for the full layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.minimum_bounding_envelope(
    input,
    output_path="result.tif",
)

reclass

reclass(input, reclass_values, assign_mode=False, output_path=None, callback=None)

Reclassifies raster values using either value ranges or exact assignment pairs.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
reclass_valueslist[list[float]]yesReclassification rows. Use [new, from, to_less_than] for range mode, or [new, old] when assign_mode=True.
assign_modeboolnoIf True, interpret reclass_values rows as exact assignment pairs.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.reclass_mask.reclass(
    input,
    [reclass_values_1, reclass_values_2],
    output_path="result.tif",
)

reclass_equal_interval

reclass_equal_interval(input, interval_size, start_value=None, end_value=None, output_path=None, callback=None)

Reclassifies raster values into equal-width intervals.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
interval_sizefloatyesInterval width used for binning.
start_valuefloat|NonenoOptional lower bound of the reclassification range.
end_valuefloat|NonenoOptional upper bound of the reclassification range.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.reclass_mask.reclass_equal_interval(
    input,
    interval_size=1.0,
    start_value=1.0,
    end_value=1.0,
    output_path="result.tif",
)

filter_raster_features_by_area

filter_raster_features_by_area(input, threshold, zero_background=False, output_path=None, callback=None)

Removes integer-labelled raster features smaller than a cell-count threshold.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster containing integer-labelled features.
thresholdintyesMinimum feature size in cells to retain.
zero_backgroundboolnoIf True, removed features are assigned zero; otherwise they are assigned NoData.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

GIS (Vector Overlay And Linework)

These tools perform vector overlay, line splitting/merging, and polygon generation from linework.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.filter_raster_features_by_area(
    input,
    threshold=1,
    output_path="result.tif",
)

Vector Overlay And Linework Tool Index

  • centroid_vector
  • clip
  • difference
  • dissolve
  • eliminate_coincident_points
  • erase
  • extend_vector_lines
  • extract_by_attribute
  • snap_endnodes
  • smooth_vectors
  • split_vector_lines
  • extract_nodes
  • filter_vector_features_by_area
  • intersect
  • line_intersections
  • merge_line_segments
  • polygonize
  • split_with_lines
  • symmetrical_difference
  • union
  • voronoi_diagram
  • travelling_salesman_problem
  • construct_vector_tin
  • vector_hex_binning

extract_by_attribute

extract_by_attribute(input, statement, output_path=None, callback=None)

Extracts vector features whose attributes satisfy a boolean expression.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
statementstringyesBoolean expression evaluated against attribute field names.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.attribute_analysis.extract_by_attribute(
    input,
    statement="value",
    output_path="result.tif",
)

extract_raster_values_at_points

extract_raster_values_at_points(rasters, points, output_path=None, callback=None)

Samples one or more rasters at point locations and writes the values to new VALUE1, VALUE2, ... fields on the output point layer. Returns (vector, report_text).

Parameters

NameTypeRequiredDescription
rastersRasteryesList of input rasters to sample.
pointsVectoryesInput points vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Vector, str] in this order:

  • result: Vector
  • string_2: str

WbEnvironment usage

vector_1, string_2 = wbe.vector.sampling_gridding.extract_raster_values_at_points(
    rasters,
    points,
    output_path="result.tif",
)

centroid_vector

centroid_vector(input, output_path=None, callback=None)

Computes centroid points from vector features.

For point inputs, the output is one centroid point representing the mean location of all points. For non-point inputs, the output contains one centroid point per input feature.

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.centroid_vector(
    input,
    output_path="result.tif",
)

clip

clip(input, overlay, output_path=None, callback=None, snap_tolerance=None)

Clips input polygons to overlay polygon boundaries.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
overlayVectoryesOverlay polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.
snap_tolerancefloat|NonenoOptional overlay snapping tolerance.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.clip(
    input,
    overlay,
    output_path="result.tif",
    snap_tolerance=1.0,
)

dissolve

dissolve(input, dissolve_field="", snap_tolerance=EPSILON, output_path=None, callback=None)

Removes shared polygon boundaries globally or within dissolve-field groups.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
dissolve_fieldstringnoOptional field name used to dissolve polygons within attribute groups.
snap_tolerancefloatnoSnapping tolerance used by topology operations.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.dissolve(
    input,
    dissolve_field="value",
    snap_tolerance=1.0,
    output_path="result.tif",
)

extract_nodes

extract_nodes(input, output_path=None, callback=None)

Converts polyline or polygon vertices into output point features.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polyline or polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.extract_nodes(
    input,
    output_path="result.tif",
)

filter_vector_features_by_area

filter_vector_features_by_area(input, threshold, output_path=None, callback=None)

Removes polygon features smaller than the specified area threshold.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
thresholdfloatyesMinimum polygon area to retain.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.attribute_analysis.filter_vector_features_by_area(
    input,
    threshold=1.0,
    output_path="result.tif",
)

extend_vector_lines

extend_vector_lines(input, distance, extend_direction="both", output_path=None, callback=None)

Extends line features by moving the start endpoint, end endpoint, or both along the local line direction.

Parameters

NameTypeRequiredDescription
inputVectoryesInput line vector layer.
distancefloatyesExtension distance in map units.
extend_directionLiteral["both", "start", "end"]noOne of "both", "start", or "end".
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.extend_vector_lines(
    input,
    distance=1.0,
    extend_direction,
    output_path="result.tif",
)

smooth_vectors

smooth_vectors(input, filter_size=3, output_path=None, callback=None)

Smooths polyline and polygon geometries using an odd-sized moving-average window.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polyline or polygon vector layer.
filter_sizeintnoSmoothing window size (odd integer >= 3; even values are adjusted to the next odd value).
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.smooth_vectors(
    input,
    filter_size=1,
    output_path="result.tif",
)

split_vector_lines

split_vector_lines(input, segment_length, output_path=None, callback=None)

Divides polyline features into segments of a maximum specified length. Each output segment becomes a separate feature. The output attributes include FID, PARENT_ID (the 1-based index of the originating input feature), and all other input attributes.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polyline vector layer.
segment_lengthfloatyesMaximum segment length in map units (must be > 0).
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.split_vector_lines(
    input,
    segment_length=1.0,
    output_path="result.tif",
)

snap_endnodes

snap_endnodes(input, snap_tolerance=EPSILON, output_path=None, callback=None)

Snaps nearby polyline start/end nodes to shared coordinates within the specified tolerance.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polyline vector layer.
snap_tolerancefloatnoEndpoint snapping tolerance in map units.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.snap_endnodes(
    input,
    snap_tolerance=1.0,
    output_path="result.tif",
)

line_intersections

line_intersections(input1, input2, output_path=None, callback=None, snap_tolerance=None)

Finds intersection points between line or polygon boundaries in two input vector layers.

Parameters

NameTypeRequiredDescription
input1VectoryesFirst input vector layer.
input2VectoryesSecond input vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.
snap_tolerancefloat|NonenoOptional intersection snapping tolerance.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.line_intersections(
    input1,
    input2,
    output_path="result.tif",
    snap_tolerance=1.0,
)

merge_line_segments

merge_line_segments(input, snap_tolerance=EPSILON, output_path=None, callback=None)

Merges connected line segments whose endpoints match within the snap tolerance.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polyline vector layer.
snap_tolerancefloatnoEndpoint snapping tolerance.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.merge_line_segments(
    input,
    snap_tolerance=1.0,
    output_path="result.tif",
)

polygonize

polygonize(input_layers, snap_tolerance=EPSILON, output_path=None, callback=None)

Creates polygons from closed rings in one or more input line layers.

Parameters

NameTypeRequiredDescription
input_layersVectoryesList of input line vector layers.
snap_tolerancefloatnoSnapping tolerance used while polygonizing.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.polygonize(
    input_layers,
    snap_tolerance=1.0,
    output_path="result.tif",
)

split_with_lines

split_with_lines(input, split_vector, snap_tolerance=EPSILON, output_path=None, callback=None)

Splits line features in the input layer at intersections with a split line layer.

Parameters

NameTypeRequiredDescription
inputVectoryesInput line vector layer to split.
split_vectorVectoryesLine vector layer defining split locations.
snap_tolerancefloatnoSnapping tolerance used during splitting.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.split_with_lines(
    input,
    split_vector,
    snap_tolerance=1.0,
    output_path="result.tif",
)

symmetrical_difference

symmetrical_difference(input, overlay, output_path=None, callback=None, snap_tolerance=None)

Computes non-overlapping polygon regions from the input and overlay layers.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
overlayVectoryesOverlay polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.
snap_tolerancefloat|NonenoOptional overlay snapping tolerance.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.symmetrical_difference(
    input,
    overlay,
    output_path="result.tif",
    snap_tolerance=1.0,
)

voronoi_diagram

voronoi_diagram(input_points, output_path=None, callback=None)

Creates Voronoi (Thiessen) polygon cells from input point locations.

Parameters

NameTypeRequiredDescription
input_pointsVectoryesInput point or multipoint vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.voronoi_diagram(
    input_points,
    output_path="result.tif",
)

travelling_salesman_problem

travelling_salesman_problem(input, duration=60, output_path=None, callback=None)

Finds an approximate solution to the travelling salesman problem (TSP) for a set of points using 2-opt local search heuristics.

Parameters

NameTypeRequiredDescription
inputVectoryesInput point or multipoint vector layer.
durationintnoMaximum optimization duration in seconds (default: 60).
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Returns a polyline feature representing the optimal or near-optimal tour through the input points.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.network_analysis.travelling_salesman_problem(
    input,
    duration=1,
    output_path="result.tif",
)

construct_vector_tin

construct_vector_tin(input_points, field_name="FID", max_triangle_edge_length=-1.0, output_path=None, callback=None)

Constructs a triangular irregular network (TIN) from point features using Delaunay triangulation.

Parameters

NameTypeRequiredDescription
input_pointsVectoryesInput point or multipoint vector layer.
field_namestringnoNumeric field name used as the z-value source when filtering triangle edge lengths (default: "FID").
max_triangle_edge_lengthfloatnoMaximum allowable triangle edge length. Values <= 0 disable filtering.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.construct_vector_tin(
    input_points,
    field_name="value",
    max_triangle_edge_length=1.0,
    output_path="result.tif",
)

vector_hex_binning

vector_hex_binning(vector_points, width, orientation="h", output_path=None, callback=None)

Bins point features into a generated hexagonal grid and writes per-cell point counts.

Parameters

NameTypeRequiredDescription
vector_pointsVectoryesInput point vector layer.
widthfloatyesHexagon width (distance between opposing sides).
orientationstringnoGrid orientation ("h" for horizontal/pointy-top, "v" for vertical/flat-top).
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.sampling_gridding.vector_hex_binning(
    vector_points,
    width=1.0,
    orientation="value",
    output_path="result.tif",
)

difference

difference(input, overlay, output_path=None, callback=None, snap_tolerance=None)

Removes overlay polygon areas from input polygons.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
overlayVectoryesOverlay polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.
snap_tolerancefloat|NonenoOptional overlay snapping tolerance.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.difference(
    input,
    overlay,
    output_path="result.tif",
    snap_tolerance=1.0,
)

eliminate_coincident_points

eliminate_coincident_points(input, tolerance_dist, output_path=None, callback=None)

Removes duplicate and near-duplicate points that fall within a specified distance tolerance.

Parameters

NameTypeRequiredDescription
inputVectoryesInput point vector layer.
tolerance_distfloatyesDistance threshold used to treat points as coincident.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.geometry_processing.eliminate_coincident_points(
    input,
    tolerance_dist=1.0,
    output_path="result.tif",
)

erase

erase(input, overlay, output_path=None, callback=None, snap_tolerance=None)

Erases overlay polygon areas from input polygons while preserving input attributes.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
overlayVectoryesOverlay polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.
snap_tolerancefloat|NonenoOptional overlay snapping tolerance.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.erase(
    input,
    overlay,
    output_path="result.tif",
    snap_tolerance=1.0,
)

intersect

intersect(input, overlay, output_path=None, callback=None, snap_tolerance=None)

Computes polygon intersections between input and overlay layers.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
overlayVectoryesOverlay polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.
snap_tolerancefloat|NonenoOptional overlay snapping tolerance.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.intersect(
    input,
    overlay,
    output_path="result.tif",
    snap_tolerance=1.0,
)

union

union(input, overlay, output_path=None, callback=None, snap_tolerance=None)

Builds a unified polygon coverage from input and overlay layers.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
overlayVectoryesOverlay polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.
snap_tolerancefloat|NonenoOptional overlay snapping tolerance.

GIS (Raster Polygon Masking)

These tools use polygon vectors to clip or erase cells from raster inputs.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.overlay_analysis.union(
    input,
    overlay,
    output_path="result.tif",
    snap_tolerance=1.0,
)

Raster Polygon Masking Tool Index

  • clip_raster_to_polygon
  • erase_polygon_from_raster

clip_raster_to_polygon

clip_raster_to_polygon(input, polygons, maintain_dimensions=False, output_path=None, callback=None)

Clips a raster to polygon coverage, setting cells outside polygons to NoData.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
polygonsVectoryesInput polygon vector layer.
maintain_dimensionsboolnoIf True, keep original raster dimensions; otherwise crop to polygon extent.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.clip_raster_to_polygon(
    input,
    polygons,
    output_path="result.tif",
)

erase_polygon_from_raster

erase_polygon_from_raster(input, polygons, output_path=None, callback=None)

Sets raster cells inside polygons to NoData while preserving cells outside polygons.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
polygonsVectoryesInput polygon vector layer.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.erase_polygon_from_raster(
    input,
    polygons,
    output_path="result.tif",
)

average_overlay

average_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell average across a raster stack. NoData cells are ignored unless all inputs are NoData at that location.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.average_overlay(
    input_rasters,
    output_path="result.tif",
)

count_if

count_if(input_rasters, comparison_value, output_path=None, callback=None)

Counts how many rasters in the stack equal comparison_value at each cell. If all inputs are NoData at a cell, the output cell is NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
comparison_valuefloatyesNumeric value to count within the stack.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.count_if(
    input_rasters,
    comparison_value=1.0,
    output_path="result.tif",
)

highest_position

highest_position(input_rasters, output_path=None, callback=None)

Returns the zero-based input-stack index of the raster containing the highest value at each cell. If any input cell is NoData, the output cell is NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.highest_position(
    input_rasters,
    output_path="result.tif",
)

lowest_position

lowest_position(input_rasters, output_path=None, callback=None)

Returns the zero-based input-stack index of the raster containing the lowest value at each cell. If any input cell is NoData, the output cell is NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.lowest_position(
    input_rasters,
    output_path="result.tif",
)

max_overlay

max_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell maximum across a raster stack. Any NoData input cell causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.max_overlay(
    input_rasters,
    output_path="result.tif",
)

max_absolute_overlay

max_absolute_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell maximum absolute value across a raster stack. Any NoData input cell causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.max_absolute_overlay(
    input_rasters,
    output_path="result.tif",
)

min_overlay

min_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell minimum across a raster stack. Any NoData input cell causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.min_overlay(
    input_rasters,
    output_path="result.tif",
)

min_absolute_overlay

min_absolute_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell minimum absolute value across a raster stack. Any NoData input cell causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.min_absolute_overlay(
    input_rasters,
    output_path="result.tif",
)

multiply_overlay

multiply_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell product across a raster stack. Any NoData input cell causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.multiply_overlay(
    input_rasters,
    output_path="result.tif",
)

percent_equal_to

percent_equal_to(input_rasters, comparison, output_path=None, callback=None)

Computes the fraction of rasters in the input stack whose values equal the comparison raster at each cell. Any NoData in the comparison raster or input stack causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
comparisonRasteryesComparison raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.percent_equal_to(
    input_rasters,
    comparison,
    output_path="result.tif",
)

percent_greater_than

percent_greater_than(input_rasters, comparison, output_path=None, callback=None)

Computes the fraction of rasters in the input stack whose values are greater than the comparison raster at each cell. Any NoData in the comparison raster or input stack causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
comparisonRasteryesComparison raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.percent_greater_than(
    input_rasters,
    comparison,
    output_path="result.tif",
)

percent_less_than

percent_less_than(input_rasters, comparison, output_path=None, callback=None)

Computes the fraction of rasters in the input stack whose values are less than the comparison raster at each cell. Any NoData in the comparison raster or input stack causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
comparisonRasteryesComparison raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.percent_less_than(
    input_rasters,
    comparison,
    output_path="result.tif",
)

sum_overlay

sum_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell sum across a raster stack. Any NoData input cell causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.sum_overlay(
    input_rasters,
    output_path="result.tif",
)

pick_from_list

pick_from_list(input_rasters, pos_input, output_path=None, callback=None)

Selects per-cell values from an input raster stack using a zero-based position raster.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
pos_inputRasteryesRaster containing zero-based indices into the raster stack.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.pick_from_list(
    input_rasters,
    pos_input,
    output_path="result.tif",
)

weighted_overlay

weighted_overlay(factors, weights, cost=None, constraints=None, scale_max=1.0, output_path=None, callback=None)

Combines factor rasters using normalized weights, optional cost flags, and optional constraint rasters. Constraint cells with values less than or equal to zero force the output to zero.

Parameters

NameTypeRequiredDescription
factorsRasteryesInput factor raster stack as a Python list of rasters or raster paths.
weightslist[float]yesNumeric weights corresponding to each factor.
costlist[bool]|NonenoOptional list of booleans indicating whether each factor is a cost surface.
constraintsRasternoOptional list of raster constraints.
scale_maxfloatnoMaximum scaled suitability value after per-factor normalization.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.weighted_overlay(
    factors,
    [weights_1, weights_2],
    [cost_1, cost_2],
    constraints,
    scale_max=1.0,
    output_path="result.tif",
)

weighted_sum

weighted_sum(input_rasters, weights, output_path=None, callback=None)

Computes a weighted sum across a raster stack after normalizing weights so they sum to one.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
weightslist[float]yesNumeric weights corresponding to each input raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.weighted_sum(
    input_rasters,
    [weights_1, weights_2],
    output_path="result.tif",
)

standard_deviation_overlay

standard_deviation_overlay(input_rasters, output_path=None, callback=None)

Computes the per-cell standard deviation across a raster stack. Any NoData input cell causes the corresponding output cell to be NoData.

Parameters

NameTypeRequiredDescription
input_rastersRasteryesInput raster stack as a Python list of rasters or raster paths.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

GIS (Raster Value Updating)

These tools update raster values in-place by applying cell-wise value replacement logic between aligned rasters.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.standard_deviation_overlay(
    input_rasters,
    output_path="result.tif",
)

Value Update Tool Index

  • update_nodata_cells

update_nodata_cells

update_nodata_cells(input1, input2, output_path=None, callback=None)

Assigns NoData cells in input1 from corresponding valid cells in input2.

Parameters

NameTypeRequiredDescription
input1RasteryesPrimary raster to update.
input2RasteryesSecondary raster supplying replacement values.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

GIS (Distance And Cost Analysis)

These tools support Euclidean and friction/cost-based distance modelling workflows.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.overlay_math.update_nodata_cells(
    input1,
    input2,
    output_path="result.tif",
)

Distance and Cost Tool Index

  • cost_allocation
  • cost_distance
  • cost_pathway
  • euclidean_allocation
  • euclidean_distance

cost_distance

cost_distance(source, cost, output_path=None, backlink_output_path=None, callback=None)

Computes accumulated cost distance from source cells over a cost/friction raster and outputs both the cost-accumulation raster and a backlink raster.

Parameters

NameTypeRequiredDescription
sourceRasteryesSource raster with positive source cells.
costRasteryesCost/friction raster.
output_pathstringnoOptional cost-accumulation output path.
backlink_output_pathstringnoOptional backlink output path.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

Returned as tuple[Raster, Raster] in this order:

  • result: Raster
  • backlink: Raster

WbEnvironment usage

raster_1, raster_2 = wbe.raster.distance_cost.cost_distance(
    source,
    cost,
    output_path="result.tif",
    backlink_output="value",
)

cost_allocation

cost_allocation(source, backlink, output_path=None, callback=None)

Assigns each cell to a source region using backlink connectivity from cost_distance.

Parameters

NameTypeRequiredDescription
sourceRasteryesSource raster with positive source cells.
backlinkRasteryesBacklink raster from cost_distance.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.distance_cost.cost_allocation(
    source,
    backlink,
    output_path="result.tif",
)

cost_pathway

cost_pathway(destination, backlink, zero_background=False, output_path=None, callback=None)

Traces least-cost pathways from destination cells using backlink connectivity from cost_distance.

Parameters

NameTypeRequiredDescription
destinationRasteryesDestination raster with positive destination cells.
backlinkRasteryesBacklink raster from cost_distance.
zero_backgroundboolnoIf True, set non-path cells to zero instead of NoData.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.distance_cost.cost_pathway(
    destination,
    backlink,
    output_path="result.tif",
)

euclidean_distance

euclidean_distance(input, output_path=None, callback=None)

Computes Euclidean distance from each valid cell to the nearest non-zero target cell.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster with non-zero target cells.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.distance_cost.euclidean_distance(
    input,
    output_path="result.tif",
)

euclidean_allocation

euclidean_allocation(input, output_path=None, callback=None)

Assigns each valid cell the value of the nearest non-zero target cell.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster with non-zero target cells.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

GIS (Raster Polygon Metrics)

These tools estimate per-class polygon metrics from categorical rasters and write class totals back to each class cell.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.distance_cost.euclidean_allocation(
    input,
    output_path="result.tif",
)

Polygon Metric Tool Index

  • polygon_area
  • polygon_long_axis
  • polygon_perimeter
  • polygon_short_axis
  • raster_area
  • raster_perimeter

polygon_area

polygon_area(input, output_path=None, callback=None)

Calculates vector polygon area and appends an AREA field to the output.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.polygon_area(
    input,
    output_path="result.tif",
)

polygon_perimeter

polygon_perimeter(input, output_path=None, callback=None)

Calculates vector polygon perimeter and appends a PERIMETER field to the output.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.polygon_perimeter(
    input,
    output_path="result.tif",
)

polygon_short_axis

polygon_short_axis(input, output_path=None, callback=None)

Maps the short axis of each polygon's minimum bounding box to output line features.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.polygon_short_axis(
    input,
    output_path="result.tif",
)

polygon_long_axis

polygon_long_axis(input, output_path=None, callback=None)

Maps the long axis of each polygon's minimum bounding box to output line features.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.polygon_long_axis(
    input,
    output_path="result.tif",
)

compactness_ratio

compactness_ratio(input, output_path=None, callback=None)

Computes compactness ratio for polygon features and appends COMPACTNESS.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.compactness_ratio(
    input,
    output_path="result.tif",
)

elongation_ratio

elongation_ratio(input, output_path=None, callback=None)

Computes polygon elongation ratio and appends ELONGATION.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.elongation_ratio(
    input,
    output_path="result.tif",
)

hole_proportion

hole_proportion(input, output_path=None, callback=None)

Computes polygon hole proportion and appends HOLE_PROP.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.hole_proportion(
    input,
    output_path="result.tif",
)

linearity_index

linearity_index(input, output_path=None, callback=None)

Computes linearity index and appends LINEARITY.

Parameters

NameTypeRequiredDescription
inputVectoryesInput line or polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.linearity_index(
    input,
    output_path="result.tif",
)

narrowness_index

narrowness_index(input, output_path=None, callback=None)

Computes raster narrowness index from each cell's local neighborhood.

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.narrowness_index(
    input,
    output_path="result.tif",
)

narrowness_index_vector

narrowness_index_vector(input, output_path=None, callback=None)

Computes narrowness index for polygon features and appends NARROWNESS.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.narrowness_index_vector(
    input,
    output_path="result.tif",
)

patch_orientation

patch_orientation(input, output_path=None, callback=None)

Computes patch orientation and appends ORIENT.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.patch_orientation(
    input,
    output_path="result.tif",
)

perimeter_area_ratio

perimeter_area_ratio(input, output_path=None, callback=None)

Computes perimeter-area ratio and appends P_A_RATIO.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.perimeter_area_ratio(
    input,
    output_path="result.tif",
)
related_circumscribing_circle(input, output_path=None, callback=None)

Computes the related circumscribing circle metric and appends RC_CIRCLE.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.related_circumscribing_circle(
    input,
    output_path="result.tif",
)

shape_complexity_index_vector

shape_complexity_index_vector(input, output_path=None, callback=None)

Computes vector shape complexity index and appends SCI.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.shape_complexity_index_vector(
    input,
    output_path="result.tif",
)

deviation_from_regional_direction

deviation_from_regional_direction(input, elongation_threshold=0.75, output_path=None, callback=None)

Computes polygon directional deviation from the regional direction and appends DEV_DIR.

Parameters

NameTypeRequiredDescription
inputVectoryesInput polygon vector layer.
elongation_thresholdfloatnoThreshold for including polygons in regional direction estimation.
output_pathstringnoOptional output vector path. If omitted, an auto-derived output path is used.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.vector.shape_metrics.deviation_from_regional_direction(
    input,
    elongation_threshold=1.0,
    output_path="result.tif",
)

boundary_shape_complexity

boundary_shape_complexity(input, output_path=None, callback=None)

Computes raster patch boundary-shape complexity.

Parameters

NameTypeRequiredDescription
inputRasteryesInput patch-ID raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.boundary_shape_complexity(
    input,
    output_path="result.tif",
)

edge_proportion

edge_proportion(input, output_path=None, callback=None)

Computes edge-cell proportion per raster patch.

Parameters

NameTypeRequiredDescription
inputRasteryesInput patch-ID raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.edge_proportion(
    input,
    output_path="result.tif",
)

find_patch_edge_cells

find_patch_edge_cells(input, output_path=None, callback=None)

Identifies edge cells for each raster patch.

Parameters

NameTypeRequiredDescription
inputRasteryesInput patch-ID raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.find_patch_edge_cells(
    input,
    output_path="result.tif",
)

radius_of_gyration

radius_of_gyration(input, output_path=None, callback=None)

Computes radius of gyration per raster patch.

Parameters

NameTypeRequiredDescription
inputRasteryesInput patch-ID raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.radius_of_gyration(
    input,
    output_path="result.tif",
)

shape_complexity_index_raster

shape_complexity_index_raster(input, output_path=None, callback=None)

Computes raster patch shape complexity index.

Parameters

NameTypeRequiredDescription
inputRasteryesInput patch-ID raster.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.shape_complexity_index_raster(
    input,
    output_path="result.tif",
)

raster_area

raster_area(input, units="map units", zero_background=False, output_path=None, callback=None)

Estimates per-class area from a categorical raster and assigns each class's total area to all cells of that class.

Parameters

NameTypeRequiredDescription
inputRasteryesInput categorical raster.
unitsstringnoArea units ("map units" or "grid cells").
zero_backgroundboolnoIf True, zero-valued cells are excluded.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.raster_area(
    input,
    units="value",
    output_path="result.tif",
)

raster_perimeter

raster_perimeter(input, units="map units", zero_background=False, output_path=None, callback=None)

Estimates per-class perimeter from a categorical raster using an anti-aliasing lookup-table method and assigns each class's total perimeter to all cells of that class.

Parameters

NameTypeRequiredDescription
inputRasteryesInput categorical raster.
unitsstringnoPerimeter units ("map units" or "grid cells").
zero_backgroundboolnoIf True, zero-valued cells are excluded.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

GIS (Raster Binary And Patch Tools)

These tools are used to derive binary proximity rasters and connected-component patch identifiers from categorical inputs.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.raster_perimeter(
    input,
    units="value",
    output_path="result.tif",
)

Binary and Patch Tool Index

  • clump

clump

clump(input, diag=False, zero_background=False, output_path=None, callback=None)

Groups contiguous equal-valued cells into unique patch identifiers.

Parameters

NameTypeRequiredDescription
inputRasteryesInput categorical raster.
diagboolnoIf True, include diagonal connectivity (8-neighbour); otherwise use 4-neighbour.
zero_backgroundboolnoIf True, keep zero-valued cells as background.
output_pathstringnoOptional output path. If omitted, returns an in-memory raster.
callbackfunctionnoOptional progress callback receiving JSON events.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.raster.clump(
    input,
    output_path="result.tif",
)

Remote Sensing

Whitebox Workflows for Python — Remote Sensing Tools

This document covers all Remote Sensing tools exposed through the WbEnvironment API. For common conventions, Raster I/O, and math operators see TOOLS.md.


Remote Sensing

These tools are grouped under the remote_sensing tool module in the backend. Image filters are currently the first subset documented here; additional non-filter remote sensing tools will be added to this same section as they are ported.

Tools (Alphabetical)

wbe.gaussian_filter

wbe.gaussian_filter(
    input,
    sigma=None,
    treat_as_rgb=False,
    assume_three_band_rgb=True,
    output_path=None,
    callback=None,
) -> Raster

Applies a Gaussian smoothing kernel to a raster image.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigmafloat | None0.75Gaussian standard deviation in pixels (0.5–20.0). Larger values produce a wider, smoother kernel
treat_as_rgbboolFalseForce packed-RGB processing in HSI intensity space. When false, packed RGB may still be auto-detected from raster metadata
assume_three_band_rgbboolTrueWhen True, 3-band uint8/uint16 rasters are treated as RGB if no explicit colour metadata is present. Set False for multispectral datasets
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

# Default smoothing
smoothed = wbe.gaussian_filter(image)

# Wider kernel
smoothed_wide = wbe.gaussian_filter(image, sigma=3.0, output_path='smoothed.tif')

# Disable 3-band RGB heuristic for a multispectral image
ms_smoothed = wbe.gaussian_filter(ms_image, sigma=1.5, assume_three_band_rgb=False)

wbe.bilateral_filter

wbe.bilateral_filter(
    input,
    sigma_dist=None,
    sigma_int=None,
    treat_as_rgb=False,
    assume_three_band_rgb=True,
    output_path=None,
    callback=None,
) -> Raster

Applies an edge-preserving bilateral smoothing filter. Nearby pixels that are similar in intensity are averaged together; pixels across edges (large intensity differences) are weighted much less, preserving sharp boundaries.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigma_distfloat | None0.75Spatial (distance) Gaussian standard deviation in pixels (0.5–20.0). Controls the filter radius
sigma_intfloat | None1.0Intensity Gaussian standard deviation in raster value units. Larger values reduce edge-preservation and approach a plain Gaussian blur
treat_as_rgbboolFalseForce packed-RGB processing in HSI intensity space
assume_three_band_rgbboolTrueWhen True, 3-band uint8/uint16 rasters are treated as RGB if no explicit colour metadata is present
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

# Default edge-preserving smoothing
smoothed = wbe.bilateral_filter(image)

# Stronger smoothing with larger kernels
smoothed_strong = wbe.bilateral_filter(
    image, sigma_dist=3.0, sigma_int=50.0, output_path='bilateral.tif'
)

# Disable the 3-band RGB heuristic for a multispectral image
ms_smoothed = wbe.bilateral_filter(
    ms_image, sigma_dist=1.5, sigma_int=25.0, assume_three_band_rgb=False
)

wbe.balance_contrast_enhancement

wbe.balance_contrast_enhancement(
    input,
    band_mean=None,
    output_path=None,
    callback=None,
) -> Raster

Reduces colour bias in a packed RGB raster using per-channel balance contrast enhancement.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput packed RGB raster
band_meanfloat | None100.0Desired output mean brightness for each colour channel
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

bce = wbe.balance_contrast_enhancement(rgb_image)
bce120 = wbe.balance_contrast_enhancement(rgb_image, band_mean=120.0)

wbe.change_vector_analysis

wbe.change_vector_analysis(
    date1,
    date2,
    magnitude_output=None,
    direction_output=None,
    callback=None,
) -> dict[str, Raster]

Performs change vector analysis on two-date multispectral datasets. Returns both vector magnitude and direction-code rasters.

date1 and date2 can be either string lists (comma/semicolon-delimited) or arrays of raster inputs, and must have equal lengths.

Parameters

NameTypeDefaultDescription
date1list[Raster] | strrequiredEarlier-date raster list
date2list[Raster] | strrequiredLater-date raster list in matching band order
magnitude_outputstr | NoneNoneOptional output path for CVA magnitude raster
direction_outputstr | NoneNoneOptional output path for CVA direction-code raster
callbackcallable | NoneNoneProgress/message event handler

Returns

A dict with keys "magnitude" and "direction" containing output rasters.

Examples

cva = wbe.change_vector_analysis(
    date1=[d1_red, d1_green, d1_blue],
    date2=[d2_red, d2_green, d2_blue],
)
mag = cva["magnitude"]
direction = cva["direction"]

wbe.remote_sensing_change_detection

wbe.remote_sensing_change_detection(
    baseline_red,
    baseline_nir,
    change_red,
    change_nir,
    intermediate_ndvi=None,
    profile="balanced",
    high_confidence_threshold=0.85,
    output_prefix=None,
    callback=None,
) -> tuple[Raster, Raster, str]

Runs workflow-grade NDVI change detection and returns a change raster, a confidence raster, and a summary JSON path.

Parameters

NameTypeDefaultDescription
baseline_redRasterrequiredBaseline-date red band
baseline_nirRasterrequiredBaseline-date NIR band
change_redRasterrequiredChange-date red band
change_nirRasterrequiredChange-date NIR band
intermediate_ndviRaster | NoneNoneOptional intermediate NDVI raster for temporal consistency
profilestr"balanced"One of "aggressive", "balanced", "conservative"
high_confidence_thresholdfloat0.85Threshold in [0, 1] used in summary metrics
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

change_map, confidence, summary = wbe.remote_sensing_change_detection(
    baseline_red=baseline_red,
    baseline_nir=baseline_nir,
    change_red=change_red,
    change_nir=change_nir,
    profile="balanced",
)

wbe.terrain_corrected_optical_analytics

wbe.terrain_corrected_optical_analytics(
    input_dem,
    safe_root=None,
    input_red=None,
    input_nir=None,
    input_green=None,
    input_blue=None,
    solar_mode="auto",
    solar_zenith_deg=40.0,
    solar_azimuth_deg=165.0,
    acquisition_datetime_utc=None,
    latitude=None,
    longitude=None,
    profile="balanced",
    cloud_threshold=None,
    shadow_threshold=None,
    qa_mask=None,
    qa_mask_format="auto",
    mask_strategy="auto",
    z_factor=1.0,
    output_prefix=None,
    callback=None,
) -> tuple[Raster, Raster, Raster | None, Raster | None, Raster, Raster, Raster, str]

Runs topographic C-correction for optical imagery and returns corrected red/NIR/(optional green)/(optional blue), cloud-shadow mask, correction factor, quality confidence, and summary JSON path.

Parameters

NameTypeDefaultDescription
input_demRasterrequiredInput DEM
safe_rootstr | NoneNoneOptional Sentinel-2 SAFE root; can auto-resolve B04/B08/B03/B02 and QA metadata
input_redRaster | NoneNoneInput red band (required unless safe_root resolves B04)
input_nirRaster | NoneNoneInput NIR band (required unless safe_root resolves B08)
input_greenRaster | NoneNoneOptional green band
input_blueRaster | NoneNoneOptional blue band
solar_modestr"auto"One of "auto", "manual", "metadata", "datetime_location"
solar_zenith_degfloat40.0Solar zenith angle in degrees
solar_azimuth_degfloat165.0Solar azimuth in degrees
acquisition_datetime_utcstr | NoneNoneRFC3339 UTC timestamp for datetime_location mode
latitudefloat | NoneNoneOptional latitude for datetime_location
longitudefloat | NoneNoneOptional longitude for datetime_location
profilestr"balanced"One of "conservative", "balanced", "fast"
cloud_thresholdfloat | NoneNoneOptional cloud threshold override in source units
shadow_thresholdfloat | NoneNoneOptional shadow threshold override in source units
qa_maskRaster | NoneNoneOptional QA mask raster
qa_mask_formatstr"auto"One of "auto", "landsat_qa_pixel", "sentinel2_scl", "sentinel2_qa60", "binary"
mask_strategystr"auto"One of "auto", "qa_only", "heuristic_only", "qa_plus_heuristic"
z_factorfloat1.0Vertical exaggeration for slope/aspect derivation
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

red_corr, nir_corr, green_corr, blue_corr, mask, correction_factor, quality, summary = wbe.terrain_corrected_optical_analytics(
    input_dem=dem,
    input_red=red_band,
    input_nir=nir_band,
    input_green=green_band,
    input_blue=blue_band,
    profile="balanced",
)

wbe.time_series_change_intelligence

wbe.time_series_change_intelligence(
    input_stack,
    qa_stack=None,
    algorithm_mode="fast",
    min_observations=24,
    output_prefix=None,
    callback=None,
) -> tuple[Raster, Raster, Raster, Raster, str]

Runs temporal trend and breakpoint workflow analysis on a stack-like raster input. Returns trend change, breakpoint count, breakpoint date, change confidence, and summary JSON path.

Parameters

NameTypeDefaultDescription
input_stackRasterrequiredInput temporal stack raster
qa_stackRaster | NoneNoneOptional QA stack used to screen low-quality observations
algorithm_modestr"fast"Algorithm mode (e.g. "fast", "iterative", "bfast")
min_observationsint24Minimum per-pixel observations needed for model fitting
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

trend, count, date, confidence, summary = wbe.time_series_change_intelligence(
    input_stack=time_stack,
    qa_stack=time_stack_qa,
    algorithm_mode="bfast",
    min_observations=24,
)

wbe.sar_coregistration

wbe.sar_coregistration(
    reference_sar,
    moving_sar,
    coreg_mode="translation",
    max_offset_px=24,
    decimation=4,
    min_overlap_fraction=0.20,
    resample_method="bilinear",
    output_prefix=None,
    callback=None,
) -> tuple[Raster, Raster, Raster, str, str]

Runs SAR pair coregistration and returns the aligned moving raster, x/y offset rasters, transform JSON path, and summary JSON path.

Parameters

NameTypeDefaultDescription
reference_sarRasterrequiredReference SAR raster
moving_sarRasterrequiredMoving SAR raster to align onto the reference grid
coreg_modestr"translation"Coregistration mode: translation, affine, or local_offset_grid
max_offset_pxint24Maximum absolute pixel offset searched during alignment
decimationint4Sampling stride used during global search
min_overlap_fractionfloat0.20Minimum valid sampled overlap fraction
resample_methodstr"bilinear"Output resampling mode: bilinear or nearest
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

aligned, offset_x, offset_y, transform_json, summary = wbe.sar_coregistration(
    reference_sar=reference,
    moving_sar=moving,
    coreg_mode="translation",
    max_offset_px=24,
)

wbe.sar_interferogram_coherence

wbe.sar_interferogram_coherence(
    reference_sar,
    moving_sar,
    auto_coregister_pair=False,
    assume_prealigned_pair=False,
    coreg_mode="translation",
    coreg_max_offset_px=24,
    coreg_decimation=4,
    coreg_min_overlap_fraction=0.20,
    performance_profile="balanced",
    coherence_decimation=1,
    coherence_window=7,
    write_interferogram=True,
    write_coherence=True,
    write_valid_mask=True,
    output_prefix=None,
    callback=None,
) -> tuple[Raster | None, Raster | None, Raster | None, str]

Runs the dedicated SAR interferogram/coherence workflow and returns optional interferogram, coherence, and valid-mask rasters plus the summary JSON path.

Parameters

NameTypeDefaultDescription
reference_sarRasterrequiredReference SAR raster
moving_sarRasterrequiredMoving SAR raster
auto_coregister_pairboolFalseInvoke internal coregistration when the pair is not already aligned
assume_prealigned_pairboolFalseAssert that the pair is already aligned and skip auto-coregistration
coreg_modestr"translation"Coregistration handoff mode
coreg_max_offset_pxint24Maximum absolute pixel offset searched during handoff
coreg_decimationint4Sampling stride used during handoff
coreg_min_overlap_fractionfloat0.20Minimum sampled overlap fraction required during handoff
performance_profilestr"balanced"Runtime profile: balanced or fast
coherence_decimationint1Optional coherence sampling stride
coherence_windowint7Odd-valued coherence window size
write_interferogramboolTrueWrite interferogram raster output
write_coherenceboolTrueWrite coherence raster output
write_valid_maskboolTrueWrite valid-mask raster output
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

interferogram, coherence, valid_mask, summary = wbe.sar_interferogram_coherence(
    reference_sar=reference,
    moving_sar=moving,
    assume_prealigned_pair=True,
    coherence_window=7,
)

wbe.sar_analysis_readiness

wbe.sar_analysis_readiness(
    input_sar,
    input_dem,
    pair_sar=None,
    speckle_window=5,
    z_factor=1.0,
    output_prefix=None,
    callback=None,
) -> tuple[Raster, Raster, Raster, Raster | None, str]

Runs SAR analysis-ready preprocessing and returns calibrated backscatter, speckle-filtered SAR, RTC factor, optional coherence-proxy raster, and summary JSON path.

Parameters

NameTypeDefaultDescription
input_sarRasterrequiredInput SAR raster
input_demRasterrequiredDEM used for terrain corrections
pair_sarRaster | NoneNoneOptional second SAR raster used for coherence-proxy output
speckle_windowint5Speckle filtering window size
z_factorfloat1.0Vertical exaggeration factor for terrain terms
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

calibrated, speckle, rtc, coherence_proxy, summary = wbe.sar_analysis_readiness(
    input_sar=sar_a,
    input_dem=dem,
    pair_sar=sar_b,
    speckle_window=5,
)

wbe.multi_sensor_fusion_monitoring

wbe.multi_sensor_fusion_monitoring(
    baseline_bundle,
    change_bundle,
    input_sar,
    input_dem,
    baseline_red_band_index=0,
    baseline_nir_band_index=1,
    change_red_band_index=0,
    change_nir_band_index=1,
    pair_sar=None,
    thermal_bundle=None,
    thermal_band_index=0,
    profile="balanced",
    harmonization_mode="robust",
    high_confidence_threshold=0.8,
    max_zone_features=25000,
    vector_output_format="gpkg",
    output_prefix=None,
    callback=None,
) -> tuple[Raster, Raster, Raster, Raster, Vector, str, str, str]

Runs multi-sensor disturbance fusion from optical change, SAR stability cues, and terrain context. Returns fused change probability, sensor agreement, terrain context, uncertainty inflation, high-confidence zones, thermal contract JSON path, modality diagnostics JSON path, and a summary JSON path.

Parameters

NameTypeDefaultDescription
baseline_bundleRasterrequiredBaseline-date multiband raster bundle
change_bundleRasterrequiredChange-date multiband raster bundle
input_sarRasterrequiredSAR raster for agreement/fusion cues
input_demRasterrequiredDEM used for terrain context
baseline_red_band_indexint0Baseline red-band index
baseline_nir_band_indexint1Baseline NIR-band index
change_red_band_indexint0Change red-band index
change_nir_band_indexint1Change NIR-band index
pair_sarRaster | NoneNoneOptional paired SAR raster for coherence-style cues
thermal_bundleRaster | NoneNoneOptional thermal raster used for three-modality fusion
thermal_band_indexint0Thermal band index in thermal_bundle
profilestr"balanced"One of "fast", "balanced", "conservative"
harmonization_modestr"robust"One of "off", "robust", "conservative"
high_confidence_thresholdfloat0.8Threshold in [0, 1] used to derive high-confidence zones
max_zone_featuresint25000Maximum number of output zone features
vector_output_formatstr"gpkg"One of "gpkg", "geojson", "shp"
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

fused, agreement, terrain, uncertainty, zones, thermal_contract, modality_diagnostics, summary = wbe.multi_sensor_fusion_monitoring(
    baseline_bundle=baseline_bundle,
    change_bundle=change_bundle,
    input_sar=sar_a,
    input_dem=dem,
    baseline_red_band_index=0,
    baseline_nir_band_index=1,
    change_red_band_index=0,
    change_nir_band_index=1,
    pair_sar=sar_b,
    thermal_bundle=thermal,
    thermal_band_index=0,
    profile="balanced",
    harmonization_mode="robust",
    vector_output_format="gpkg",
)

wbe.brdf_surface_reflectance_consistency

wbe.brdf_surface_reflectance_consistency(
    input_red,
    input_nir,
    input_dem,
    solar_zenith_deg,
    solar_azimuth_deg,
    input_green=None,
    profile="balanced",
    output_prefix=None,
    callback=None,
) -> tuple[Raster, Raster, Raster, str]

Runs BRDF/illumination consistency normalization and returns normalized reflectance, normalization delta, consistency confidence, and a summary JSON path.

Parameters

NameTypeDefaultDescription
input_redRasterrequiredInput red band
input_nirRasterrequiredInput NIR band
input_demRasterrequiredDEM used for terrain-aware normalization
solar_zenith_degfloatrequiredSolar zenith angle in degrees
solar_azimuth_degfloatrequiredSolar azimuth in degrees
input_greenRaster | NoneNoneOptional green band
profilestr"balanced"One of "fast", "balanced", "conservative"
output_prefixstr | NoneNonePrefix for generated outputs
callbackcallable | NoneNoneProgress/message event handler

Examples

normalized, delta, confidence, summary = wbe.brdf_surface_reflectance_consistency(
    input_red=red_band,
    input_nir=nir_band,
    input_dem=dem,
    solar_zenith_deg=40.0,
    solar_azimuth_deg=165.0,
    input_green=green_band,
    profile="balanced",
)

wbe.write_function_memory_insertion

wbe.write_function_memory_insertion(
    input1,
    input2,
    input3=None,
    output_path=None,
    callback=None,
) -> Raster

Creates a packed RGB change-visualization composite from two or three single-band dates.

When input3 is omitted, the second-date raster is used for both green and blue channels, producing the classic two-date red/cyan change visualization.

Parameters

NameTypeDefaultDescription
input1RasterrequiredFirst-date single-band raster (red channel)
input2RasterrequiredSecond-date single-band raster (green channel)
input3Raster | NoneNoneOptional third-date single-band raster (blue channel); defaults to input2
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

# Two-date mode (R=date1, G/B=date2)
wfmi2 = wbe.write_function_memory_insertion(date1, date2)

# Three-date mode (R=date1, G=date2, B=date3)
wfmi3 = wbe.write_function_memory_insertion(date1, date2, input3=date3)

wbe.closing

wbe.closing(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Performs a morphological closing using a rectangular structuring element.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

closed = wbe.closing(image)
closed5 = wbe.closing(image, filter_size_x=5, filter_size_y=5)

wbe.corner_detection

wbe.corner_detection(
    input,
    output_path=None,
    callback=None,
) -> Raster

Identifies corner patterns in binary rasters using hit-and-miss templates. Foreground cells are values greater than zero; zero and nodata are treated as background.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput binary raster
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

corners = wbe.corner_detection(binary_image)

wbe.create_colour_composite

wbe.create_colour_composite(
    red,
    green,
    blue,
    opacity=None,
    enhance=None,
    treat_zeros_as_nodata=None,
    output_path=None,
    callback=None,
) -> Raster

Creates a packed RGB colour composite from red, green, blue, and optional opacity rasters.

Parameters

NameTypeDefaultDescription
redRasterrequiredRed-band raster
greenRasterrequiredGreen-band raster
blueRasterrequiredBlue-band raster
opacityRaster | NoneNoneOptional opacity raster mapped into the alpha channel
enhancebool | NoneTrueApply balance contrast enhancement after composing
treat_zeros_as_nodatabool | NoneFalseTreat zero values in RGB inputs as background/nodata
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

rgb = wbe.create_colour_composite(red_band, green_band, blue_band)
rgba = wbe.create_colour_composite(
    red_band, green_band, blue_band, opacity=mask, enhance=False
)

wbe.anisotropic_diffusion_filter

wbe.anisotropic_diffusion_filter(
    input,
    iterations=None,
    kappa=None,
    lambda=None,
    output_path=None,
    callback=None,
) -> Raster

Perona-Malik anisotropic diffusion smoothing. This filter reduces noise while limiting diffusion across strong edges.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
iterationsint | None10Number of diffusion iterations
kappafloat | None20.0Edge sensitivity (higher values smooth across larger gradients)
lambdafloat | None0.2Diffusion time-step in (0, 0.25]
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

ad = wbe.anisotropic_diffusion_filter(image)
ad_strong = wbe.anisotropic_diffusion_filter(image, iterations=20, kappa=15.0, lambda=0.2)

wbe.gamma_correction

wbe.gamma_correction(
    input,
    gamma=None,
    output_path=None,
    callback=None,
) -> Raster

Applies gamma intensity correction where output values are computed as z_out = z_in^gamma.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
gammafloat | None0.5Gamma exponent in [0, 4]
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

gamma_light = wbe.gamma_correction(image, gamma=0.5)
gamma_dark = wbe.gamma_correction(image, gamma=2.0)

wbe.guided_filter

wbe.guided_filter(
    input,
    radius=None,
    epsilon=None,
    output_path=None,
    callback=None,
) -> Raster

Edge-preserving guided filter using local linear models and box-filtered statistics.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
radiusint | None4Local window radius in pixels
epsilonfloat | None0.01Regularization term for local variance
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

gf = wbe.guided_filter(image)
gf_tight = wbe.guided_filter(image, radius=8, epsilon=0.001)

wbe.wiener_filter

wbe.wiener_filter(
    input,
    radius=None,
    noise_variance=None,
    output_path=None,
    callback=None,
) -> Raster

Adaptive Wiener denoising filter based on local mean and variance statistics. If noise_variance is omitted, the filter estimates it from the image's local variance map.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
radiusint | None2Local window radius in pixels
noise_variancefloat | NoneestimatedOptional additive noise variance
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

wiener = wbe.wiener_filter(image)
wiener_known_noise = wbe.wiener_filter(image, radius=3, noise_variance=4.0)

wbe.non_local_means_filter

wbe.non_local_means_filter(
    input,
    search_radius=None,
    patch_radius=None,
    h=None,
    output_path=None,
    callback=None,
) -> Raster

Non-local means denoiser that averages similar patches within a search window.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
search_radiusint | None5Search window radius in pixels
patch_radiusint | None1Patch radius in pixels
hfloat | None10.0Filtering strength parameter
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

nlm = wbe.non_local_means_filter(image)
nlm_strong = wbe.non_local_means_filter(image, search_radius=7, patch_radius=1, h=15.0)

wbe.kuwahara_filter

wbe.kuwahara_filter(
    input,
    radius=None,
    output_path=None,
    callback=None,
) -> Raster

Edge-preserving Kuwahara filter that selects the lowest-variance quadrant mean for each pixel.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
radiusint | None2Quadrant radius in pixels
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

kuw = wbe.kuwahara_filter(image)
kuw_wide = wbe.kuwahara_filter(image, radius=3)

wbe.frost_filter

wbe.frost_filter(
    input,
    radius=None,
    damping_factor=None,
    output_path=None,
    callback=None,
) -> Raster

Adaptive Frost speckle filter with exponential distance weighting controlled by local statistics.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
radiusint | None2Local window radius in pixels
damping_factorfloat | None2.0Exponential damping factor
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

frost = wbe.frost_filter(image)
frost_strong = wbe.frost_filter(image, radius=3, damping_factor=3.0)

wbe.gamma_map_filter

wbe.gamma_map_filter(
    input,
    radius=None,
    enl=None,
    output_path=None,
    callback=None,
) -> Raster

Gamma-MAP speckle filter for radar imagery using local coefficient-of-variation regimes and ENL.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
radiusint | None2Local window radius in pixels
enlfloat | None1.0Equivalent number of looks
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

gmap = wbe.gamma_map_filter(image)
gmap_enl4 = wbe.gamma_map_filter(image, radius=3, enl=4.0)

wbe.kuan_filter

wbe.kuan_filter(
    input,
    radius=None,
    enl=None,
    output_path=None,
    callback=None,
) -> Raster

Kuan speckle filter for radar imagery using an adaptive linear combination of the center pixel and local mean.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
radiusint | None2Local window radius in pixels
enlfloat | None1.0Equivalent number of looks
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

kuan = wbe.kuan_filter(image)
kuan_enl4 = wbe.kuan_filter(image, radius=3, enl=4.0)

wbe.gabor_filter_bank

wbe.gabor_filter_bank(
    input,
    sigma=None,
    frequency=None,
    orientations=None,
    output_path=None,
    callback=None,
) -> Raster

Multi-orientation Gabor filter bank. The output is the maximum response across all tested orientations.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigmafloat | None2.0Gaussian envelope sigma in pixels
frequencyfloat | None0.2Sinusoid spatial frequency in cycles/pixel
orientationsint | None6Number of orientations in the filter bank
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

gabor = wbe.gabor_filter_bank(image)
gabor_dense = wbe.gabor_filter_bank(image, sigma=3.0, frequency=0.15, orientations=8)

wbe.frangi_filter

wbe.frangi_filter(
    input,
    scales=None,
    beta=None,
    c=None,
    output_path=None,
    callback=None,
) -> Raster

Multiscale Frangi vesselness enhancement filter for curvilinear feature emphasis.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
scaleslist[float] | None[1.0, 2.0, 3.0]Scale list used in multiscale response
betafloat | None0.5Blob suppression parameter
cfloat | None15.0Structure sensitivity parameter
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

frangi = wbe.frangi_filter(image)
frangi_multi = wbe.frangi_filter(image, scales=[1.0, 2.0, 4.0], beta=0.5, c=20.0)

wbe.savitzky_golay_2d_filter

wbe.savitzky_golay_2d_filter(
    input,
    window_size=None,
    output_path=None,
    callback=None,
) -> Raster

2D Savitzky-Golay smoothing filter. Current implementation supports window_size=5 (quadratic smoothing kernel).

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
window_sizeint | None5Odd window size (currently fixed to 5)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

sg = wbe.savitzky_golay_2d_filter(image)
sg5 = wbe.savitzky_golay_2d_filter(image, window_size=5)

wbe.fast_almost_gaussian_filter

wbe.fast_almost_gaussian_filter(
    input,
    sigma=None,
    output_path=None,
    callback=None,
) -> Raster

Fast approximation of Gaussian smoothing using repeated box filtering. This is typically best for larger kernels (sigma >= 1.8).

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigmafloat | None1.8Target Gaussian sigma. Values below 1.8 are clamped to 1.8
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

smoothed = wbe.fast_almost_gaussian_filter(image)
smoothed_big = wbe.fast_almost_gaussian_filter(image, sigma=5.0)

wbe.edge_preserving_mean_filter

wbe.edge_preserving_mean_filter(
    input,
    filter_size=None,
    threshold=None,
    output_path=None,
    callback=None,
) -> Raster

Applies a thresholded local mean where only neighbors within threshold of the center value are included in the average.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_sizeint | None11Odd square neighborhood size in pixels
thresholdfloat | None15.0Max absolute neighbor difference allowed in local mean
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

epm = wbe.edge_preserving_mean_filter(image)
epm_tight = wbe.edge_preserving_mean_filter(image, filter_size=9, threshold=5.0)

wbe.unsharp_masking

wbe.unsharp_masking(
    input,
    sigma=None,
    amount=None,
    threshold=None,
    output_path=None,
    callback=None,
) -> Raster

Sharpens edges by subtracting a Gaussian blur from the source and adding a scaled residual back to the image.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigmafloat | None0.75Gaussian sigma for blur mask (0.5–20.0)
amountfloat | None100.0Residual multiplier for sharpening strength
thresholdfloat | None0.0Minimum absolute residual needed to sharpen
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

sharp = wbe.unsharp_masking(image)
sharp_strong = wbe.unsharp_masking(image, sigma=1.5, amount=150.0, threshold=0.01)

wbe.diff_of_gaussians_filter

wbe.diff_of_gaussians_filter(
    input,
    sigma1=None,
    sigma2=None,
    output_path=None,
    callback=None,
) -> Raster

Difference-of-Gaussians (DoG) band-pass filter computed as blur(sigma1) - blur(sigma2).

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigma1float | None2.0Smaller Gaussian sigma (0.25–20.0)
sigma2float | None4.0Larger Gaussian sigma (0.5–20.0). If reversed, values are swapped internally
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

dog = wbe.diff_of_gaussians_filter(image)
dog_custom = wbe.diff_of_gaussians_filter(image, sigma1=1.5, sigma2=3.0)

wbe.adaptive_filter

wbe.adaptive_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    threshold=None,
    output_path=None,
    callback=None,
) -> Raster

Adaptive smoothing that replaces only center cells whose local z-score exceeds threshold relative to neighborhood mean and variance.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
thresholdfloat | None2.0Absolute z-score threshold for replacement
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

adaptive = wbe.adaptive_filter(image)
adaptive_tight = wbe.adaptive_filter(image, filter_size_x=9, filter_size_y=9, threshold=1.5)

wbe.lee_filter

wbe.lee_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    sigma=None,
    m_value=None,
    output_path=None,
    callback=None,
) -> Raster

Lee sigma filter that averages in-range neighbors (z ± sigma) and falls back to immediate-neighbor averaging when in-range support is low.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
sigmafloat | None10.0Intensity inclusion half-width around center value
m_valuefloat | None5.0Minimum in-range sample count before fallback
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

lee = wbe.lee_filter(image)
lee_custom = wbe.lee_filter(image, filter_size_x=9, filter_size_y=9, sigma=6.0, m_value=4.0)

wbe.conservative_smoothing_filter

wbe.conservative_smoothing_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Conservative smoother that clips spike values to neighborhood extrema while preserving most non-outlier cells.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None3Odd neighborhood width
filter_size_yint | None3Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

cs = wbe.conservative_smoothing_filter(image)
cs_wide = wbe.conservative_smoothing_filter(image, filter_size_x=5, filter_size_y=5)

wbe.olympic_filter

wbe.olympic_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Mean-like smoother that drops the minimum and maximum values in each neighborhood before averaging.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

olympic = wbe.olympic_filter(image)
olympic_small = wbe.olympic_filter(image, filter_size_x=5, filter_size_y=5)

wbe.k_nearest_mean_filter

wbe.k_nearest_mean_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    k=None,
    output_path=None,
    callback=None,
) -> Raster

Edge-preserving smoother that averages only the k local neighbors most similar to the center value.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None3Odd neighborhood width
filter_size_yint | None3Odd neighborhood height
kint | None5Number of nearest neighbors to include in mean
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

knn_mean = wbe.k_nearest_mean_filter(image)
knn_mean_custom = wbe.k_nearest_mean_filter(image, filter_size_x=5, filter_size_y=5, k=8)

wbe.high_pass_median_filter

wbe.high_pass_median_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    sig_digits=None,
    output_path=None,
    callback=None,
) -> Raster

High-pass median filter that outputs center value minus local median using quantized histogram bins controlled by sig_digits.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
sig_digitsint | None2Significant digits used for quantization bins
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

hpm = wbe.high_pass_median_filter(image)
hpm_precise = wbe.high_pass_median_filter(image, filter_size_x=7, filter_size_y=7, sig_digits=3)

wbe.laplacian_of_gaussians_filter

wbe.laplacian_of_gaussians_filter(
    input,
    sigma=None,
    output_path=None,
    callback=None,
) -> Raster

Laplacian-of-Gaussians (LoG) edge-enhancement filter using a sigma-derived kernel footprint.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigmafloat | None0.75Gaussian sigma used by LoG kernel (0.5–20.0)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

log_img = wbe.laplacian_of_gaussians_filter(image)
log_wide = wbe.laplacian_of_gaussians_filter(image, sigma=2.0)

wbe.diversity_filter

wbe.diversity_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window diversity filter (count of unique values in each neighborhood).

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

div = wbe.diversity_filter(image)
div5 = wbe.diversity_filter(image, filter_size_x=5, filter_size_y=5)

wbe.emboss_filter

wbe.emboss_filter(
    input,
    direction=None,
    clip_amount=None,
    output_path=None,
    callback=None,
) -> Raster

Directional emboss convolution filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
directionstr | None"n"Emboss direction: n, s, e, w, ne, nw, se, sw
clip_amountfloat | None0.0Optional symmetric tail clipping percent (0-40)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

emb = wbe.emboss_filter(image)
emb_ne = wbe.emboss_filter(image, direction='ne', clip_amount=1.0)

wbe.high_pass_filter

wbe.high_pass_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

High-pass filter using neighborhood mean subtraction.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

hp = wbe.high_pass_filter(image)
hp7 = wbe.high_pass_filter(image, filter_size_x=7, filter_size_y=7)

wbe.high_pass_bilateral_filter

wbe.high_pass_bilateral_filter(
    input,
    sigma_dist=None,
    sigma_int=None,
    treat_as_rgb=None,
    assume_three_band_rgb=None,
    output_path=None,
    callback=None,
) -> Raster

Computes a high-pass residual by subtracting bilateral smoothing from the input raster. This emphasizes local texture while reducing dominance of strong edges.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
sigma_distfloat | None0.75Spatial Gaussian standard deviation in pixels (0.5–20.0)
sigma_intfloat | None1.0Intensity Gaussian standard deviation in raster-value units
treat_as_rgbbool | NoneFalseForce packed RGB HSI-intensity processing
assume_three_band_rgbbool | NoneTrueEnable 3-band RGB heuristic when metadata is absent
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

hpb = wbe.high_pass_bilateral_filter(image)
hpb_tex = wbe.high_pass_bilateral_filter(image, sigma_dist=2.5, sigma_int=4.0)

wbe.laplacian_filter

wbe.laplacian_filter(
    input,
    variant=None,
    clip_amount=None,
    output_path=None,
    callback=None,
) -> Raster

Laplacian edge/sharpen filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
variantstr | None"3x3(1)"Kernel variant: 3x3(1), 3x3(2), 3x3(3), 3x3(4), 5x5(1), 5x5(2)
clip_amountfloat | None0.0Optional symmetric tail clipping percent (0-40)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

lap = wbe.laplacian_filter(image)
lap5 = wbe.laplacian_filter(image, variant='5x5(1)', clip_amount=1.0)

wbe.line_detection_filter

wbe.line_detection_filter(
    input,
    variant=None,
    abs_values=None,
    clip_tails=None,
    output_path=None,
    callback=None,
) -> Raster

Directional line-detection convolution filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
variantstr | None"v"Line direction variant: v, h, 45, 135
abs_valuesbool | NoneFalseIf True, return absolute response
clip_tailsfloat | None0.0Optional symmetric tail clipping percent (0-40)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

line_v = wbe.line_detection_filter(image)
line_45 = wbe.line_detection_filter(image, variant='45', abs_values=True)

wbe.line_thinning

wbe.line_thinning(
    input,
    output_path=None,
    callback=None,
) -> Raster

Performs iterative skeletonization, reducing connected binary features to one-cell-wide lines.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster; positive values are treated as foreground
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

skeleton = wbe.line_thinning(binary_image)

wbe.generalize_classified_raster

wbe.generalize_classified_raster(
    input,
    area_threshold=5,
    method="longest",
    output_path=None,
    callback=None,
) -> Raster

Generalizes a classified raster by reassigning small patches to neighboring classes. Use method="longest", "largest", or "nearest" depending on the desired merge behavior.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput classified raster
area_thresholdint5Minimum feature size (cells); smaller patches are reassigned
methodstr"longest"Merge strategy: longest, largest, or nearest
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

generalized = wbe.generalize_classified_raster(
    classes,
    area_threshold=15,
    method="largest",
)

wbe.majority_filter

wbe.majority_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window majority (mode) filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

maj = wbe.majority_filter(image)
maj3 = wbe.majority_filter(image, filter_size_x=3, filter_size_y=3)

wbe.maximum_filter

wbe.maximum_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window maximum filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

mx = wbe.maximum_filter(image)
mx7 = wbe.maximum_filter(image, filter_size_x=7, filter_size_y=7)

wbe.mean_filter

wbe.mean_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window mean filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

mn = wbe.mean_filter(image)
mn9 = wbe.mean_filter(image, filter_size_x=9, filter_size_y=9)

wbe.median_filter

wbe.median_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    sig_digits=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window median filter using quantization bins controlled by sig_digits.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
sig_digitsint | None2Significant digits used for quantized rank filtering
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

med = wbe.median_filter(image)
med_precise = wbe.median_filter(image, filter_size_x=7, filter_size_y=7, sig_digits=3)

wbe.minimum_filter

wbe.minimum_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window minimum filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

mn = wbe.minimum_filter(image)
mn5 = wbe.minimum_filter(image, filter_size_x=5, filter_size_y=5)

wbe.percentile_filter

wbe.percentile_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    sig_digits=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window percentile-rank filter using quantization bins controlled by sig_digits.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
sig_digitsint | None2Significant digits used for quantized rank filtering
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

pct = wbe.percentile_filter(image)
pct_precise = wbe.percentile_filter(image, filter_size_x=7, filter_size_y=7, sig_digits=3)

wbe.prewitt_filter

wbe.prewitt_filter(
    input,
    clip_tails=None,
    output_path=None,
    callback=None,
) -> Raster

Prewitt edge-detection filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
clip_tailsfloat | None0.0Optional symmetric tail clipping percent (0-40)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

prew = wbe.prewitt_filter(image)
prew_clip = wbe.prewitt_filter(image, clip_tails=1.0)

wbe.range_filter

wbe.range_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window range filter (max - min).

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

rng = wbe.range_filter(image)
rng7 = wbe.range_filter(image, filter_size_x=7, filter_size_y=7)

wbe.remove_spurs

wbe.remove_spurs(
    input,
    max_iterations=None,
    output_path=None,
    callback=None,
) -> Raster

Removes small spur branches from binary raster features using iterative pruning templates.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster; positive values are treated as foreground
max_iterationsint | None10Maximum number of pruning iterations
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

pruned = wbe.remove_spurs(binary_image)
pruned_strict = wbe.remove_spurs(binary_image, max_iterations=20)

wbe.roberts_cross_filter

wbe.roberts_cross_filter(
    input,
    clip_amount=None,
    output_path=None,
    callback=None,
) -> Raster

Roberts Cross edge-detection filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
clip_amountfloat | None0.0Optional symmetric tail clipping percent (0-40)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

rob = wbe.roberts_cross_filter(image)
rob_clip = wbe.roberts_cross_filter(image, clip_amount=1.0)

wbe.scharr_filter

wbe.scharr_filter(
    input,
    clip_tails=None,
    output_path=None,
    callback=None,
) -> Raster

Scharr edge-detection filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
clip_tailsfloat | None0.0Optional symmetric tail clipping percent (0-40)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

sch = wbe.scharr_filter(image)
sch_clip = wbe.scharr_filter(image, clip_tails=1.0)

wbe.sobel_filter

wbe.sobel_filter(
    input,
    variant=None,
    clip_tails=None,
    output_path=None,
    callback=None,
) -> Raster

Sobel edge-detection filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
variantstr | None"3x3"Kernel size variant: 3x3 or 5x5
clip_tailsfloat | None0.0Optional symmetric tail clipping percent (0-40)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

sob = wbe.sobel_filter(image)
sob5 = wbe.sobel_filter(image, variant='5x5', clip_tails=1.0)

wbe.standard_deviation_filter

wbe.standard_deviation_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window standard deviation filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

std = wbe.standard_deviation_filter(image)
std5 = wbe.standard_deviation_filter(image, filter_size_x=5, filter_size_y=5)

wbe.total_filter

wbe.total_filter(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Moving-window total (sum) filter.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

tot = wbe.total_filter(image)
tot9 = wbe.total_filter(image, filter_size_x=9, filter_size_y=9)

wbe.user_defined_weights_filter

wbe.user_defined_weights_filter(
    input,
    weights,
    kernel_center=None,
    normalize_weights=None,
    output_path=None,
    callback=None,
) -> Raster

Applies a user-defined convolution kernel.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
weightslist[list[float]]required2D convolution kernel with equal row lengths
kernel_centerstr | None"center"Kernel center policy (center by default)
normalize_weightsbool | NoneFalseIf True, normalize kernel sum before convolution
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

sharpen = wbe.user_defined_weights_filter(
    image,
    weights=[[0, -1, 0], [-1, 5, -1], [0, -1, 0]],
)

wbe.flip_image

wbe.flip_image(
    input,
    direction=None,
    output_path=None,
    callback=None,
) -> Raster

Flips an image vertically, horizontally, or both.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
directionstr | None"vertical"Flip direction: vertical, horizontal, or both
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

flip_v = wbe.flip_image(image)
flip_h = wbe.flip_image(image, direction='horizontal')
flip_b = wbe.flip_image(image, direction='both')

wbe.direct_decorrelation_stretch

wbe.direct_decorrelation_stretch(
    input,
    achromatic_factor=None,
    clip_percent=None,
    output_path=None,
    callback=None,
) -> Raster

Improves packed RGB image saturation by reducing the achromatic component and linearly stretching the result.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput packed RGB raster
achromatic_factorfloat | None0.5Grey-component reduction factor from 0 to 1
clip_percentfloat | None1.0Percent tail clipping used in the final linear stretch
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

dds = wbe.direct_decorrelation_stretch(rgb_image)
dds_strong = wbe.direct_decorrelation_stretch(rgb_image, achromatic_factor=0.7, clip_percent=2.0)

wbe.image_slider

wbe.image_slider(
    left_raster,
    right_raster,
    output_html_file=None,
    left_label="",
    right_label="",
    image_height=600,
    callback=None,
) -> str

Creates an interactive HTML swipe/slider view for two input rasters. The tool also writes PNG previews beside the HTML output.

Parameters

NameTypeDefaultDescription
left_rasterRasterrequiredLeft image input
right_rasterRasterrequiredRight image input
output_html_filestr | NoneNoneHTML output path; defaults to image_slider.html in the working directory
left_labelstr""Optional left-side label
right_labelstr""Optional right-side label
image_heightint600Slider height in pixels (minimum 50)
callbackcallable | NoneNoneProgress/message event handler

Examples

html = wbe.image_slider(
    left_raster=before,
    right_raster=after,
    left_label="Before",
    right_label="After",
    image_height=640,
    output_html_file="change_slider.html",
)

wbe.integral_image_transform

wbe.integral_image_transform(
    input,
    output_path=None,
    callback=None,
) -> Raster

Computes the summed-area table (integral image) transform for each raster band.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

ii = wbe.integral_image_transform(image)

wbe.opening

wbe.opening(
    input,
    filter_size_x=None,
    filter_size_y=None,
    output_path=None,
    callback=None,
) -> Raster

Performs a morphological opening using a rectangular structuring element.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

opened = wbe.opening(image)
opened7 = wbe.opening(image, filter_size_x=7, filter_size_y=7)

wbe.otsu_thresholding

wbe.otsu_thresholding(
    input,
    output_path=None,
    callback=None,
) -> Raster

Applies Otsu's automatic thresholding to produce a binary raster with values of 0 and 1.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

binary = wbe.otsu_thresholding(image)

wbe.normalized_difference_index

wbe.normalized_difference_index(
    input,
    band1=None,
    band2=None,
    output_path=None,
    callback=None,
) -> Raster

Computes a normalized difference index: (band1 - band2) / (band1 + band2).

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput multiband raster
band1int | None1One-based index of first band
band2int | None2One-based index of second band
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

ndi = wbe.normalized_difference_index(multiband)
ndvi_like = wbe.normalized_difference_index(multiband, band1=5, band2=4)

wbe.histogram_equalization

wbe.histogram_equalization(
    input,
    num_tones=None,
    output_path=None,
    callback=None,
) -> Raster

Applies histogram equalization to improve image contrast.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
num_tonesint | None256Number of output tones
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

eq = wbe.histogram_equalization(input=image)
eq1024 = wbe.histogram_equalization(input=image, num_tones=1024)

wbe.histogram_matching

wbe.histogram_matching(
    input,
    histogram,
    is_cumulative=None,
    output_path=None,
    callback=None,
) -> Raster

Matches an image histogram to a user-supplied reference histogram.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
histogramlist[list[float]] | list[dict]requiredReference histogram as [[value, frequency], ...] or [{"x": value, "y": frequency}, ...]
is_cumulativebool | NoneFalseSet True if histogram frequencies are already cumulative
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

ref = [[0.0, 0.05], [64.0, 0.25], [128.0, 0.75], [255.0, 1.0]]
matched = wbe.histogram_matching(image, histogram=ref, is_cumulative=True)

wbe.histogram_matching_two_images

wbe.histogram_matching_two_images(
    input,
    reference,
    output_path=None,
    callback=None,
) -> Raster

Matches an input image histogram to the histogram of a reference image.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
referenceRasterrequiredReference raster whose distribution is used as the target
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

matched = wbe.histogram_matching_two_images(input=source_image, reference=reference_image)

wbe.gaussian_contrast_stretch

wbe.gaussian_contrast_stretch(
    input,
    num_tones=None,
    output_path=None,
    callback=None,
) -> Raster

Performs Gaussian contrast stretching by matching to a Gaussian reference histogram.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
num_tonesint | None256Number of output tones
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

gcs = wbe.gaussian_contrast_stretch(image)
gcs1024 = wbe.gaussian_contrast_stretch(image, num_tones=1024)

wbe.min_max_contrast_stretch

wbe.min_max_contrast_stretch(
    input,
    min_val,
    max_val,
    num_tones=None,
    output_path=None,
    callback=None,
) -> Raster

Linearly stretches values between user-provided minimum and maximum limits.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
min_valfloatrequiredLower bound for scaling
max_valfloatrequiredUpper bound for scaling
num_tonesint | None256Number of output tones
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

stretch = wbe.min_max_contrast_stretch(image, min_val=50.0, max_val=1500.0)

wbe.mosaic

wbe.mosaic(
    inputs,
    method=None,
    output_path=None,
    callback=None,
) -> Raster

Mosaics two or more rasters into a new output image spanning the combined extent of all input rasters.

Cells with overlap are resolved by input order, with later rasters in inputs taking precedence over earlier rasters.

Parameters

NameTypeDefaultDescription
inputslist[Raster]requiredInput rasters to mosaic (minimum 2)
methodstr | None"nn"Resampling method: "nn", "bilinear", or "cc"
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

mosaic = wbe.mosaic([tile1, tile2, tile3])
mosaic_smooth = wbe.mosaic([tile1, tile2], method="cc", output_path="mosaic.tif")

wbe.mosaic_with_feathering

wbe.mosaic_with_feathering(
    input1,
    input2,
    method=None,
    weight=None,
    output_path=None,
    callback=None,
) -> Raster

Mosaics two rasters and feather-blends overlap zones to reduce seam artifacts.

In overlapping areas, each raster contributes according to distance-to-edge weights, so cells further from source-image edges receive larger influence.

Parameters

NameTypeDefaultDescription
input1RasterrequiredFirst input raster
input2RasterrequiredSecond input raster
methodstr | None"cc"Resampling method: "nn", "bilinear", or "cc"
weightfloat | None4.0Distance-weight exponent used in overlap blending
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

feathered = wbe.mosaic_with_feathering(image1, image2)
feathered_soft = wbe.mosaic_with_feathering(
    image1,
    image2,
    method="bilinear",
    weight=2.0,
    output_path="mosaic_feathered.tif",
)

wbe.k_means_clustering

wbe.k_means_clustering(
    inputs,
    classes,
    max_iterations=None,
    class_change=None,
    initialize=None,
    min_class_size=None,
    out_html=None,
    output_path=None,
    callback=None,
) -> Raster

Performs k-means clustering on two or more input rasters (typically a multispectral stack) and returns a categorical class raster.

Parameters

NameTypeDefaultDescription
inputslist[Raster]requiredInput rasters (minimum 2)
classesintrequiredNumber of target classes
max_iterationsint | None10Maximum iteration count (2-250)
class_changefloat | None2.0Percent changed-cell stop threshold (0-25)
initializestr | None"diagonal"Initial centroid mode: "diagonal" or "random"
min_class_sizeint | None10Minimum class size used when updating centroids
out_htmlstr | NoneNoneOptional output HTML report path
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

classes = wbe.k_means_clustering(
    inputs=[b1, b2, b3],
    classes=10,
    initialize="random",
    out_html="kmeans_report.html",
)

wbe.modified_k_means_clustering

wbe.modified_k_means_clustering(
    inputs,
    merge_dist,
    start_clusters=None,
    max_iterations=None,
    class_change=None,
    out_html=None,
    output_path=None,
    callback=None,
) -> Raster

Runs a modified k-means workflow that begins with an overestimated cluster count and merges nearby centroids during iteration.

Parameters

NameTypeDefaultDescription
inputslist[Raster]requiredInput rasters (minimum 2)
merge_distfloatrequiredEuclidean centroid merge threshold
start_clustersint | None1000Initial cluster count before merging
max_iterationsint | None10Maximum iteration count (2-250)
class_changefloat | None2.0Percent changed-cell stop threshold (0-25)
out_htmlstr | NoneNoneOptional output HTML report path
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

mod_classes = wbe.modified_k_means_clustering(
    inputs=[b1, b2, b3],
    start_clusters=80,
    merge_dist=25.0,
    out_html="modified_kmeans_report.html",
)

wbe.correct_vignetting

wbe.correct_vignetting(
    input,
    pp,
    focal_length=None,
    image_width=None,
    n=None,
    output_path=None,
    callback=None,
) -> Raster

Corrects lens vignetting (darkening toward image edges) relative to a principal point using a cosine falloff model.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster image
ppVector | str | dictrequiredPoint vector layer (path or typed vector object) containing the principal point
focal_lengthfloat | None304.8Camera focal length in mm
image_widthfloat | None228.6Distance between left-right image edges in mm
nfloat | None4.0Vignetting model exponent
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

corrected = wbe.correct_vignetting(
    input=image,
    pp="principal_point.geojson",
    focal_length=304.8,
    image_width=228.6,
    n=4.0,
)

wbe.image_stack_profile

wbe.image_stack_profile(
    inputs,
    points,
    output_html=None,
    callback=None,
) -> dict

Extracts point signatures across an ordered stack of rasters and returns the profile values as structured output. An optional HTML report can also be generated.

points should reference a vector point layer. Each point geometry is mapped to pixel row/column locations using the first raster in inputs.

Parameters

NameTypeDefaultDescription
inputslist[Raster]requiredInput raster stack (minimum 2)
pointsVector | str | dictrequiredPoint vector layer (path or typed vector object) with sample locations
output_htmlstr | NoneNoneOptional HTML report output path
callbackcallable | NoneNoneProgress/message event handler

Examples

profiles = wbe.image_stack_profile(
    inputs=[image1, image2, image3],
    points="sample_points.geojson",
    output_html="stack_profile.html",
)

wbe.panchromatic_sharpening

wbe.panchromatic_sharpening(
    red=None,
    green=None,
    blue=None,
    composite=None,
    pan,
    method=None,
    output_mode=None,
    output_path=None,
    callback=None,
) -> Raster

Fuses multispectral and panchromatic rasters using either Brovey or IHS pan-sharpening.

Provide either separate red/green/blue rasters or a packed RGB composite raster.

output_mode controls output encoding:

  1. packed (default): single-band packed RGB raster
  2. bands: 3-band raster with explicit R, G, B channels

Parameters

NameTypeDefaultDescription
redRaster | NoneNoneRed-band raster (mutually exclusive with composite)
greenRaster | NoneNoneGreen-band raster (mutually exclusive with composite)
blueRaster | NoneNoneBlue-band raster (mutually exclusive with composite)
compositeRaster | NoneNonePacked RGB multispectral raster (mutually exclusive with red/green/blue)
panRasterrequiredPanchromatic raster
methodstr | None"brovey"Fusion method: "brovey" or "ihs"
output_modestr | None"packed"Output encoding: "packed" or "bands"
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

# Default packed RGB output
ps = wbe.panchromatic_sharpening(
    red=red_band, green=green_band, blue=blue_band, pan=pan_band
)

# 3-band RGB output mode
ps_bands = wbe.panchromatic_sharpening(
    composite=rgb_composite,
    pan=pan_band,
    method="ihs",
    output_mode="bands",
)

wbe.resample

wbe.resample(
    inputs,
    cell_size=None,
    base=None,
    method=None,
    output_path=None,
    callback=None,
) -> Raster

Resamples one or more source rasters into a destination grid defined by either an explicit cell_size or a base raster.

If both cell_size and base are provided, base determines the output extent and resolution. Cells with overlap are resolved by input order, with later rasters in inputs taking precedence.

Parameters

NameTypeDefaultDescription
inputslist[Raster]requiredInput rasters to resample (minimum 1)
cell_sizefloat | NoneNoneOutput cell size when base is not provided
baseRaster | NoneNoneBase raster defining output extent/grid (takes precedence over cell_size)
methodstr | None"cc"Resampling method: "nn", "bilinear", or "cc"
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

# Resample to a new cell size over combined input extent
resampled = wbe.resample([image1, image2], cell_size=10.0)

# Resample into an existing grid definition
resampled_to_base = wbe.resample([image1], base=target_grid, method="bilinear")

wbe.piecewise_contrast_stretch

wbe.piecewise_contrast_stretch(
    input,
    transformation_statement,
    num_greytones=1024,
    output_path=None,
    callback=None,
) -> Raster

Applies a piecewise linear contrast transfer function to raster brightness values. For packed RGB rasters, mapping is applied to HSI intensity and colour is preserved.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
transformation_statementstrrequiredBreakpoint statement like "(50,0.1);(120,0.6);(180,0.85)"
num_greytonesint1024Number of output tones for non-RGB output (minimum 32)
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

stretched = wbe.piecewise_contrast_stretch(
    image,
    transformation_statement="(80,0.2);(140,0.7);(200,0.92)",
    num_greytones=512,
)

wbe.percentage_contrast_stretch

wbe.percentage_contrast_stretch(
    input,
    clip=None,
    tail=None,
    num_tones=None,
    output_path=None,
    callback=None,
) -> Raster

Performs linear contrast stretching with percentile clipping.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
clipfloat | None1.0Percentile clip amount (0-50)
tailstr | None"both"Tail clipping mode: both, upper, or lower
num_tonesint | None256Number of output tones
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

stretched = wbe.percentage_contrast_stretch(image)
stretched_custom = wbe.percentage_contrast_stretch(image, clip=2.0, tail='upper', num_tones=512)

wbe.sigmoidal_contrast_stretch

wbe.sigmoidal_contrast_stretch(
    input,
    cutoff=None,
    gain=None,
    num_tones=None,
    output_path=None,
    callback=None,
) -> Raster

Performs a sigmoidal contrast stretch controlled by midpoint (cutoff) and slope (gain).

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
cutofffloat | None0.0Normalized sigmoid midpoint (clamped to 0.0-0.95)
gainfloat | None1.0Sigmoid gain/slope parameter
num_tonesint | None256Number of output tones
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

sig = wbe.sigmoidal_contrast_stretch(image)
sig_strong = wbe.sigmoidal_contrast_stretch(image, cutoff=0.5, gain=10.0, num_tones=512)

wbe.standard_deviation_contrast_stretch

wbe.standard_deviation_contrast_stretch(
    input,
    clip=None,
    num_tones=None,
    output_path=None,
    callback=None,
) -> Raster

Performs a linear contrast stretch using clip bounds derived from the mean and standard deviation of the image.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
clipfloat | None2.0Standard deviation multiplier used to define lower and upper clip bounds
num_tonesint | None256Number of output tones
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

sds = wbe.standard_deviation_contrast_stretch(image)
sds3 = wbe.standard_deviation_contrast_stretch(image, clip=3.0, num_tones=512)

wbe.ihs_to_rgb

wbe.ihs_to_rgb(
    intensity,
    hue,
    saturation,
    red_output=None,
    green_output=None,
    blue_output=None,
    callback=None,
) -> dict[str, Raster]

Converts intensity, hue, and saturation band rasters back to red, green, and blue channels (0–255).

Parameters

NameTypeDefaultDescription
intensityRasterrequiredIntensity band raster (values in 0–1)
hueRasterrequiredHue band raster (radians, 0–2π)
saturationRasterrequiredSaturation band raster (values in 0–1)
red_outputstr | NoneNoneOutput file path for the red band; omit to keep in memory
green_outputstr | NoneNoneOutput file path for the green band; omit to keep in memory
blue_outputstr | NoneNoneOutput file path for the blue band; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Returns

A dict with keys "red", "green", "blue" each holding a single-band Raster with values in 0–255.

Examples

bands = wbe.ihs_to_rgb(intensity, hue, saturation)
red, green, blue = bands["red"], bands["green"], bands["blue"]

wbe.rgb_to_ihs

wbe.rgb_to_ihs(
    red=None,
    green=None,
    blue=None,
    composite=None,
    intensity_output=None,
    hue_output=None,
    saturation_output=None,
    callback=None,
) -> dict[str, Raster]

Transforms red, green, blue rasters (or a packed RGB composite) to intensity, hue, and saturation components using the HSI colour model.

Pass either three separate red/green/blue single-band rasters (each normalised to 0–1 per-band before conversion) or a single packed composite raster.

Parameters

NameTypeDefaultDescription
redRaster | NoneNoneRed-band raster (mutually exclusive with composite)
greenRaster | NoneNoneGreen-band raster (mutually exclusive with composite)
blueRaster | NoneNoneBlue-band raster (mutually exclusive with composite)
compositeRaster | NoneNonePacked RGB composite raster (mutually exclusive with red/green/blue)
intensity_outputstr | NoneNoneOutput file path for the intensity band
hue_outputstr | NoneNoneOutput file path for the hue band
saturation_outputstr | NoneNoneOutput file path for the saturation band
callbackcallable | NoneNoneProgress/message event handler

Returns

A dict with keys "intensity", "hue", "saturation" each holding a single-band Raster.

Examples

# From separate bands
ihs = wbe.rgb_to_ihs(red=red_band, green=green_band, blue=blue_band)

# From a packed composite
ihs = wbe.rgb_to_ihs(composite=rgb_image)
intensity = ihs["intensity"]

wbe.split_colour_composite

wbe.split_colour_composite(
    input,
    red_output=None,
    green_output=None,
    blue_output=None,
    callback=None,
) -> dict[str, Raster]

Splits a packed RGB colour composite into separate red, green, and blue single-band rasters.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput packed RGB raster
red_outputstr | NoneNoneOutput file path for the red band; omit to keep in memory
green_outputstr | NoneNoneOutput file path for the green band; omit to keep in memory
blue_outputstr | NoneNoneOutput file path for the blue band; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Returns

A dict with keys "red", "green", "blue" each holding a single-band Raster with values in 0–255.

Examples

bands = wbe.split_colour_composite(rgb_image)
red = bands["red"]
green = bands["green"]
blue = bands["blue"]

wbe.thicken_raster_line

wbe.thicken_raster_line(
    input,
    output_path=None,
    callback=None,
) -> Raster

Thickens diagonal single-cell raster line segments to prevent crossing between diagonal foreground cells.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster; positive values are treated as line foreground
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

thickened = wbe.thicken_raster_line(lines)

wbe.tophat_transform

wbe.tophat_transform(
    input,
    filter_size_x=None,
    filter_size_y=None,
    variant=None,
    output_path=None,
    callback=None,
) -> Raster

Performs either a white or black morphological top-hat transform.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_size_xint | None11Odd neighborhood width
filter_size_yint | None11Odd neighborhood height
variantstr | None"white"Transform variant: white or black
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

white_hat = wbe.tophat_transform(image)
black_hat = wbe.tophat_transform(image, filter_size_x=9, filter_size_y=9, variant='black')

wbe.canny_edge_detection

wbe.canny_edge_detection(
    input,
    sigma=0.5,
    low_threshold=0.05,
    high_threshold=0.15,
    add_back=False,
    output_path=None,
    callback=None,
) -> Raster

Applies Canny edge detection to a single-band or packed-RGB raster. The algorithm proceeds through four stages: Gaussian smoothing, Sobel gradient computation, non-maximum suppression, and double-threshold hysteresis.

Parameters

NameTypeDefaultDescription
inputRasterrequiredInput raster (single-band or packed RGB)
sigmafloat0.5Standard deviation (in pixels) of the Gaussian smoothing kernel (clamped to 0.15–20)
low_thresholdfloat0.05Low hysteresis threshold as a fraction (0–1) of the high threshold
high_thresholdfloat0.15High hysteresis threshold as a fraction (0–1) of the peak gradient magnitude
add_backboolFalseIf True, edge pixels are zeroed in the original image instead of producing a binary edge map
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

edges = wbe.canny_edge_detection(image)
edges = wbe.canny_edge_detection(image, sigma=1.0, low_threshold=0.05, high_threshold=0.15, output_path='edges.tif')

wbe.min_dist_classification

wbe.min_dist_classification(
    input_rasters,
    training_data,
    class_field_name,
    dist_threshold=None,
    output_path=None,
    callback=None,
) -> Raster

Performs a supervised minimum-distance classification on a stack of single-band rasters using polygon training data. Each unknown pixel is assigned to the class whose mean spectral vector is closest in Euclidean distance. An optional z-score threshold (dist_threshold) can be used to leave uncertain pixels unclassified. Output pixel values are 1-based class integers; unclassified pixels carry the nodata value (−32768).

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per spectral band
training_dataVectorrequiredPolygon vector containing labelled training areas
class_field_namestrrequiredAttribute field name identifying each polygon's class
dist_thresholdfloat | NoneNoneZ-score threshold; pixels whose Euclidean distance exceeds this threshold are left unclassified. Omit to classify all pixels.
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

training = wbe.Vector('training.shp')
classified = wbe.min_dist_classification([band1, band2, band3], training, 'class')
classified = wbe.min_dist_classification([band1, band2, band3], training, 'class', dist_threshold=3.0, output_path='classified.tif')

wbe.parallelepiped_classification

wbe.parallelepiped_classification(
    input_rasters,
    training_data,
    class_field_name,
    output_path=None,
    callback=None,
) -> Raster

Performs a supervised parallelepiped classification on a stack of single-band rasters using polygon training data. For each class, the minimum and maximum pixel values from the training areas define a multi-dimensional hyper-rectangular decision region (parallelepiped). A pixel is assigned to the first class (sorted by smallest spectral volume) whose parallelepiped contains the pixel's feature vector. Pixels that do not fall within any class parallelepiped are left unclassified (nodata = −32768).

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per spectral band
training_dataVectorrequiredPolygon vector containing labelled training areas
class_field_namestrrequiredAttribute field name identifying each polygon's class
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

training = wbe.Vector('training.shp')
classified = wbe.parallelepiped_classification([band1, band2, band3], training, 'class')
classified = wbe.parallelepiped_classification([band1, band2, band3], training, 'class', output_path='classified.tif')

wbe.evaluate_training_sites

wbe.evaluate_training_sites(
    input_rasters,
    training_data,
    class_field_name,
    output_path=None,
    callback=None,
) -> str

Evaluates class separability for polygon training sites across one or more spectral bands, and writes an HTML report containing per-class, per-band distribution statistics (sample count, min, quartiles, median, max, mean, and standard deviation).

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per spectral band
training_dataVectorrequiredPolygon vector containing labelled training areas
class_field_namestrrequiredAttribute field name identifying each polygon's class
output_pathstr | NoneNoneOutput HTML file path; default is training_sites_report.html in the working directory
callbackcallable | NoneNoneProgress/message event handler

Examples

training = wbe.Vector('training.shp')
report = wbe.evaluate_training_sites([band1, band2, band3], training, 'class')
report = wbe.evaluate_training_sites([band1, band2, band3], training, 'class', output_path='training_eval.html')

wbe.generalize_with_similarity

wbe.generalize_with_similarity(
    raster,
    similarity_rasters,
    min_size=5,
    output_path=None,
    callback=None,
) -> Raster

Generalizes a classified raster by identifying small contiguous patches and merging each into a neighboring patch with the most similar multi-band feature center in standardized similarity space.

Parameters

NameTypeDefaultDescription
rasterRasterrequiredInput classified raster
similarity_rastersList[Raster]requiredOne or more rasters used to compute inter-feature similarity
min_sizeint5Minimum feature size (pixels); smaller features are merged
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

generalized = wbe.generalize_with_similarity(classes, [band1, band2, band3])
generalized = wbe.generalize_with_similarity(classes, [band1, band2, band3], min_size=8, output_path='generalized_similarity.tif')

wbe.image_segmentation

wbe.image_segmentation(
    input_rasters,
    threshold=0.5,
    steps=10,
    min_area=4,
    output_path=None,
    callback=None,
) -> Raster

Segments a multi-band raster stack into contiguous, relatively homogeneous regions using seeded region growing in standardized feature space. An optional minimum-area post-process can merge undersized regions into similar neighbors.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per input band
thresholdfloat0.5Region-growing distance threshold in standardized feature space
stepsint10Number of seed-priority levels; higher values provide finer seed stratification
min_areaint4Minimum segment area in pixels; smaller segments are merged in cleanup
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

segments = wbe.image_segmentation([band1, band2, band3])
segments = wbe.image_segmentation([band1, band2, band3], threshold=0.45, steps=12, min_area=6, output_path='segments.tif')

wbe.fuzzy_knn_classification

wbe.fuzzy_knn_classification(
    input_rasters,
    training_data,
    class_field_name,
    scaling_method="none",
    k=5,
    m=2.0,
    output_path=None,
    probability_output_path=None,
    callback=None,
) -> Tuple[Raster, Raster]

Performs fuzzy k-nearest-neighbor classification and returns both a crisp class raster and a membership-probability raster (the winning-class membership per cell).

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint/polygon training vector with class labels
class_field_namestrrequiredClass field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
kint5Number of neighbors
mfloat2.0Fuzzy exponent parameter (> 1)
output_pathstr | NoneNoneOptional classified raster output path
probability_output_pathstr | NoneNoneOptional probability raster output path
callbackcallable | NoneNoneProgress/message event handler

Examples

classified, probability = wbe.fuzzy_knn_classification([band1, band2, band3], training, 'class')
classified, probability = wbe.fuzzy_knn_classification(
    [band1, band2, band3],
    training,
    'class',
    scaling_method='standardize',
    k=7,
    m=2.0,
    output_path='fuzzy_knn_classified.tif',
    probability_output_path='fuzzy_knn_probability.tif',
)

wbe.knn_classification

wbe.knn_classification(
    input_rasters,
    training_data,
    class_field_name,
    scaling_method="none",
    k=5,
    use_clipping=False,
    output_path=None,
    callback=None,
) -> Raster

Performs supervised k-nearest-neighbor classification on a multi-band raster stack.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint/polygon training vector with class labels
class_field_namestrrequiredClass field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
kint5Number of neighbors
use_clippingboolFalseIf True, removes misclassified training samples using leave-one-out pre-clipping
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

classified = wbe.knn_classification([band1, band2, band3], training, 'class')
classified = wbe.knn_classification(
    [band1, band2, band3],
    training,
    'class',
    scaling_method='standardize',
    k=7,
    use_clipping=True,
    output_path='knn_classified.tif',
)

wbe.knn_regression

wbe.knn_regression(
    input_rasters,
    training_data,
    field_name,
    scaling_method="none",
    k=5,
    distance_weighting=False,
    output_path=None,
    callback=None,
) -> Raster

Performs supervised k-nearest-neighbor regression using point-based training targets.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint training vector with numeric target values
field_namestrrequiredNumeric target field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
kint5Number of neighbors
distance_weightingboolFalseIf True, predictions use inverse-distance weighted averaging
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

pred = wbe.knn_regression([band1, band2, band3], training_points, 'value')
pred = wbe.knn_regression(
    [band1, band2, band3],
    training_points,
    'value',
    scaling_method='standardize',
    k=8,
    distance_weighting=True,
    output_path='knn_regression.tif',
)

wbe.logistic_regression

wbe.logistic_regression(
    input_rasters,
    training_data,
    class_field_name,
    scaling_method="none",
    alpha=0.0,
    output_path=None,
    callback=None,
) -> Raster

Performs supervised logistic regression classification on multi-band predictors.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint/polygon training vector with class labels
class_field_namestrrequiredClass field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
alphafloat0.0L2 regularization weight
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

classified = wbe.logistic_regression([band1, band2, band3], training, 'class')
classified = wbe.logistic_regression(
    [band1, band2, band3],
    training,
    'class',
    scaling_method='standardize',
    alpha=0.1,
    output_path='logistic_regression.tif',
)

wbe.svm_classification

wbe.svm_classification(
    input_rasters,
    training_data,
    class_field_name,
    scaling_method="none",
    kernel="linear",
    c=1.0,
    gamma=None,
    epoch=2,
    output_path=None,
    callback=None,
) -> Raster

Performs supervised support-vector-machine classification using one-vs-rest voting for multiclass labels.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint/polygon training vector with class labels
class_field_namestrrequiredClass field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
kernelstr"linear"SVM kernel: "linear" or "rbf"
cfloat1.0Regularization parameter
gammafloat | NoneNoneRBF gamma; defaults to 1 / n_features when omitted
epochint2Number of training epochs
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

classified = wbe.svm_classification([band1, band2, band3], training, 'class')
classified = wbe.svm_classification(
    [band1, band2, band3],
    training,
    'class',
    scaling_method='standardize',
    kernel='rbf',
    c=2.0,
    gamma=0.25,
    epoch=3,
    output_path='svm_classified.tif',
)

wbe.svm_regression

wbe.svm_regression(
    input_rasters,
    training_data,
    field_name,
    scaling_method="none",
    kernel="linear",
    c=1.0,
    gamma=None,
    eps=0.1,
    tol=1e-3,
    output_path=None,
    callback=None,
) -> Raster

Performs supervised support-vector-machine regression on multi-band predictors.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint training vector with numeric target values
field_namestrrequiredNumeric target field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
kernelstr"linear"SVM kernel: "linear" or "rbf"
cfloat1.0Regularization parameter
gammafloat | NoneNoneRBF gamma; defaults to 1 / n_features when omitted
epsfloat0.1Epsilon-insensitive loss width
tolfloat1e-3Optimizer convergence tolerance
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

pred = wbe.svm_regression([band1, band2, band3], training_points, 'value')
pred = wbe.svm_regression(
    [band1, band2, band3],
    training_points,
    'value',
    scaling_method='standardize',
    kernel='rbf',
    c=2.0,
    gamma=0.25,
    eps=0.05,
    tol=1e-3,
    output_path='svm_regression.tif',
)

wbe.random_forest_classification

wbe.random_forest_classification(
    input_rasters,
    training_data,
    class_field_name,
    scaling_method="none",
    n_trees=200,
    min_samples_leaf=1,
    min_samples_split=2,
    output_path=None,
    callback=None,
) -> Raster

Performs supervised random forest classification using point/polygon training data.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint/polygon training vector with class labels
class_field_namestrrequiredClass field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
n_treesint200Number of trees in the forest
min_samples_leafint1Minimum number of samples at each leaf
min_samples_splitint2Minimum number of samples to split a node
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

classified = wbe.random_forest_classification([band1, band2, band3], training, 'class')
classified = wbe.random_forest_classification(
    [band1, band2, band3],
    training,
    'class',
    scaling_method='standardize',
    n_trees=300,
    min_samples_leaf=1,
    min_samples_split=2,
    output_path='rf_classified.tif',
)

wbe.random_forest_regression

wbe.random_forest_regression(
    input_rasters,
    training_data,
    field_name,
    scaling_method="none",
    n_trees=200,
    min_samples_leaf=1,
    min_samples_split=2,
    output_path=None,
    callback=None,
) -> Raster

Performs supervised random forest regression using point training targets.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint training vector with numeric target values
field_namestrrequiredNumeric target field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
n_treesint200Number of trees in the forest
min_samples_leafint1Minimum number of samples at each leaf
min_samples_splitint2Minimum number of samples to split a node
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

pred = wbe.random_forest_regression([band1, band2, band3], training_points, 'value')
pred = wbe.random_forest_regression(
    [band1, band2, band3],
    training_points,
    'value',
    scaling_method='standardize',
    n_trees=300,
    min_samples_leaf=1,
    min_samples_split=2,
    output_path='rf_regression.tif',
)

wbe.random_forest_classification_fit

wbe.random_forest_classification_fit(
    input_rasters,
    training_data,
    class_field_name,
    scaling_method="none",
    split_criterion="gini",
    n_trees=200,
    min_samples_leaf=1,
    min_samples_split=2,
    test_proportion=0.2,
    callback=None,
) -> List[int]

Fits a random forest classifier and returns serialized model bytes for later prediction.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint/polygon training vector with class labels
class_field_namestrrequiredClass field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
split_criterionstr"gini"Legacy split criterion argument for compatibility
n_treesint200Number of trees in the forest
min_samples_leafint1Minimum number of samples at each leaf
min_samples_splitint2Minimum number of samples to split a node
test_proportionfloat0.2Legacy compatibility parameter for train/test split workflows
callbackcallable | NoneNoneProgress/message event handler

Examples

model_bytes = wbe.random_forest_classification_fit([band1, band2, band3], training, 'class')

wbe.random_forest_classification_predict

wbe.random_forest_classification_predict(
    input_rasters,
    model_bytes,
    output_path=None,
    callback=None,
) -> Raster

Applies a fitted random forest classification model (byte-array payload) to predictor rasters.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
model_bytesList[int]requiredModel bytes returned by wbe.random_forest_classification_fit
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

model_bytes = wbe.random_forest_classification_fit([band1, band2, band3], training, 'class')
classified = wbe.random_forest_classification_predict([band1, band2, band3], model_bytes)

wbe.random_forest_regression_fit

wbe.random_forest_regression_fit(
    input_rasters,
    training_data,
    field_name,
    scaling_method="none",
    n_trees=200,
    min_samples_leaf=1,
    min_samples_split=2,
    test_proportion=0.2,
    callback=None,
) -> List[int]

Fits a random forest regressor and returns serialized model bytes for later prediction.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint training vector with numeric target values
field_namestrrequiredNumeric target field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
n_treesint200Number of trees in the forest
min_samples_leafint1Minimum number of samples at each leaf
min_samples_splitint2Minimum number of samples to split a node
test_proportionfloat0.2Legacy compatibility parameter for train/test split workflows
callbackcallable | NoneNoneProgress/message event handler

Examples

model_bytes = wbe.random_forest_regression_fit([band1, band2, band3], training_points, 'value')

wbe.random_forest_regression_predict

wbe.random_forest_regression_predict(
    input_rasters,
    model_bytes,
    output_path=None,
    callback=None,
) -> Raster

Applies a fitted random forest regression model (byte-array payload) to predictor rasters.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
model_bytesList[int]requiredModel bytes returned by wbe.random_forest_regression_fit
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

model_bytes = wbe.random_forest_regression_fit([band1, band2, band3], training_points, 'value')
pred = wbe.random_forest_regression_predict([band1, band2, band3], model_bytes)

wbe.nnd_classification

wbe.nnd_classification(
    input_rasters,
    training_data,
    class_field_name,
    scaling_method="none",
    z_threshold=1.96,
    outlier_is_zero=True,
    k=25,
    output_path=None,
    callback=None,
) -> Raster

Performs nearest-normalized-distance classification. For each class, distances are normalized by within-class distance statistics; optional thresholding can flag outliers.

Parameters

NameTypeDefaultDescription
input_rastersList[Raster]requiredOne single-band raster per feature band
training_dataVectorrequiredPoint/polygon training vector with class labels
class_field_namestrrequiredClass field name in training attributes
scaling_methodstr"none"Feature scaling mode: "none", "normalize", "standardize"
z_thresholdfloat1.96Outlier threshold in normalized-distance units
outlier_is_zeroboolTrueIf True, outliers are encoded as class 0; otherwise as nodata
kint25Neighborhood size used in class-distance estimates
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Examples

classified = wbe.nnd_classification([band1, band2, band3], training, 'class')
classified = wbe.nnd_classification(
    [band1, band2, band3],
    training,
    'class',
    scaling_method='standardize',
    z_threshold=2.0,
    outlier_is_zero=True,
    k=25,
    output_path='nnd_classified.tif',
)

Geomorphometry And Terrain Signatures

Whitebox Workflows for Python — Geomorphometry Tools

This document covers all Geomorphometry tools exposed through the WbEnvironment API. For common conventions, Raster I/O, and math operators see TOOLS.md.


Geomorphometry

Terrain analysis and land-surface form tools available on WbEnvironment.

Tools (Alphabetical)

  • wbe.accumulation_curvature
  • wbe.average_normal_vector_angular_deviation
  • wbe.aspect
  • wbe.assess_route
  • wbe.average_horizon_distance
  • wbe.breakline_mapping
  • wbe.casorati_curvature
  • wbe.circular_variance_of_aspect
  • wbe.contours_from_points
  • wbe.contours_from_raster
  • wbe.curvedness
  • wbe.convergence_index
  • wbe.dem_void_filling
  • wbe.deviation_from_mean_elevation
  • wbe.difference_curvature
  • wbe.difference_from_mean_elevation
  • wbe.directional_relief
  • wbe.downslope_index
  • wbe.edge_density
  • wbe.embankment_mapping
  • wbe.elev_above_pit
  • wbe.elev_above_pit_dist
  • wbe.elev_relative_to_min_max
  • wbe.elev_relative_to_watershed_min_max
  • wbe.elevation_percentile
  • wbe.exposure_towards_wind_flux
  • wbe.max_downslope_elev_change
  • wbe.max_upslope_elev_change
  • wbe.feature_preserving_smoothing
  • wbe.gaussian_curvature
  • wbe.fetch_analysis
  • wbe.fill_missing_data
  • wbe.find_ridges
  • wbe.geomorphons
  • wbe.generating_function
  • wbe.horizon_angle
  • wbe.horizon_area
  • wbe.hillshade
  • wbe.hypsometric_analysis
  • wbe.hypsometrically_tinted_hillshade
  • wbe.local_hypsometric_analysis
  • wbe.low_points_on_headwater_divides
  • wbe.map_off_terrain_objects
  • wbe.horizontal_excess_curvature
  • wbe.maximal_curvature
  • wbe.max_difference_from_mean
  • wbe.max_anisotropy_dev
  • wbe.max_anisotropy_dev_signature
  • wbe.max_branch_length
  • wbe.max_elevation_deviation
  • wbe.max_elev_dev_signature
  • wbe.mean_curvature
  • wbe.min_downslope_elev_change
  • wbe.minimal_curvature
  • wbe.multidirectional_hillshade
  • wbe.multiscale_curvatures
  • wbe.multiscale_elevated_index
  • wbe.multiscale_elevation_percentile
  • wbe.multiscale_low_lying_index
  • wbe.multiscale_roughness
  • wbe.multiscale_roughness_signature
  • wbe.multiscale_std_dev_normals
  • wbe.multiscale_std_dev_normals_signature
  • wbe.multiscale_topographic_position_class
  • wbe.multiscale_topographic_position_image
  • wbe.num_downslope_neighbours
  • wbe.num_upslope_neighbours
  • wbe.openness
  • wbe.pennock_landform_classification
  • wbe.plan_curvature
  • wbe.percent_elev_range
  • wbe.principal_curvature_direction
  • wbe.profile
  • wbe.profile_curvature
  • wbe.relative_aspect
  • wbe.relative_topographic_position
  • wbe.remove_off_terrain_objects
  • wbe.relative_stream_power_index
  • wbe.ring_curvature
  • wbe.rotor
  • wbe.ruggedness_index
  • wbe.sediment_transport_index
  • wbe.shape_index
  • wbe.soil_landscape_classification
  • wbe.spherical_std_dev_of_normals
  • wbe.sky_view_factor
  • wbe.shadow_animation
  • wbe.shadow_image
  • wbe.skyline_analysis
  • wbe.smooth_vegetation_residual
  • wbe.slope
  • wbe.slope_vs_aspect_plot
  • wbe.slope_vs_elev_plot
  • wbe.standard_deviation_of_slope
  • wbe.surface_area_ratio
  • wbe.tangential_curvature
  • wbe.time_in_daylight
  • wbe.topographic_hachures
  • wbe.topographic_position_animation
  • wbe.topo_render
  • wbe.total_curvature
  • wbe.unsphericity
  • wbe.visibility_index
  • wbe.vertical_excess_curvature
  • wbe.viewshed
  • wbe.wetness_index

Basic terrain tools

wbe.slope

wbe.slope(input, units='degrees', z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates slope gradient for each cell in a DEM.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
unitsstr'degrees'Output units: 'degrees', 'radians', or 'percent'
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.aspect

wbe.aspect(input, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates slope aspect (orientation, degrees clockwise from north) for each cell in a DEM. Flat surfaces return −1.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.convergence_index

wbe.convergence_index(input, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates the convergence/divergence index based on neighbour aspects relative to the center cell.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.hillshade

wbe.hillshade(input, azimuth=315.0, altitude=30.0, z_factor=1.0, output_path=None, callback=None) -> Raster

Produces a shaded-relief image from a DEM. Output values are scaled 0–32767.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
azimuthfloat315.0Illumination azimuth, degrees clockwise from north (0–360)
altitudefloat30.0Illumination altitude above horizon, degrees (0–90)
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Single-scale curvature signature

wbe.multidirectional_hillshade

wbe.multidirectional_hillshade(input, altitude=30.0, z_factor=1.0, full_360_mode=False, output_path=None, callback=None) -> Raster

Produces a weighted multi-azimuth shaded-relief image. In the default 4-direction mode illumination azimuths of 225°, 270°, 315°, and 360° are combined with weights 0.1, 0.4, 0.4, 0.1. In 360-degree mode eight evenly spaced azimuths are used. Output values are scaled 0–32767.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
altitudefloat30.0Illumination altitude above horizon, degrees (0–90)
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
full_360_modeboolFalseUse 8 azimuths (360°) instead of 4
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.ruggedness_index

wbe.ruggedness_index(input, output_path=None, callback=None) -> Raster

Calculates the terrain ruggedness index (TRI) after Riley et al. (1999). Each cell value is the root-mean-square deviation of the 8 surrounding elevation differences from the centre cell.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.surface_area_ratio

wbe.surface_area_ratio(input, output_path=None, callback=None) -> Raster

Calculates the ratio of 3D surface area to planimetric cell area using the Jenness (2004) triangular-facet method. Values ≥ 1; flat terrain returns 1.0. Geographic (lat/lon) rasters apply per-row cosine scaling.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.elev_relative_to_min_max

wbe.elev_relative_to_min_max(input, output_path=None, callback=None) -> Raster

Expresses each elevation as a percentage (0–100) of the raster's global elevation range: (z − min) / (max − min) × 100.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.wetness_index

wbe.wetness_index(sca, slope, output_path=None, callback=None) -> Raster

Calculates the topographic wetness index (TWI): ln(SCA / tan(slope)). Cells where slope ≤ 0° or SCA ≤ 0 are output as nodata.

NameTypeDefaultDescription
scaRasterrequiredSpecific catchment area raster
slopeRasterrequiredSlope raster in degrees
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.relative_stream_power_index

wbe.relative_stream_power_index(sca, slope, exponent=1.0, output_path=None, callback=None) -> Raster

Calculates the relative stream power index: SCA^p * tan(slope), where slope is in degrees and p is a user-controlled exponent.

NameTypeDefaultDescription
scaRasterrequiredSpecific catchment area raster
slopeRasterrequiredSlope raster in degrees
exponentfloat1.0Specific catchment area exponent p
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.sediment_transport_index

wbe.sediment_transport_index(sca, slope, sca_exponent=0.4, slope_exponent=1.3, output_path=None, callback=None) -> Raster

Calculates the sediment transport index (LS factor): (n + 1) * (SCA / 22.13)^n * (sin(slope) / 0.0896)^m, where slope is in degrees, n is sca_exponent, and m is slope_exponent.

NameTypeDefaultDescription
scaRasterrequiredSpecific catchment area raster
slopeRasterrequiredSlope raster in degrees
sca_exponentfloat0.4Specific catchment area exponent n
slope_exponentfloat1.3Slope exponent m
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.elev_relative_to_watershed_min_max

wbe.elev_relative_to_watershed_min_max(dem, watersheds, output_path=None, callback=None) -> Raster

Expresses each DEM elevation as a percentage (0-100) of the min-max range within its watershed zone.

NameTypeDefaultDescription
demRasterrequiredInput DEM raster
watershedsRasterrequiredWatershed ID raster
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.percent_elev_range

wbe.percent_elev_range(input, filter_size_x=11, filter_size_y=None, output_path=None, callback=None) -> Raster

Computes local topographic position as a percent of neighbourhood elevation range.

wbe.relative_topographic_position

wbe.relative_topographic_position(input, filter_size_x=11, filter_size_y=None, output_path=None, callback=None) -> Raster

Computes relative topographic position using neighbourhood min, mean, and max, scaled to [-1, 1].

wbe.num_downslope_neighbours

wbe.num_downslope_neighbours(input, output_path=None, callback=None) -> Raster

Counts the number of 8-neighbour cells that are lower than each DEM cell.

wbe.num_upslope_neighbours

wbe.num_upslope_neighbours(input, output_path=None, callback=None) -> Raster

Counts the number of 8-neighbour cells that are higher than each DEM cell.

wbe.max_downslope_elev_change

wbe.max_downslope_elev_change(input, output_path=None, callback=None) -> Raster

Computes the maximum elevation drop from each cell to any lower neighbour.

wbe.max_upslope_elev_change

wbe.max_upslope_elev_change(input, output_path=None, callback=None) -> Raster

Computes the maximum elevation gain from each cell to any higher neighbour.

wbe.min_downslope_elev_change

wbe.min_downslope_elev_change(input, output_path=None, callback=None) -> Raster

Computes the minimum non-negative elevation drop from each cell to neighbours.

wbe.elevation_percentile

wbe.elevation_percentile(input, filter_size_x=11, filter_size_y=None, sig_digits=2, output_path=None, callback=None) -> Raster

Computes the local percentile rank (0-100) of each elevation value within a moving neighbourhood.

wbe.downslope_index

wbe.downslope_index(input, vertical_drop=2.0, output_type='tangent', output_path=None, callback=None) -> Raster

Computes the Hjerdt et al. downslope index using a D8 flow path to the first point that reaches the requested vertical drop.

wbe.elev_above_pit

wbe.elev_above_pit(input, output_path=None, callback=None) -> Raster

Calculates each cell elevation above the nearest downslope pit (or edge sink).

wbe.elev_above_pit_dist

wbe.elev_above_pit_dist(input, output_path=None, callback=None) -> Raster

Compatibility alias of wbe.elev_above_pit.

wbe.circular_variance_of_aspect

wbe.circular_variance_of_aspect(input, filter=11, output_path=None, callback=None) -> Raster

Calculates local circular variance of aspect (0 = uniform aspect, 1 = highly variable aspect).

wbe.hypsometric_analysis

wbe.hypsometric_analysis(inputs, watershed=None, output_path=None, callback=None) -> str

Creates an HTML hypsometric curve report for one or more DEMs, with optional watershed grouping.

wbe.profile

wbe.profile(lines_vector, surface, output_path=None, callback=None) -> str

Creates an HTML profile plot of elevation versus distance sampled along one or more input polyline features.

NameTypeDefaultDescription
lines_vectorVectorrequiredInput polyline vector containing profile lines
surfaceRasterrequiredInput surface raster sampled along each line
output_pathstr | NoneNoneOutput HTML report path
callbackcallable | NoneNoneProgress/message event handler

wbe.hypsometrically_tinted_hillshade

wbe.hypsometrically_tinted_hillshade(input, solar_altitude=45.0, hillshade_weight=0.5, brightness=0.5, atmospheric_effects=0.0, palette='atlas', reverse_palette=False, full_360_mode=False, z_factor=1.0, output_path=None, callback=None) -> Raster

Creates a Swiss-style terrain rendering by blending hypsometric tint with multi-azimuth hillshade and optional atmospheric haze effects.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
solar_altitudefloat45.0Illumination altitude in degrees [0, 90]
hillshade_weightfloat0.5Relative hillshade contribution in [0, 1]
brightnessfloat0.5Brightness tuning in [0, 1]
atmospheric_effectsfloat0.0Atmospheric haze amount in [0, 1]
palettestr'atlas'Hypsometric palette name
reverse_paletteboolFalseReverse palette ordering
full_360_modeboolFalseUse 8-direction illumination (true) instead of 4-direction mode
z_factorfloat1.0Vertical scaling factor for elevations
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.local_hypsometric_analysis

wbe.local_hypsometric_analysis(input, min_scale=4, step_size=1, num_steps=10, step_nonlinearity=1.0, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes local hypsometric integral (HI) across a nonlinearly sampled range of neighbourhood scales and returns two rasters: the minimum HI value found at each cell and the scale (filter size) where that minimum occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint4Minimum half-window radius in cells
step_sizeint1Base step for scale sampling
num_stepsint10Number of sampled scales
step_nonlinearityfloat1.0Nonlinearity exponent for scale spacing
output_pathstr | NoneNoneOptional path for HI-minimum magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.low_points_on_headwater_divides

wbe.low_points_on_headwater_divides(dem, streams, output_path=None, callback=None) -> Vector

Locates low pass points on divides between neighboring headwater subbasins using a DEM-derived D8 flow network and an input streams raster.

NameTypeDefaultDescription
demRasterrequiredInput depressionless DEM raster
streamsRasterrequiredInput stream raster (positive cells are channels)
output_pathstr | NoneNoneOutput vector path; omit to use a temporary file
callbackcallable | NoneNoneProgress/message event handler

wbe.slope_vs_aspect_plot

wbe.slope_vs_aspect_plot(input, aspect_bin_size=2.0, min_slope=0.1, z_factor=1.0, output_path=None, callback=None) -> str

Creates an HTML radial slope-vs-aspect plot showing 25th/50th/75th percentile slope by aspect bin.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
aspect_bin_sizefloat2.0Aspect bin width in degrees
min_slopefloat0.1Minimum slope threshold (degrees) included in analysis
z_factorfloat1.0Vertical scaling factor for elevations
output_pathstr | NoneNoneOutput HTML path
callbackcallable | NoneNoneProgress/message event handler

wbe.slope_vs_elev_plot

wbe.slope_vs_elev_plot(inputs, watershed=None, output_path=None, callback=None) -> str

Creates an HTML slope-vs-elevation plot for one or more DEMs, with optional watershed grouping per DEM.

NameTypeDefaultDescription
inputslist[Raster]requiredOne or more input DEM rasters
watershedlist[Raster] | NoneNoneOptional watershed rasters matching each DEM
output_pathstr | NoneNoneOutput HTML path
callbackcallable | NoneNoneProgress/message event handler

wbe.directional_relief

wbe.directional_relief(input, azimuth=0.0, max_dist=None, output_path=None, callback=None) -> Raster

Calculates directional relief as the difference between each cell and the mean elevation sampled along a ray in the specified azimuth.

wbe.exposure_towards_wind_flux

wbe.exposure_towards_wind_flux(input, azimuth=0.0, max_dist=None, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates exposure of each terrain cell to a dominant wind direction by combining local slope/aspect with the upwind horizon angle.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
azimuthfloat0.0Dominant wind azimuth in degrees clockwise from north
max_distfloat | NoneNoneOptional maximum search distance for horizon-angle tracing
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.fetch_analysis

wbe.fetch_analysis(input, azimuth=0.0, hgt_inc=0.05, output_path=None, callback=None) -> Raster

Computes upwind distance to the nearest topographic obstacle; edge-truncated fetch values are negative.

wbe.relative_aspect

wbe.relative_aspect(input, azimuth=0.0, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates aspect relative to a specified azimuth; output ranges from 0° (aligned) to 180° (opposed).

wbe.edge_density

wbe.edge_density(input, filter_size=11, norm_diff=5.0, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates local density (0–1) of breaks-in-slope based on normal-vector angular differences.

wbe.find_ridges

wbe.find_ridges(input, line_thin=True, output_path=None, callback=None) -> Raster

Identifies potential ridge and peak cells, with optional post-processing line thinning.

wbe.breakline_mapping

wbe.breakline_mapping(dem, threshold=0.8, min_length=3, output_path=None, callback=None) -> Vector

Maps breaklines by thresholding log-transformed curvedness and vectorizing connected, thinned high-curvature line features.

NameTypeDefaultDescription
demRasterrequiredInput DEM raster
thresholdfloat0.8Minimum log-curvedness threshold
min_lengthint3Minimum output line length in grid cells
output_pathstr | NoneNoneOutput vector path; omit to use a temporary file
callbackcallable | NoneNoneProgress/message event handler

wbe.assess_route

wbe.assess_route(routes, dem, segment_length=100.0, search_radius=15, output_path=None, callback=None) -> Vector

Splits polyline routes into equal-length segments and computes per-segment metrics including average slope, relief, sinuosity, breaks-in-slope, and maximum local openness visibility.

NameTypeDefaultDescription
routesVectorrequiredInput polyline routes vector
demRasterrequiredInput projected DEM raster
segment_lengthfloat100.0Target segment length in map units
search_radiusint15Visibility search radius in grid cells (minimum effective value is 4)
output_pathstr | NoneNoneOutput vector path; omit to use a temporary file
callbackcallable | NoneNoneProgress/message event handler

wbe.contours_from_raster

wbe.contours_from_raster(input, contour_interval=10.0, base_contour=0.0, smoothing_filter_size=9, deflection_tolerance=10.0, output_path=None, callback=None) -> Vector

Creates vector contour polylines from a raster surface using contour interval and base elevation controls. Optional smoothing and deflection-based simplification reduce vertex density.

NameTypeDefaultDescription
inputRasterrequiredInput raster surface (e.g., DEM)
contour_intervalfloat10.0Contour interval
base_contourfloat0.0Base contour value
smoothing_filter_sizeint9Smoothing filter size (odd integer preferred)
deflection_tolerancefloat10.0Minimum bend angle (degrees) retained during simplification
output_pathstr | NoneNoneOutput vector path; defaults to contours_from_raster.shp in working directory
callbackcallable | NoneNoneProgress/message event handler

wbe.contours_from_points

wbe.contours_from_points(input, field_name=None, use_z_values=False, max_triangle_edge_length=None, contour_interval=10.0, base_contour=0.0, smoothing_filter_size=9, output_path=None, callback=None) -> Vector

Creates vector contour polylines from point elevations by building a Delaunay triangulation and extracting contour intersections through each triangle.

NameTypeDefaultDescription
inputVectorrequiredInput point or multipoint vector
field_namestr | NoneNoneNumeric elevation field; required when use_z_values=False unless a numeric field can be auto-selected
use_z_valuesboolFalseUse geometry Z values for elevations
max_triangle_edge_lengthfloat | NoneNoneOptional maximum triangle edge length used in contouring
contour_intervalfloat10.0Contour interval
base_contourfloat0.0Base contour value
smoothing_filter_sizeint9Smoothing filter size (odd integer preferred)
output_pathstr | NoneNoneOutput vector path; defaults to contours_from_points.shp in working directory
callbackcallable | NoneNoneProgress/message event handler

wbe.topographic_hachures

wbe.topographic_hachures(dem, contour_interval=10.0, base_contour=0.0, deflection_tolerance=10.0, filter_size=9, separation=2.0, distmin=0.5, distmax=2.0, discretization=0.5, turnmax=45.0, slopemin=0.5, depth=16, output_path=None, callback=None) -> Vector

Creates topographic hachure polylines from a DEM by extracting contours and tracing slope-following flowlines between and across contour levels. This OSS port preserves the legacy authorship note for the original implementation because it was not authored by John Lindsay.

NameTypeDefaultDescription
demRasterrequiredInput DEM raster
contour_intervalfloat10.0Contour interval
base_contourfloat0.0Base contour value
deflection_tolerancefloat10.0Minimum bend angle retained when simplifying contour seeds
filter_sizeint9Contour smoothing filter size
separationfloat2.0Nominal hachure seed spacing in average-cell units
distminfloat0.5Minimum spacing multiplier used to truncate nearby hachures
distmaxfloat2.0Maximum spacing multiplier used to insert additional hachures
discretizationfloat0.5Flowline step size in average-cell units
turnmaxfloat45.0Maximum allowed turn angle in traced hachures
slopeminfloat0.5Minimum slope angle required for continued tracing
depthint16Recursive infill depth for divergence areas
output_pathstr | NoneNoneOutput vector path; defaults to topographic_hachures.shp in working directory
callbackcallable | NoneNoneProgress/message event handler

wbe.topographic_position_animation

wbe.topographic_position_animation(input, palette='soft', min_scale=1, num_steps=10, step_nonlinearity=1.0, image_height=600, delay=250, label='', use_dev_max=False, output_path=None, callback=None) -> tuple[str, str]

Creates an animated multiscale topographic position visualization, returning the generated HTML viewer path and GIF path.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
palettestr'soft'Palette name used for the DEV animation
min_scaleint1Minimum analysis scale in cells
num_stepsint10Number of animation frames/scales
step_nonlinearityfloat1.0Nonlinear exponent controlling scale spacing
image_heightint600Output animation height in pixels
delayint250GIF frame delay in milliseconds
labelstr''Optional label drawn in the animation viewer
use_dev_maxboolFalseUse cumulative maximum absolute DEV instead of per-step DEV
output_pathstr | NoneNoneOutput HTML path; the GIF is written beside it
callbackcallable | NoneNoneProgress/message event handler

wbe.geomorphons

wbe.geomorphons(input, search_distance=50, flatness_threshold=1.0, flatness_distance=0, skip_distance=0, output_forms=True, analyze_residuals=False, output_path=None, callback=None) -> Raster

Classifies landforms using the geomorphons line-of-sight method. For each direction, the tool compares zenith and nadir angle magnitudes using a ternary rule: positive (2) when the zenith-nadir difference exceeds the flatness threshold, negative (0) when it is below the negative threshold, and flat (1) otherwise. When output_forms=True, outputs the 10 common landform classes; otherwise outputs raw ternary geomorphon codes ordered counter-clockwise from east.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
search_distanceint50Maximum look-up distance in cells per direction (endpoint cell is included)
flatness_thresholdfloat1.0Flatness threshold angle in degrees, applied to the zenith-nadir angle difference
flatness_distanceint0Distance in cells after which the flatness threshold tapers with horizon distance
skip_distanceint0Distance in cells skipped before beginning line-of-sight evaluation
output_formsboolTrueOutput 10 common landform classes instead of raw ternary geomorphon codes
analyze_residualsboolFalseDetrend the DEM with a fitted linear plane before classification
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

search_distance and flatness_distance are interpreted in cell steps (not a fixed map-unit radius), which keeps directional scanning behavior consistent for rasters with non-square pixel sizes. Horizon angles are still computed from true map-space distances.

Common landform classes when output_forms=True:

1   Flat
2   Peak
3   Ridge
4   Shoulder
5   Spur
6   Slope
7   Hollow
8   Footslope
9   Valley
10  Pit

wbe.pennock_landform_classification

wbe.pennock_landform_classification(input, slope_threshold=3.0, prof_curv_threshold=0.1, plan_curv_threshold=0.0, z_factor=1.0, output_path=None, callback=None) -> tuple[Raster, str]

Classifies each DEM cell into one of seven Pennock et al. (1987) landform classes using slope, plan curvature, and profile curvature thresholds.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
slope_thresholdfloat3.0Slope threshold in degrees used to separate level terrain
prof_curv_thresholdfloat0.1Profile curvature threshold (degrees)
plan_curv_thresholdfloat0.0Plan curvature threshold (degrees)
z_factorfloat1.0Vertical scaling factor; if negative and CRS is geographic, an approximate value is inferred from latitude
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Returns a (Raster, str) tuple where the string is a human-readable classification key:

1  Convergent Footslope
2  Divergent Footslope
3  Convergent Shoulder
4  Divergent Shoulder
5  Convergent Backslope
6  Divergent Backslope
7  Level

wbe.soil_landscape_classification

wbe.soil_landscape_classification(
    input,
    flat_slope_threshold=3.0,
    profile_curvature_threshold=0.01,
    plan_curvature_threshold=0.01,
    fine_scale=2.0,
    coarse_scale=8.0,
    z_factor=1.0,
    output_prefix=None,
    landform_polygons_output=None,
    callback=None,
) -> tuple[Raster, Raster, Vector, str]

Runs the workflow soil-landscape classifier and returns:

  • landform-units raster
  • multiscale-signature raster
  • landform polygons vector
  • summary JSON path
NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
flat_slope_thresholdfloat3.0Slope threshold in degrees for flat/summit/depression separation
profile_curvature_thresholdfloat0.01Absolute threshold for profile-curvature convex/concave separation
plan_curvature_thresholdfloat0.01Absolute threshold for plan-curvature convergent/divergent separation
fine_scalefloat2.0Fine-scale smoothing radius
coarse_scalefloat8.0Coarse-scale smoothing radius
z_factorfloat1.0Vertical exaggeration factor
output_prefixstr | NoneNonePrefix for generated outputs
landform_polygons_outputstr | NoneNoneOptional explicit polygon output path
callbackcallable | NoneNoneProgress/message event handler

wbe.spherical_std_dev_of_normals

wbe.spherical_std_dev_of_normals(input, filter_size=11, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates spherical standard deviation (degrees) of local surface-normal vectors.

wbe.average_normal_vector_angular_deviation

wbe.average_normal_vector_angular_deviation(input, filter_size=11, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates local mean angular deviation (degrees) between original and smoothed DEM normals.

wbe.openness

wbe.openness(input, dist=20, pos_output_path=None, neg_output_path=None, callback=None) -> tuple[Raster, Raster]

Computes Yokoyama et al. (2002) topographic openness using 8-directional horizon angles. Returns positive openness (high on convex landforms like ridges) and negative openness (high on concave landforms like valleys). Both values are in degrees (0–90).

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
distint20Search distance in cells
pos_output_pathstr | NoneNoneOptional output file path for positive openness
neg_output_pathstr | NoneNoneOptional output file path for negative openness
callbackcallable | NoneNoneProgress/message event handler

Tier: Pro

wbe.difference_from_mean_elevation

wbe.difference_from_mean_elevation(input, filter_size_x=11, filter_size_y=None, output_path=None, callback=None) -> Raster

Calculates the difference between each elevation and the mean elevation of its local neighbourhood. This is a local-relief measure and is implemented using summed-area tables for efficient large-window filtering.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
filter_size_xint11Filter width in cells; values are coerced to odd sizes >= 3
filter_size_yint | NoneNoneFilter height in cells; defaults to filter_size_x
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.deviation_from_mean_elevation

wbe.deviation_from_mean_elevation(input, filter_size_x=11, filter_size_y=None, output_path=None, callback=None) -> Raster

Calculates the local elevation z-score (z - mean) / std_dev using a moving neighbourhood. This normalizes the local relief by local roughness and uses summed-area tables for filter-size-invariant performance.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
filter_size_xint11Filter width in cells; values are coerced to odd sizes >= 3
filter_size_yint | NoneNoneFilter height in cells; defaults to filter_size_x
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.standard_deviation_of_slope

wbe.standard_deviation_of_slope(input, filter_size=11, z_factor=1.0, output_path=None, callback=None) -> Raster

Calculates the local standard deviation of slope as a roughness measure. Slope is derived from the DEM (Horn kernel), then neighbourhood standard deviation is computed with summed-area tables.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
filter_sizeint11Neighbourhood width/height in cells; coerced to odd sizes >= 3
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.feature_preserving_smoothing

wbe.feature_preserving_smoothing(input, filter_size=11, normal_diff_threshold=8.0, iterations=3, max_elevation_diff=None, z_factor=1.0, output_path=None, callback=None) -> Raster

Smooths DEM roughness while preserving terrain breaks-in-slope by filtering and applying a smoothed normal-vector field over iterative updates.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
filter_sizeint11Odd neighbourhood size for normal-field smoothing
normal_diff_thresholdfloat8.0Maximum angular normal difference (degrees) included in smoothing
iterationsint3Number of elevation update iterations
max_elevation_difffloat | NoneNoneMaximum allowed absolute change from original elevation per cell
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.fill_missing_data

wbe.fill_missing_data(input, filter_size=11, weight=2.0, exclude_edge_nodata=False, output_path=None, callback=None) -> Raster

Fills NoData gaps using inverse-distance weighting of valid cells on the edge of data holes.

NameTypeDefaultDescription
inputRasterrequiredInput raster
filter_sizeint11Search radius in grid cells
weightfloat2.0Inverse-distance power exponent
exclude_edge_nodataboolFalseExclude NoData regions connected to raster edges
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.remove_off_terrain_objects

wbe.remove_off_terrain_objects(input, filter_size=11, slope_threshold=15.0, output_path=None, callback=None) -> Raster

Creates a bare-earth DEM from a surface DEM by detecting steep off-terrain objects (e.g., buildings and canopy residuals) after white top-hat normalization, then backfilling and interpolating the removed regions.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
filter_sizeint11Maximum expected object size in cells; coerced to odd size >= 3
slope_thresholdfloat15.0Minimum OTO edge slope (degrees) used in backfill rule
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.map_off_terrain_objects

wbe.map_off_terrain_objects(input, max_slope=90.0, min_feature_size=0, output_path=None, callback=None) -> Raster

Maps connected off-terrain object segments in a DSM using slope-constrained region growing; small mapped segments can be merged into a background class.

NameTypeDefaultDescription
inputRasterrequiredInput DSM/DEM raster
max_slopefloat90.0Maximum connecting slope in degrees; lower values separate steeper objects
min_feature_sizeint0Minimum retained segment size in cells; smaller segments are assigned to background class
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.embankment_mapping

wbe.embankment_mapping(dem, roads_vector, search_dist=2.5, min_road_width=6.0, typical_embankment_width=30.0, typical_embankment_max_height=2.0, embankment_max_width=60.0, max_upwards_increment=0.05, spillout_slope=4.0, remove_embankments=False, output_path=None, output_dem_path=None, callback=None) -> Tuple[Raster, Raster | None]

Maps transportation embankment cells using road-constrained seed growth and morphometric criteria; optionally outputs an embankment-removed DEM interpolated from embankment-edge elevations.

NameTypeDefaultDescription
demRasterrequiredInput DEM raster
roads_vectorVectorrequiredInput polyline road/transportation network
search_distfloat2.5Seed repositioning distance in map units
min_road_widthfloat6.0Minimum road-width mapping distance in map units
typical_embankment_widthfloat30.0Typical embankment width in map units
typical_embankment_max_heightfloat2.0Typical embankment maximum height
embankment_max_widthfloat60.0Maximum embankment width in map units
max_upwards_incrementfloat0.05Maximum upward increment allowed during growth
spillout_slopefloat4.0Maximum spillout slope (degrees) for uphill transitions
remove_embankmentsboolFalseAlso create embankment-removed DEM output
output_pathstr | NoneNoneOutput embankment mask raster path
output_dem_pathstr | NoneNoneOutput embankment-removed DEM path when enabled
callbackcallable | NoneNoneProgress/message event handler

wbe.smooth_vegetation_residual

wbe.smooth_vegetation_residual(input, max_scale=30, dev_threshold=1.0, scale_threshold=5, output_path=None, callback=None) -> Raster

Suppresses residual vegetation roughness in DEMs by identifying cells with high local standardized elevation deviation (DEV) at small scales and re-interpolating masked cells from nearby non-masked neighbours.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
max_scaleint30Maximum DEV half-window radius in cells
dev_thresholdfloat1.0Minimum DEV value used to flag roughness cells
scale_thresholdint5Maximum scale considered vegetation roughness
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.dem_void_filling

wbe.dem_void_filling(input, fill, mean_plane_dist=20, edge_treatment='dem', weight_value=2.0, output_path=None, callback=None) -> Raster

Fills voids in an input DEM by fusing elevations from a secondary fill DEM. The method computes a DEM-of-difference in overlap areas and interpolates near-edge offsets so void fills transition seamlessly.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster containing voids
fillRasterrequiredFill DEM raster used to populate void cells
mean_plane_distint20Distance in cells from void edge beyond which offsets are set to mean overlap offset
edge_treatmentstr'dem'Void-edge handling: 'dem', 'fill', or 'average'
weight_valuefloat2.0IDW power for offset interpolation near void edges
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.max_branch_length

wbe.max_branch_length(input, log_transform=False, output_path=None, callback=None) -> Raster

Calculates the maximum branch length (Bmax) between each cell's D8 flowpath and the flowpaths of its right and lower neighbours. High values often occur near drainage divides.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
log_transformboolFalseApply natural-log transform to positive output values
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

wbe.max_difference_from_mean

wbe.max_difference_from_mean(input, min_scale=1, max_scale=100, step_size=1, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes difference-from-mean over multiple neighbourhood scales and returns two rasters: maximum signed magnitude and the scale (half-window radius) where that maximum absolute response occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint1Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint1Scale increment
output_pathstr | NoneNoneOptional path for magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.max_elevation_deviation

wbe.max_elevation_deviation(input, min_scale=1, max_scale=100, step_size=1, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes standardized elevation deviation over multiple neighbourhood scales and returns two rasters: maximum signed DEV magnitude and the scale (half-window radius) where that maximum absolute response occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint1Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint1Scale increment
output_pathstr | NoneNoneOptional path for DEVmax magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.max_anisotropy_dev

wbe.max_anisotropy_dev(input, min_scale=3, max_scale=100, step_size=2, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes the anisotropy of standardized elevation deviation over multiple neighbourhood scales and returns two rasters: maximum anisotropy magnitude and the scale (half-window radius) where that maximum response occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint3Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint2Scale increment
output_pathstr | NoneNoneOptional path for anisotropy magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.max_elev_dev_signature

wbe.max_elev_dev_signature(input, points, min_scale=1, max_scale=100, step_size=10, output_path=None, callback=None) -> str

Generates an HTML report containing multiscale elevation-deviation (DEV) signatures for each input point site.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
pointsVectorrequiredInput point or multipoint vector
min_scaleint1Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint10Scale increment
output_pathstr | NoneNoneOptional HTML output path
callbackcallable | NoneNoneProgress/message event handler

wbe.max_anisotropy_dev_signature

wbe.max_anisotropy_dev_signature(input, points, min_scale=1, max_scale=100, step_size=1, output_path=None, callback=None) -> str

Generates an HTML report containing multiscale anisotropy signatures for each input point site.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
pointsVectorrequiredInput point or multipoint vector
min_scaleint1Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint1Scale increment
output_pathstr | NoneNoneOptional HTML output path
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_topographic_position_image

wbe.multiscale_topographic_position_image(local, meso, broad, hillshade=None, lightness=1.2, output_path=None, callback=None) -> Raster

Creates a packed RGB multiscale topographic-position image from local, meso, and broad DEVmax rasters. Optionally modulates colours using a hillshade raster.

NameTypeDefaultDescription
localRasterrequiredLocal-scale DEVmax raster (mapped to blue channel)
mesoRasterrequiredMeso-scale DEVmax raster (mapped to green channel)
broadRasterrequiredBroad-scale DEVmax raster (mapped to red channel)
hillshadeRaster | NoneNoneOptional hillshade raster for illumination modulation
lightnessfloat1.2Logistic lightness scaling factor
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_topographic_position_class

wbe.multiscale_topographic_position_class(input, local_min_scale=5, local_max_scale=80, local_step_size=1, broad_min_scale=500, broad_max_scale=2000, broad_step_size=20, local_threshold=0.5, broad_threshold=0.5, min_patch_size=0, output_path=None, output_confidence_path=None, callback=None) -> Raster

Builds local- and broad-scale DEVmax responses internally from a DEM and combines them into a nine-class categorical landform raster. Broad-scale classes are lowland, intermediate, and upland; local classes are hollow, mid-position, and knoll. Class values are fixed as 0 = Lowland hollow, 1 = Lowland mid-position, 2 = Lowland knoll, 3 = Intermediate hollow, 4 = Intermediate mid-position, 5 = Intermediate knoll, 6 = Upland hollow, 7 = Upland mid-position, 8 = Upland knoll.

If output_confidence_path is supplied, the tool also writes a separate confidence raster with values in the range [0, 1]. The returned object is always the categorical class raster; the confidence raster is written only to the requested output path.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
local_min_scaleint5Minimum half-window radius in cells for the local DEVmax scale range
local_max_scaleint80Maximum half-window radius in cells for the local DEVmax scale range
local_step_sizeint1Scale increment for the local DEVmax range
broad_min_scaleint500Minimum half-window radius in cells for the broad DEVmax scale range
broad_max_scaleint2000Maximum half-window radius in cells for the broad DEVmax scale range
broad_step_sizeint20Scale increment for the broad DEVmax range
local_thresholdfloat0.5Ternary threshold for local hollow / mid-position / knoll classification
broad_thresholdfloat0.5Ternary threshold for broad lowland / intermediate / upland classification
min_patch_sizeint0Optional minimum mapped patch size in cells; 0 disables patch filtering
output_pathstr | NoneNoneOptional path for the categorical class raster
output_confidence_pathstr | NoneNoneOptional path for the confidence raster in [0, 1]
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_elevation_percentile

wbe.multiscale_elevation_percentile(input, min_scale=4, max_scale=100, step_size=1, sig_digits=2, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes local elevation percentile across a range of neighbourhood scales and returns two rasters: the most extreme percentile magnitude (furthest from 50) and the scale where that response occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint4Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint1Scale increment
sig_digitsint2Significant decimal digits preserved during percentile binning
output_pathstr | NoneNoneOptional path for percentile magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_elevated_index

wbe.multiscale_elevated_index(input, min_scale=2, step_size=1, num_steps=100, step_nonlinearity=1.1, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes a standardized multiscale elevated index using Gaussian scale-space smoothing. Returns two rasters: the maximum positive standardized residual magnitude and the scale where that maximum occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint2Minimum half-window radius in cells
step_sizeint1Base step for scale sampling
num_stepsint100Number of sampled scales
step_nonlinearityfloat1.1Nonlinearity exponent for scale spacing
output_pathstr | NoneNoneOptional path for magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_low_lying_index

wbe.multiscale_low_lying_index(input, min_scale=2, step_size=1, num_steps=100, step_nonlinearity=1.1, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes a standardized multiscale low-lying index using Gaussian scale-space smoothing. Returns two rasters: the maximum negative standardized residual magnitude (reported as positive values) and the scale where that maximum occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint2Minimum half-window radius in cells
step_sizeint1Base step for scale sampling
num_stepsint100Number of sampled scales
step_nonlinearityfloat1.1Nonlinearity exponent for scale spacing
output_pathstr | NoneNoneOptional path for magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_roughness

wbe.multiscale_roughness(input, min_scale=1, max_scale=100, step_size=1, z_factor=1.0, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes multiscale roughness from local angular differences between DEM surface normals and scale-smoothed normals. Returns maximum roughness magnitude and the scale where it occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint1Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint1Scale increment
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOptional path for roughness magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_std_dev_normals

wbe.multiscale_std_dev_normals(input, min_scale=1, step=1, num_steps=10, step_nonlinearity=1.0, z_factor=1.0, output_path=None, output_scale_path=None, callback=None) -> tuple[Raster, Raster]

Computes the maximum spherical standard deviation of surface normals over a nonlinearly sampled set of scales. Returns magnitude and the scale where that maximum occurs.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
min_scaleint1Minimum half-window radius in cells
stepint1Base step used by nonlinear scale schedule
num_stepsint10Number of sampled scales
step_nonlinearityfloat1.0Nonlinearity exponent for scale schedule
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOptional path for magnitude raster
output_scale_pathstr | NoneNoneOptional path for scale raster
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_std_dev_normals_signature

wbe.multiscale_std_dev_normals_signature(input, points, min_scale=1, step=1, num_steps=10, step_nonlinearity=1.0, z_factor=1.0, output_path=None, callback=None) -> str

Generates an HTML report containing spherical-standard-deviation signatures across nonlinearly sampled scales for each input point site.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
pointsVectorrequiredInput point or multipoint vector
min_scaleint1Minimum half-window radius in cells
stepint1Base step used by nonlinear scale schedule
num_stepsint10Number of sampled scales
step_nonlinearityfloat1.0Nonlinearity exponent for scale schedule
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOptional HTML output path
callbackcallable | NoneNoneProgress/message event handler

wbe.multiscale_roughness_signature

wbe.multiscale_roughness_signature(input, points, min_scale=1, max_scale=100, step_size=1, z_factor=1.0, output_path=None, callback=None) -> str

Generates an HTML report containing multiscale roughness signatures for each input point site.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
pointsVectorrequiredInput point or multipoint vector
min_scaleint1Minimum half-window radius in cells
max_scaleint100Maximum half-window radius in cells
step_sizeint1Scale increment
z_factorfloat1.0Z conversion factor when vertical and horizontal units differ
output_pathstr | NoneNoneOptional HTML output path
callbackcallable | NoneNoneProgress/message event handler

wbe.horizon_angle

wbe.horizon_angle(input, azimuth=0.0, max_dist=None, output_path=None, callback=None) -> Raster

Computes horizon angle (maximum slope) along a specified azimuth direction.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
azimuthfloat0.0Azimuth in degrees [0, 360)
max_distfloat | NoneNoneMaximum search distance in map units
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.sky_view_factor

wbe.sky_view_factor(input, az_fraction=5.0, max_dist=None, observer_hgt_offset=0.05, output_path=None, callback=None) -> Raster

Computes sky-view factor as the proportion of visible sky from each cell.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
az_fractionfloat5.0Azimuth sampling increment in degrees [1, 45]
max_distfloat | NoneNoneMaximum search distance in map units
observer_hgt_offsetfloat0.05Observer height offset above terrain
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.horizon_area

wbe.horizon_area(input, az_fraction=5.0, max_dist=None, observer_hgt_offset=0.05, output_path=None, callback=None) -> Raster

Computes area enclosed by the horizon polygon for each cell.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
az_fractionfloat5.0Azimuth sampling increment in degrees [1, 45]
max_distfloat | NoneNoneMaximum search distance in map units
observer_hgt_offsetfloat0.05Observer height offset above terrain
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.average_horizon_distance

wbe.average_horizon_distance(input, az_fraction=5.0, max_dist=None, observer_hgt_offset=0.05, output_path=None, callback=None) -> Raster

Computes average distance to the horizon across sampled azimuth directions.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
az_fractionfloat5.0Azimuth sampling increment in degrees [1, 45]
max_distfloat | NoneNoneMaximum search distance in map units
observer_hgt_offsetfloat0.05Observer height offset above terrain
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.skyline_analysis

wbe.skyline_analysis(input, points, max_dist=None, observer_hgt_offset=0.05, output_as_polygons=True, az_fraction=1.0, output_path=None, report_path=None, callback=None) -> (Vector, str)

Computes skyline/horizon characteristics from observer point locations. Returns a horizon vector layer (polygon or line output) and an HTML report path.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
pointsVectorrequiredInput point or multipoint observer locations
max_distfloat | NoneNoneMaximum horizon search distance in map units
observer_hgt_offsetfloat0.05Observer height offset above terrain
output_as_polygonsboolTrueOutput polygon horizon footprints when true, otherwise line strings
az_fractionfloat1.0Azimuth sampling increment in degrees [0.01, 45]
output_pathstr | NoneNoneOutput vector file path
report_pathstr | NoneNoneOutput HTML report path
callbackcallable | NoneNoneProgress/message event handler

wbe.time_in_daylight

wbe.time_in_daylight(input, az_fraction=5.0, max_dist=None, latitude=None, longitude=None, utc_offset=None, start_day=1, end_day=365, start_time='sunrise', end_time='sunset', output_path=None, callback=None) -> Raster

Computes the proportion of daytime that each cell is illuminated (not shadowed), based on sampled solar positions through the specified date and time windows. Latitude/longitude are optional overrides; when omitted they are inferred automatically from the input DEM CRS and extent center. utc_offset is also optional; when omitted it is estimated from the inferred/overridden center longitude.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
az_fractionfloat5.0Azimuth bin size in degrees (0, 360)
max_distfloat | NoneNoneMaximum horizon search distance in map units
latitudefloat | NoneNoneOptional latitude override in degrees
longitudefloat | NoneNoneOptional longitude override in degrees
utc_offsetstr | NoneNoneOptional UTC offset used for almanac generation; inferred from longitude when omitted
start_dayint1Start day-of-year (1..366)
end_dayint365End day-of-year (1..366)
start_timestr'sunrise'Start time HH:MM:SS or 'sunrise'
end_timestr'sunset'End time HH:MM:SS or 'sunset'
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.shadow_image

wbe.shadow_image(input, palette='soft', max_dist=None, date='21/06/2021', time='13:00', location='43.5448/-80.2482/-4', output_path=None, callback=None) -> Raster

Generates a terrain shadow-intensity image for a specified local date/time and location using horizon-angle shadowing and solar position. The palette parameter controls hypsometric tinting before shadow modulation; use white or none for grayscale intensity-only output.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
palettestr'soft'Hypsometric palette name (atlas, high_relief, arid, earthtones, soft, muted, light_quant, turbo, purple, viridis, green_yellow, pink_yellow_green, blue_yellow_red, deep, imhof, blue_green_yellow, dem, grey, white/none)
max_distfloat | NoneNoneMaximum horizon search distance in map units
datestr'21/06/2021'Date in DD/MM/YYYY format
timestr'13:00'Local time in HH:MM or HH:MMAM/PM format
locationstr'43.5448/-80.2482/-4'LAT/LON/UTC_OFFSET string
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.shadow_animation

wbe.shadow_animation(input, date='21/06/2021', time_interval=30, location='43.5448/-80.2482/-4', palette='soft', max_dist=None, image_height=600, delay=250, label='', output_path=None, callback=None) -> tuple[str, str]

Creates an interactive terrain-shadow animation for a specified date and location, returning the generated HTML viewer path and GIF path.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
datestr'21/06/2021'Date in DD/MM/YYYY format
time_intervalint30Frame interval in minutes
locationstr'43.5448/-80.2482/-4'LAT/LON/UTC_OFFSET string
palettestr'soft'Hypsometric palette name used in the rendered frames
max_distfloat | NoneNoneMaximum horizon search distance in map units
image_heightint600Output animation height in pixels
delayint250GIF frame delay in milliseconds
labelstr''Optional label drawn in the animation viewer
output_pathstr | NoneNoneOutput HTML path; the GIF is written beside it
callbackcallable | NoneNoneProgress/message event handler

wbe.topo_render

wbe.topo_render(input, palette='soft', reverse_palette=False, azimuth=315.0, altitude=30.0, clipping_polygon=None, background_hgt_offset=10.0, background_clr=(255, 255, 255, 255), attenuation_parameter=0.3, ambient_light=0.2, z_factor=1.0, max_dist=None, output_path=None, callback=None) -> Raster

Creates a pseudo-3D rendered topographic image using hypsometric tinting, hillshade, horizon-based shadowing, and distance attenuation.

NameTypeDefaultDescription
inputRasterrequiredInput DEM/DSM raster
palettestr'soft'Hypsometric palette name (atlas, high_relief, arid, earthtones, soft, muted, light_quant, turbo, purple, viridis, green_yellow, pink_yellow_green, blue_yellow_red, deep, imhof, blue_green_yellow, dem, grey, white/none)
reverse_paletteboolFalseReverse palette ordering
azimuthfloat315.0Light-source azimuth in degrees [0, 360]
altitudefloat30.0Light-source altitude in degrees [0, 90]
clipping_polygonVector | NoneNoneOptional polygon vector mask; only DEM cells inside polygon(s) are rendered
background_hgt_offsetfloat10.0Vertical offset from minimum DEM elevation to background plane
background_clrtuple[int,int,int,int](255, 255, 255, 255)Background colour as RGBA
attenuation_parameterfloat0.3Distance attenuation exponent
ambient_lightfloat0.2Ambient light amount in [0, 1]
z_factorfloat1.0Vertical exaggeration multiplier
max_distfloat | NoneNoneMaximum horizon search distance in map units
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

wbe.visibility_index

wbe.visibility_index(input, station_height=2.0, resolution_factor=8, max_dist=None, output_path=None, callback=None) -> Raster

Computes a terrain visibility index using sampled viewsheds.

wbe.viewshed

wbe.viewshed(input, stations, height=2.0, output_path=None, callback=None) -> Raster

Computes per-cell visibility counts from one or more viewing stations in a point vector layer.

NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
station_heightfloat2.0Observer station height above terrain
resolution_factorint8Sampling resolution factor in [1, 25]
max_distfloat | NoneNoneMaximum search distance in map units; omit for full extent
output_pathstr | NoneNoneOutput file path
callbackcallable | NoneNoneProgress/message event handler

Single-scale curvature signature

All single-scale curvature tools share this signature:

wbe.<tool>(input, z_factor=1.0, log_transform=False, output_path=None, callback=None) -> Raster
NameTypeDefaultDescription
inputRasterrequiredInput DEM raster
z_factorfloat1.0Z conversion factor
log_transformboolFalseApply log transform to output values
output_pathstr | NoneNoneOutput file path; omit to keep in memory
callbackcallable | NoneNoneProgress/message event handler

Tier map

MethodTool IDTier
wbe.slope(...)slopeOSS
wbe.aspect(...)aspectOSS
wbe.convergence_index(...)convergence_indexOSS
wbe.contours_from_points(...)contours_from_pointsOSS
wbe.contours_from_raster(...)contours_from_rasterOSS
wbe.dem_void_filling(...)dem_void_fillingPro
wbe.max_branch_length(...)max_branch_lengthOSS
wbe.hillshade(...)hillshadeOSS
wbe.multidirectional_hillshade(...)multidirectional_hillshadeOSS
wbe.ruggedness_index(...)ruggedness_indexOSS
wbe.surface_area_ratio(...)surface_area_ratioOSS
wbe.elev_relative_to_min_max(...)elev_relative_to_min_maxOSS
wbe.wetness_index(...)wetness_indexOSS
wbe.relative_stream_power_index(...)relative_stream_power_indexOSS
wbe.sediment_transport_index(...)sediment_transport_indexOSS
wbe.elev_relative_to_watershed_min_max(...)elev_relative_to_watershed_min_maxOSS
wbe.percent_elev_range(...)percent_elev_rangeOSS
wbe.relative_topographic_position(...)relative_topographic_positionOSS
wbe.num_downslope_neighbours(...)num_downslope_neighboursOSS
wbe.num_upslope_neighbours(...)num_upslope_neighboursOSS
wbe.max_downslope_elev_change(...)max_downslope_elev_changeOSS
wbe.max_upslope_elev_change(...)max_upslope_elev_changeOSS
wbe.min_downslope_elev_change(...)min_downslope_elev_changeOSS
wbe.elevation_percentile(...)elevation_percentileOSS
wbe.downslope_index(...)downslope_indexOSS
wbe.elev_above_pit(...)elev_above_pitOSS
wbe.elev_above_pit_dist(...)elev_above_pit_distOSS
wbe.circular_variance_of_aspect(...)circular_variance_of_aspectOSS
wbe.hypsometric_analysis(...)hypsometric_analysisOSS
wbe.profile(...)profileOSS
wbe.hypsometrically_tinted_hillshade(...)hypsometrically_tinted_hillshadeOSS
wbe.slope_vs_aspect_plot(...)slope_vs_aspect_plotOSS
wbe.slope_vs_elev_plot(...)slope_vs_elev_plotOSS
wbe.directional_relief(...)directional_reliefOSS
wbe.exposure_towards_wind_flux(...)exposure_towards_wind_fluxOSS
wbe.fetch_analysis(...)fetch_analysisOSS
wbe.relative_aspect(...)relative_aspectOSS
wbe.edge_density(...)edge_densityOSS
wbe.find_ridges(...)find_ridgesOSS
wbe.assess_route(...)assess_routeOSS
wbe.breakline_mapping(...)breakline_mappingOSS
wbe.geomorphons(...)geomorphonsOSS
wbe.pennock_landform_classification(...)pennock_landform_classificationOSS
wbe.spherical_std_dev_of_normals(...)spherical_std_dev_of_normalsOSS
wbe.average_normal_vector_angular_deviation(...)average_normal_vector_angular_deviationOSS
wbe.difference_from_mean_elevation(...)difference_from_mean_elevationOSS
wbe.deviation_from_mean_elevation(...)deviation_from_mean_elevationOSS
wbe.standard_deviation_of_slope(...)standard_deviation_of_slopeOSS
wbe.feature_preserving_smoothing(...)feature_preserving_smoothingOSS
wbe.fill_missing_data(...)fill_missing_dataOSS
wbe.remove_off_terrain_objects(...)remove_off_terrain_objectsOSS
wbe.low_points_on_headwater_divides(...)low_points_on_headwater_dividesOSS
wbe.map_off_terrain_objects(...)map_off_terrain_objectsOSS
wbe.embankment_mapping(...)embankment_mappingOSS
wbe.local_hypsometric_analysis(...)local_hypsometric_analysisOSS
wbe.smooth_vegetation_residual(...)smooth_vegetation_residualOSS
wbe.max_difference_from_mean(...)max_difference_from_meanOSS
wbe.max_anisotropy_dev(...)max_anisotropy_devOSS
wbe.max_anisotropy_dev_signature(...)max_anisotropy_dev_signatureOSS
wbe.max_elevation_deviation(...)max_elevation_deviationOSS
wbe.max_elev_dev_signature(...)max_elev_dev_signatureOSS
wbe.multiscale_elevated_index(...)multiscale_elevated_indexOSS
wbe.multiscale_elevation_percentile(...)multiscale_elevation_percentileOSS
wbe.multiscale_low_lying_index(...)multiscale_low_lying_indexOSS
wbe.multiscale_roughness(...)multiscale_roughnessOSS
wbe.multiscale_roughness_signature(...)multiscale_roughness_signatureOSS
wbe.multiscale_std_dev_normals(...)multiscale_std_dev_normalsOSS
wbe.multiscale_std_dev_normals_signature(...)multiscale_std_dev_normals_signatureOSS
wbe.multiscale_topographic_position_class(...)multiscale_topographic_position_classOSS
wbe.multiscale_topographic_position_image(...)multiscale_topographic_position_imageOSS
wbe.horizon_angle(...)horizon_angleOSS
wbe.sky_view_factor(...)sky_view_factorOSS
wbe.horizon_area(...)horizon_areaOSS
wbe.average_horizon_distance(...)average_horizon_distanceOSS
wbe.skyline_analysis(...)skyline_analysisOSS
wbe.time_in_daylight(...)time_in_daylightOSS
wbe.shadow_image(...)shadow_imageOSS
wbe.shadow_animation(...)shadow_animationOSS
wbe.topographic_hachures(...)topographic_hachuresOSS
wbe.topographic_position_animation(...)topographic_position_animationOSS
wbe.topo_render(...)topo_renderOSS
wbe.visibility_index(...)visibility_indexOSS
wbe.viewshed(...)viewshedOSS
wbe.plan_curvature(...)plan_curvatureOSS
wbe.profile_curvature(...)profile_curvatureOSS
wbe.tangential_curvature(...)tangential_curvatureOSS
wbe.total_curvature(...)total_curvatureOSS
wbe.mean_curvature(...)mean_curvatureOSS
wbe.gaussian_curvature(...)gaussian_curvatureOSS
wbe.minimal_curvature(...)minimal_curvatureOSS
wbe.maximal_curvature(...)maximal_curvatureOSS
wbe.shape_index(...)shape_indexOSS
wbe.curvedness(...)curvednessOSS
wbe.unsphericity(...)unsphericityOSS
wbe.ring_curvature(...)ring_curvatureOSS
wbe.rotor(...)rotorOSS
wbe.difference_curvature(...)difference_curvatureOSS
wbe.horizontal_excess_curvature(...)horizontal_excess_curvatureOSS
wbe.vertical_excess_curvature(...)vertical_excess_curvatureOSS
wbe.accumulation_curvature(...)accumulation_curvatureOSS
wbe.generating_function(...)generating_functionOSS
wbe.principal_curvature_direction(...)principal_curvature_directionOSS
wbe.casorati_curvature(...)casorati_curvatureOSS
wbe.openness(...)opennessOSS

wbe.multiscale_curvatures

wbe.multiscale_curvatures(
    input,
    curv_type='profile',
    min_scale=4,
    step=1,
    num_steps=10,
    step_nonlinearity=1.0,
    log_transform=True,
    standardize=False,
    output_path=None,
    callback=None,
) -> Raster

Tier: OSS

multiscale_curvatures always uses Gaussian scale-space smoothing by default. There is no hidden runtime switch to toggle to box smoothing.

Example

ms = wbe.multiscale_curvatures(
    dem,
    curv_type='shape_index',
    min_scale=1,
    step=2,
    num_steps=8,
    step_nonlinearity=1.0,
)

Basic terrain examples

slope_deg  = wbe.slope(dem)                             # degrees
slope_pct  = wbe.slope(dem, units='percent')
asp        = wbe.aspect(dem)
hs         = wbe.hillshade(dem, azimuth=315.0, altitude=30.0)
hs_steep   = wbe.hillshade(dem, azimuth=270.0, altitude=45.0, z_factor=2.0)
mhs        = wbe.multidirectional_hillshade(dem, altitude=30.0)
mhs_360    = wbe.multidirectional_hillshade(dem, altitude=30.0, full_360_mode=True)
tri        = wbe.ruggedness_index(dem)
sar        = wbe.surface_area_ratio(dem)
elev_pct   = wbe.elev_relative_to_min_max(dem)
twi        = wbe.wetness_index(sca, slope_deg)
rsp        = wbe.relative_stream_power_index(sca, slope_deg)
sti        = wbe.sediment_transport_index(sca, slope_deg)
erwm       = wbe.elev_relative_to_watershed_min_max(dem, watersheds)
per        = wbe.percent_elev_range(dem, filter_size_x=11)
rtp        = wbe.relative_topographic_position(dem, filter_size_x=11)
n_dn       = wbe.num_downslope_neighbours(dem)
max_drop   = wbe.max_downslope_elev_change(dem)
min_drop   = wbe.min_downslope_elev_change(dem)
diff_mean  = wbe.difference_from_mean_elevation(dem, filter_size_x=11)
dev_mean   = wbe.deviation_from_mean_elevation(dem, filter_size_x=11)
std_slope  = wbe.standard_deviation_of_slope(dem, filter_size=11)
pos_open, neg_open = wbe.openness(dem, dist=20)  # Pro: positive and negative openness
max_diff, max_scale = wbe.max_difference_from_mean(dem, min_scale=1, max_scale=100, step_size=2)
max_dev, dev_scale = wbe.max_elevation_deviation(dem, min_scale=1, max_scale=100, step_size=2)
mep, mep_scale = wbe.multiscale_elevation_percentile(dem, min_scale=4, max_scale=100, step_size=2, sig_digits=2)
# local_dev, meso_dev, and broad_dev are DEVmax rasters computed for distinct scale ranges.
mtp        = wbe.multiscale_topographic_position_image(local_dev, meso_dev, broad_dev)
svf        = wbe.sky_view_factor(dem, az_fraction=5.0)
hzn_ang    = wbe.horizon_angle(dem, azimuth=315.0)
hzn_area   = wbe.horizon_area(dem)
hzn_dist   = wbe.average_horizon_distance(dem)
vis_idx    = wbe.visibility_index(dem, station_height=2.0)

Openness tuple workflow

# 1) Compute positive and negative openness.
pos_open, neg_open = wbe.openness(dem, dist=20)

# 2) Visualize positive openness (ridges/peaks).
pos_hs = wbe.hillshade(pos_open, azimuth=315.0, altitude=30.0)

# 3) Visualize negative openness (valleys/basins).
neg_hs = wbe.hillshade(neg_open, azimuth=315.0, altitude=30.0)

max_difference_from_mean tuple workflow

# 1) Compute multiscale local-relief response.
max_diff, max_scale = wbe.max_difference_from_mean(
    dem,
    min_scale=1,
    max_scale=75,
    step_size=2,
)

# 2) Use magnitude for visualization or thresholding.
max_diff_hs = wbe.hillshade(max_diff, azimuth=315.0, altitude=35.0)

# 3) Use the scale raster to inspect dominant feature size.
#    Larger values indicate broader landform scale.
max_scale.write("dominant_scale.tif")

Returns:

  • first raster: maximum signed difference-from-mean magnitude.
  • second raster: half-window radius (cells) at which the maximum absolute response occurs.

max_elevation_deviation tuple workflow

# 1) Compute multiscale standardized local-relief response (DEVmax).
max_dev, dev_scale = wbe.max_elevation_deviation(
    dem,
    min_scale=1,
    max_scale=75,
    step_size=2,
)

# 2) Visualize magnitude response.
max_dev_hs = wbe.hillshade(max_dev, azimuth=315.0, altitude=35.0)

# 3) Use scale raster to inspect dominant topographic-position scale.
dev_scale.write("dominant_dev_scale.tif")

Returns:

  • first raster: maximum signed standardized deviation magnitude.
  • second raster: half-window radius (cells) at which the maximum absolute response occurs.

DEVmax-to-MTP workflow (concrete scale ranges)

# Build three DEVmax rasters using distinct neighbourhood-scale ranges.
# Example ranges:
#   local = 1..8 cells
#   meso  = 9..32 cells
#   broad = 33..128 cells
local_dev, local_scale = wbe.max_elevation_deviation(
    dem,
    min_scale=1,
    max_scale=8,
    step_size=1,
)
meso_dev, meso_scale = wbe.max_elevation_deviation(
    dem,
    min_scale=9,
    max_scale=32,
    step_size=2,
)
broad_dev, broad_scale = wbe.max_elevation_deviation(
    dem,
    min_scale=33,
    max_scale=128,
    step_size=4,
)

# Optional illumination surface for visual clarity.
shade = wbe.multidirectional_hillshade(dem, altitude=35.0, full_360_mode=True)

# Compose the multiscale topographic position image.
mtp = wbe.multiscale_topographic_position_image(
    local_dev,
    meso_dev,
    broad_dev,
    hillshade=shade,
    lightness=1.2,
    output_path="mtp_local_meso_broad.tif",
)

Interpretation guide:

  • blue-dominant areas: strongest topographic prominence at local scales
  • green-dominant areas: strongest topographic prominence at meso scales
  • red-dominant areas: strongest topographic prominence at broad scales
# Classify topographic position directly from the DEM using separate local and
# broad DEVmax scale ranges, and persist an optional confidence raster.
mstp = wbe.multiscale_topographic_position_class(
    dem,
    local_min_scale=5,
    local_max_scale=80,
    local_step_size=1,
    broad_min_scale=500,
    broad_max_scale=2000,
    broad_step_size=20,
    local_threshold=0.5,
    broad_threshold=0.5,
    output_path="mstp_class_map.tif",
    output_confidence_path="mstp_class_confidence.tif",
)

Interpretation guide:

  • 0-2: lowland settings, from hollow to knoll
  • 3-5: intermediate settings, from hollow to knoll
  • 6-8: upland settings, from hollow to knoll
  • mstp_class_confidence.tif: optional confidence raster in the range [0, 1]

multiscale_elevation_percentile tuple workflow

# 1) Compute multiscale elevation percentile response.
mep, mep_scale = wbe.multiscale_elevation_percentile(
    dem,
    min_scale=4,
    max_scale=100,
    step_size=2,
    sig_digits=2,
)

# 2) Visualize extreme percentile magnitude.
mep_hs = wbe.hillshade(mep, azimuth=315.0, altitude=35.0)

# 3) Inspect the scale of strongest percentile response.
mep_scale.write("multiscale_elevation_percentile_scale.tif")

Returns:

  • first raster: most extreme elevation percentile (furthest from 50).
  • second raster: half-window radius (cells) where that extreme percentile occurs.

Single-scale examples

plan = wbe.plan_curvature(dem, z_factor=1.0)
mean = wbe.mean_curvature(dem, z_factor=1.0, log_transform=False)
minc = wbe.minimal_curvature(dem, z_factor=1.0)
genf = wbe.generating_function(dem, z_factor=1.0)
pcd = wbe.principal_curvature_direction(dem, z_factor=1.0)

Precision Agriculture

Whitebox Workflows for Python — Precision Agriculture Tools

This document covers Precision Agriculture workflows exposed through the WbEnvironment API. For common conventions, Raster I/O, and math operators see TOOLS.md.


Precision Agriculture

Precision agriculture in the Python API is exposed as a packaged Pro workflow. The former standalone helper methods are intentionally not exposed in the public Python surface.

Workflow Product Index

  • wbe.yield_data_conditioning_and_qa
  • wbe.precision_irrigation_optimization
  • wbe.precision_ag_yield_zone_intelligence

wbe.yield_data_conditioning_and_qa

yield_data_conditioning_and_qa(
    input: Vector,
    output_prefix: str = "yield_pipeline",
    yield_field_name: str = "YIELD",
    profile: str = "balanced",
    swath_width: float = 6.096,
    edge_radius: float | None = None,
    reconcile_radius: float | None = None,
    normalization_radius: float | None = None,
    z_score_threshold: float | None = None,
    min_yield: float | None = None,
    max_yield: float | None = None,
    mean_tonnage: float | None = None,
    header_field_name: str = "HEADER",
    use_field_aliases: bool = True,
    moisture_field_name: str | None = None,
    target_moisture_pct: float = 15.5,
    speed_field_name: str | None = None,
    heading_field_name: str | None = None,
    min_speed_kmh: float = 1.0,
    max_speed_kmh: float = 18.0,
    max_heading_change_deg: float = 35.0,
    lag_correction_mode: str = "none",
    lag_distance_m: float = 0.0,
    filtering_mode: str = "standard",
    robust_mad_threshold: float = 3.0,
    standardize: bool = False,
    ignore_zeros: bool = False,
    max_change_in_heading: float = 25.0,
    callback: callable | None = None,
) -> tuple[Vector, Vector, Vector, Vector, str]

Returns a 5-tuple in this order:

  1. qa_flags_vector
  2. clean_points_vector
  3. clean_map_vector
  4. confidence_points_vector
  5. summary_json_path

Example

qa_flags, clean_points, clean_map, confidence_points, summary_json = wbe.yield_data_conditioning_and_qa(
    input=yield_points,
    output_prefix='output/yield_pipeline',
    profile='balanced',
    use_field_aliases=True,
    filtering_mode='robust',
)

wbe.precision_irrigation_optimization

precision_irrigation_optimization(
    dem: Raster,
    field_boundary: Vector,
    output_prefix: str = "irrigation_opt",
    profile: str = "balanced",
    callback: callable | None = None,
) -> tuple[Raster, Raster, Vector, str]

Returns a 4-tuple in this order:

  1. irrigation_demand_raster
  2. stress_risk_raster
  3. management_zones_vector
  4. summary_json_path

Example

demand, stress, zones, summary = wbe.precision_irrigation_optimization(
    dem=dem,
    field_boundary=field_boundary,
    profile='balanced',
)

wbe.precision_ag_yield_zone_intelligence

precision_ag_yield_zone_intelligence(
    dem: Raster,
    field_boundary: Vector,
    output_prefix: str = "yield_zone_intelligence",
    callback: callable | None = None,
) -> tuple[Raster, Raster, Vector, str]

Returns a 4-tuple in this order:

  1. yield_stability_raster
  2. nutrient_transport_raster
  3. management_zones_vector
  4. summary_json_path

Example

stability, nutrient, zones, summary = wbe.precision_ag_yield_zone_intelligence(
    dem=dem,
    field_boundary=field_boundary,
)

LiDAR Processing

LiDAR Processing Tools

This document defines the LiDAR processing porting roadmap and CRS requirements for the backend migration. Tool-level API reference entries will be added here as each tool is ported.

For shared conventions (paths, callback payloads, optional output_path behavior), see TOOLS.md.

Overview

LiDAR processing tools consume point-cloud datasets (LAS/LAZ/COPC/PLY/E57 via wblidar) and produce one or more of:

  • LiDAR outputs (filtered/modified point clouds)
  • Raster outputs (grids, interpolations, density, DSM/DTM-style derivatives)
  • Vector outputs (contours, footprints, TIN-based products)
  • Diagnostic products (metadata/statistics)

Implementation Priorities

  • Phase 1: LiDAR-to-raster interpolation and gridding tools.
  • Phase 2: LiDAR-to-LiDAR processing tools.
  • Phase 3: LiDAR-to-vector and specialized diagnostics/analysis tools.

Current migration status and canonical API guidance are tracked in v2_migration_guide.md and internal/wbw_py_wbw_r_parity_ledger.md.

CRS Policy (Required)

These requirements are mandatory for all new LiDAR ports.

  1. LiDAR-to-raster outputs must inherit CRS metadata from input LiDAR.
  • If source has EPSG, set raster CRS EPSG.
  • If source has WKT only, set raster CRS WKT.
  • If both exist, preserve both.
  1. Multi-input LiDAR tools must run in a single reference CRS.
  • If all inputs already match, proceed directly.
  • If inputs differ but are transformable, reproject to a common reference CRS before interpolation/aggregation.
  • If CRS cannot be resolved, fail fast with a clear validation error.
  1. LiDAR-to-vector outputs must carry LiDAR CRS.
  • Output vector layer CRS must be assigned from source/reference LiDAR CRS.
  1. Tests are required for CRS behavior.
  • EPSG-only input
  • WKT-only input
  • Mismatched multi-input CRS
  • Missing CRS metadata failure mode

First Batch Targets

  • lidar_nearest_neighbour_gridding
  • lidar_idw_interpolation
  • lidar_tin_gridding
  • lidar_radial_basis_function_interpolation
  • lidar_sibson_interpolation

Rationale:

  • high user impact
  • representative interpolation pathways
  • establishes reusable CRS propagation/alignment patterns for all other LiDAR-to-raster tools

Current Python API

The following convenience methods are available on WbEnvironment:

  1. lidar_nearest_neighbour_gridding(input=None, resolution=1.0, search_radius=2.5, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  2. lidar_idw_interpolation(input=None, resolution=1.0, weight=1.0, search_radius=2.5, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, min_points=1, output_path=None, callback=None)
  3. lidar_tin_gridding(input=None, resolution=1.0, max_triangle_edge_length=inf, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  4. lidar_radial_basis_function_interpolation(input=None, resolution=1.0, num_points=15, search_radius=0.0, func_type="thinplatespline", poly_order="none", weight=0.1, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  5. lidar_sibson_interpolation(input=None, resolution=1.0, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  6. lidar_block_maximum(input=None, resolution=1.0, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  7. lidar_block_minimum(input=None, resolution=1.0, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  8. lidar_point_density(input=None, resolution=1.0, search_radius=2.5, returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  9. lidar_digital_surface_model(input=None, resolution=1.0, search_radius=0.5, min_elev=None, max_elev=None, max_triangle_edge_length=inf, output_path=None, callback=None)
  10. lidar_hillshade(input=None, resolution=1.0, search_radius=-1.0, azimuth=315.0, altitude=30.0, returns_included="all", excluded_classes=None, min_elev=None, max_elev=None, output_path=None, callback=None)
  11. filter_lidar_classes(input=None, excluded_classes=None, output_path=None, callback=None)
  12. lidar_shift(input=None, x_shift=0.0, y_shift=0.0, z_shift=0.0, output_path=None, callback=None)
  13. remove_duplicates(input=None, include_z=False, output_path=None, callback=None)
  14. filter_lidar_scan_angles(input=None, threshold=0, output_path=None, callback=None)
  15. filter_lidar_noise(input=None, output_path=None, callback=None)
  16. lidar_thin(input=None, resolution=1.0, method="first", save_filtered=False, output_path=None, filtered_output_path=None, callback=None)
  17. lidar_elevation_slice(input=None, minz=-inf, maxz=inf, classify=False, in_class_value=2, out_class_value=1, output_path=None, callback=None)
  18. lidar_join(inputs, output_path=None, callback=None)
  19. lidar_thin_high_density(input=None, density=1.0, resolution=1.0, save_filtered=False, output_path=None, filtered_output_path=None, callback=None)
  20. lidar_tile(input, tile_width=1000.0, tile_height=1000.0, origin_x=0.0, origin_y=0.0, min_points_in_tile=2, output_laz_format=True, output_directory=None, callback=None)
  21. sort_lidar(sort_criteria, input=None, output_path=None, callback=None)
  22. filter_lidar_by_percentile(input=None, percentile=0.0, block_size=1.0, output_path=None, callback=None)
  23. split_lidar(split_criterion, input=None, interval=5.0, min_pts=5, output_directory=None, callback=None)
  24. lidar_remove_outliers(input=None, search_radius=2.0, elev_diff=50.0, use_median=False, classify=False, output_path=None, callback=None)
  25. normalize_lidar(input, dtm, no_negatives=False, output_path=None, callback=None)
  26. height_above_ground(input, output_path=None, callback=None)
  27. lidar_ground_point_filter(input=None, search_radius=2.0, min_neighbours=0, slope_threshold=45.0, height_threshold=1.0, classify=False, height_above_ground=False, output_path=None, callback=None)
  28. filter_lidar(statement, input=None, output_path=None, callback=None)
  29. modify_lidar(statement, input=None, output_path=None, callback=None)
  30. filter_lidar_by_reference_surface(input, ref_surface, query="within", threshold=0.0, classify=False, true_class_value=2, false_class_value=1, preserve_classes=False, output_path=None, callback=None)
  31. classify_lidar(input=None, search_radius=2.5, grd_threshold=0.1, oto_threshold=1.0, linearity_threshold=0.5, planarity_threshold=0.85, num_iter=30, facade_threshold=0.5, output_path=None, callback=None)
  32. classify_buildings_in_lidar(in_lidar, building_footprints, output_path=None, callback=None)
  33. ascii_to_las(input_ascii_files, pattern, epsg_code=4326, output_directory=None, callback=None)
  34. las_to_ascii(input=None, output_path=None, callback=None)
  35. select_tiles_by_polygon(input_directory, output_directory, polygons, callback=None)
  36. lidar_info(input, output_path=None, show_point_density=True, show_vlrs=True, show_geokeys=True, callback=None)
  37. lidar_histogram(input, output_path=None, parameter="elevation", clip_percent=1.0, callback=None)
  38. lidar_point_stats(input=None, resolution=1.0, num_points=False, num_pulses=False, avg_points_per_pulse=False, z_range=False, intensity_range=False, predominant_class=False, output_directory=None, callback=None)
  39. lidar_contour(input=None, contour_interval=10.0, base_contour=0.0, smooth=5, interpolation_parameter="elevation", returns_included="all", excluded_classes=None, min_elev=-inf, max_elev=inf, max_triangle_edge_length=inf, output_path=None, callback=None)
  40. lidar_tile_footprint(input=None, output_hulls=False, output_path=None, callback=None)
  41. las_to_shapefile(input=None, output_multipoint=False, output_path=None, callback=None)
  42. lidar_construct_vector_tin(input=None, returns_included="all", excluded_classes=None, min_elev=-inf, max_elev=inf, max_triangle_edge_length=inf, output_path=None, callback=None)
  43. lidar_hex_bin(input, width, orientation="h", output_path=None, callback=None)
  44. lidar_point_return_analysis(input, create_output=False, output_path=None, report_path=None, callback=None)
  45. flightline_overlap(input=None, resolution=1.0, output_path=None, callback=None)
  46. recover_flightline_info(input, max_time_diff=5.0, pt_src_id=False, user_data=False, rgb=False, output_path=None, callback=None)
  47. find_flightline_edge_points(input, output_path=None, callback=None)
  48. lidar_tophat_transform(input, search_radius, output_path=None, callback=None)
  49. normal_vectors(input, search_radius=-1.0, output_path=None, callback=None)
  50. lidar_kappa(classification_lidar, reference_lidar, report_path, resolution=1.0, output_class_accuracy=False, output_path=None, callback=None)
  51. lidar_eigenvalue_features(input=None, num_neighbours=None, search_radius=None, output_path=None, callback=None)
  52. lidar_ransac_planes(input, search_radius=2.0, num_iterations=50, num_samples=10, inlier_threshold=0.15, acceptable_model_size=30, max_planar_slope=75.0, classify=False, only_last_returns=False, output_path=None, callback=None)
  53. lidar_rooftop_analysis(lidar_inputs, building_footprints, search_radius=2.0, num_iterations=50, num_samples=10, inlier_threshold=0.15, acceptable_model_size=30, max_planar_slope=75.0, norm_diff_threshold=2.0, azimuth=180.0, altitude=30.0, output_path=None, callback=None)
  54. lidar_qa_and_confidence(input, profile="balanced", block_size=1.0, max_building_size=150.0, slope_threshold=15.0, elev_threshold=0.15, high_confidence_threshold=0.8, output_prefix=None, output_path=None, callback=None)
  55. lidar_terrain_product_suite(input, profile="balanced", block_size=1.0, max_building_size=150.0, slope_threshold=15.0, elev_threshold=0.15, z_factor=1.0, hillshade_azimuth=315.0, hillshade_altitude=45.0, high_confidence_threshold=0.8, output_prefix=None, output_path=None, callback=None)
  56. utility_corridor_encroachment_intelligence(input, corridors, profile="balanced", resolution=2.0, risk_height_threshold=3.0, corridor_influence_distance=60.0, priority_zone_threshold=None, max_zone_features=5000, output_prefix=None, callback=None)
  57. forestry_structure_and_biomass_intelligence(input, profile="balanced", resolution=2.0, stand_block_cells=12, biomass_cap=25.0, output_prefix=None, callback=None)

Notes:

  • returns_included supports all, first, and last.
  • interpolation_parameter supports elevation, intensity, class, return_number, number_of_returns, scan_angle, time, rgb, and user_data.
  • excluded_classes accepts integer classes (e.g., [7, 18] in Python).
  • Backend tools now support legacy-style batch mode when input is omitted for all currently ported LiDAR raster tools.
  • In batch mode, the backend scans the current working directory for supported LiDAR formats (LAS, LAZ, COPC, PLY, E57), processes tiles in parallel, and writes per-tile GeoTIFF outputs with tool-specific suffixes.
  • For interpolation tools, batch mode also includes points from neighboring batch tiles when processing each target tile, which helps reduce interpolation edge effects at tile boundaries.
  • Python convenience methods now accept input=None to trigger backend batch mode.
  • In batch mode, the returned Python Raster is a placeholder pointing to the first written output tile; all batch outputs are written directly to disk and not retained as in-memory raster objects.
  • For LiDAR-to-LiDAR tools in batch mode, the returned Python Lidar is similarly a placeholder path to the first written output tile, while all batch outputs are written directly to disk.

Per-Tool Parameter Notes

lidar_nearest_neighbour_gridding

  • Use when preserving local point values is preferred over smoothing.
  • search_radius controls nodata behavior away from points.
  • Backend batch-mode suffix: _nn.tif.
  • In backend batch mode, each target tile can include neighboring tile points for edge-effect reduction.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_nearest_neighbour_gridding(
    input="value",
    resolution=1.0,
    search_radius=1.0,
    interpolation_parameter=1,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
search_radiusfloatnoNumeric parameter for search_radius.
interpolation_parameterLiteral["elevation", "intensity", "class", "return_number", "number_of_returns", "scan_angle", "time", "rgb", "user_data"]noNumeric parameter for interpolation_parameter.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_idw_interpolation

  • weight controls distance decay. Higher values emphasize closer points.
  • search_radius <= 0 triggers k-nearest fallback; min_points controls k.
  • Backend batch-mode suffix: _idw.tif.
  • In backend batch mode, each target tile can include neighboring tile points for edge-effect reduction.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_idw_interpolation(
    input="value",
    resolution=1.0,
    weight=1.0,
    search_radius=1.0,
    interpolation_parameter=1,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    min_points=1,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
weightfloatnoNumeric parameter for weight.
search_radiusfloatnoNumeric parameter for search_radius.
interpolation_parameterLiteral["elevation", "intensity", "class", "return_number", "number_of_returns", "scan_angle", "time", "rgb", "user_data"]noNumeric parameter for interpolation_parameter.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
min_pointsintnoNumeric parameter for min_points.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_tin_gridding

  • Uses Delaunay triangles with barycentric interpolation.
  • max_triangle_edge_length <= 0 means no edge-length limit.
  • Backend batch-mode suffix: _tin.tif.
  • In backend batch mode, each target tile can include neighboring tile points for edge-effect reduction.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_tin_gridding(
    input="value",
    resolution=1.0,
    max_triangle_edge_length=1.0,
    interpolation_parameter=1,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    triangulation_backend,
    triangulation_auto_threshold=1,
    triangulation_epsilon=1.0,
    triangulation_thin_cell_size=1.0,
    triangulation_thin_method,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
max_triangle_edge_lengthfloatnoNumeric parameter for max_triangle_edge_length.
interpolation_parameterLiteral["elevation", "intensity", "class", "return_number", "number_of_returns", "scan_angle", "time", "rgb", "user_data"]noNumeric parameter for interpolation_parameter.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
triangulation_backendLiteral["auto", "delaunator", "wbtopology"]noOptional parameter triangulation_backend.
triangulation_auto_thresholdintnoNumeric parameter for triangulation_auto_threshold.
triangulation_epsilonfloatnoNumeric parameter for triangulation_epsilon.
triangulation_thin_cell_sizefloatnoNumeric parameter for triangulation_thin_cell_size.
triangulation_thin_methodLiteral["nearest_center", "min_value", "max_value"]noOptional parameter triangulation_thin_method.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_radial_basis_function_interpolation

  • num_points sets the local neighbourhood size.
  • func_type options: thinplatespline, polyharmonic, gaussian, multiquadric, inversemultiquadric.
  • poly_order controls local polynomial trend correction: none, constant, or quadratic.
  • Backend batch-mode suffix: _rbf.tif.
  • In backend batch mode, each target tile can include neighboring tile points for edge-effect reduction.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_radial_basis_function_interpolation(
    input="value",
    resolution=1.0,
    num_points=1,
    search_radius=1.0,
    func_type,
    poly_order,
    weight=1.0,
    interpolation_parameter=1,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
num_pointsintnoNumeric parameter for num_points.
search_radiusfloatnoNumeric parameter for search_radius.
func_typeLiteral["thinplatespline", "polyharmonic", "gaussian", "multiquadric", "inversemultiquadric"]noOptional parameter func_type.
poly_orderLiteral["none", "constant", "quadratic"]noOptional parameter poly_order.
weightfloatnoNumeric parameter for weight.
interpolation_parameterLiteral["elevation", "intensity", "class", "return_number", "number_of_returns", "scan_angle", "time", "rgb", "user_data"]noNumeric parameter for interpolation_parameter.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_sibson_interpolation

  • True Sibson natural-neighbour interpolation intended for smooth terrain surfaces.
  • No explicit weight/radius tuning parameter is required for common use.
  • Backend batch-mode suffix: _sibson.tif.
  • In backend batch mode, each target tile can include neighboring tile points for edge-effect reduction.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_sibson_interpolation(
    input="value",
    resolution=1.0,
    interpolation_parameter=1,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
interpolation_parameterLiteral["elevation", "intensity", "class", "return_number", "number_of_returns", "scan_angle", "time", "rgb", "user_data"]noNumeric parameter for interpolation_parameter.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_block_maximum

  • Computes a cell-wise maximum from filtered LiDAR points for rapid surface approximation.
  • Backend batch-mode suffix: _block_max.tif.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_block_maximum(
    input="value",
    resolution=1.0,
    interpolation_parameter=1,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
interpolation_parameterLiteral["elevation", "intensity", "class", "return_number", "number_of_returns", "scan_angle", "time", "rgb", "user_data"]noNumeric parameter for interpolation_parameter.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_block_minimum

  • Computes a cell-wise minimum from filtered LiDAR points for rapid lower-envelope approximation.
  • Backend batch-mode suffix: _block_min.tif.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_block_minimum(
    input="value",
    resolution=1.0,
    interpolation_parameter=1,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
interpolation_parameterLiteral["elevation", "intensity", "class", "return_number", "number_of_returns", "scan_angle", "time", "rgb", "user_data"]noNumeric parameter for interpolation_parameter.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_point_density

  • Counts nearby points around each cell center within search_radius and reports density per area.
  • Backend batch-mode suffix: _density.tif.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_point_density(
    input="value",
    resolution=1.0,
    search_radius=1.0,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
search_radiusfloatnoNumeric parameter for search_radius.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_digital_surface_model

  • Uses local top-surface candidate filtering and TIN gridding for a DSM-style output.
  • Supports max_triangle_edge_length masking for long-edge facet suppression.
  • Backend batch-mode suffix: _dsm.tif.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_digital_surface_model(
    input="value",
    resolution=1.0,
    search_radius=1.0,
    min_elev=1.0,
    max_elev=1.0,
    max_triangle_edge_length=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
search_radiusfloatnoNumeric parameter for search_radius.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
max_triangle_edge_lengthfloatnoNumeric parameter for max_triangle_edge_length.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_hillshade

  • Derives a hillshade raster from LiDAR-derived local surface values.
  • Supports illumination controls via azimuth and altitude.
  • Supports optional search_radius compatibility parameter for legacy call-shape parity.
  • Backend batch-mode suffix: _hillshade.tif.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_hillshade(
    input="value",
    resolution=1.0,
    search_radius=1.0,
    azimuth=1.0,
    altitude=1.0,
    returns_included,
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
search_radiusfloatnoNumeric parameter for search_radius.
azimuthfloatnoNumeric parameter for azimuth.
altitudefloatnoNumeric parameter for altitude.
returns_includedLiteral["all", "first", "last"]noOptional parameter returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_contour

  • Builds contour lines from LiDAR points using TIN-based contouring.
  • Supports interval/base controls, interpolation parameter selection, returns/class filters, and optional triangle-edge-length masking.
  • In batch mode (input=None), processes all LiDAR files in the working directory and writes sibling contour shapefiles.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_contour(
    input="value",
    contour_interval=1.0,
    base_contour=1.0,
    smooth=1,
    interpolation_parameter="value",
    returns_included="value",
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    max_triangle_edge_length=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
contour_intervalfloatnoNumeric parameter for contour_interval.
base_contourfloatnoNumeric parameter for base_contour.
smoothintnoNumeric parameter for smooth.
interpolation_parameterstringnoString parameter for interpolation_parameter.
returns_includedstringnoString parameter for returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
max_triangle_edge_lengthfloatnoNumeric parameter for max_triangle_edge_length.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_tile_footprint

  • Generates polygon footprints per tile with summary attributes (LAS_NM, NUM_PNTS, Z_MIN, Z_MAX).
  • Writes bounding boxes by default; set output_hulls=True to write convex hull footprints.
  • In batch mode (input=None), writes a single combined footprint layer for all LiDAR tiles in the working directory.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_tile_footprint(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
output_hullsboolnoBoolean option for output_hulls.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

las_to_shapefile

  • Converts LiDAR points to vector output.
  • By default writes one point feature per LiDAR point with key attributes (Z, INTENSITY, CLASS, return fields).
  • If output_multipoint=True, writes a single multipoint feature instead.
  • In batch mode (input=None), writes one shapefile per LiDAR tile in the working directory.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.lidar.io_management.las_to_shapefile(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
output_multipointboolnoBoolean option for output_multipoint.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_construct_vector_tin

  • Builds a triangular mesh vector layer directly from LiDAR points using Delaunay triangulation.
  • Supports return filtering, class filtering, elevation limits, and optional max triangle-edge filtering.
  • In batch mode (input=None), writes one _tin.shp output per LiDAR tile in the working directory.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_construct_vector_tin(
    input="value",
    returns_included="value",
    [excluded_classes_1, excluded_classes_2],
    min_elev=1.0,
    max_elev=1.0,
    max_triangle_edge_length=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
returns_includedstringnoString parameter for returns_included.
excluded_classeslist[int] |NonenoList input for excluded_classes.
min_elevfloatnoNumeric parameter for min_elev.
max_elevfloatnoNumeric parameter for max_elev.
max_triangle_edge_lengthfloatnoNumeric parameter for max_triangle_edge_length.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_hex_bin

  • Bins LiDAR points to a hexagonal polygon grid and summarizes per-cell point count and min/max z/intensity.
  • width sets the distance between opposite hex sides.
  • orientation supports h (pointy-up) and v (flat-up).

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_hex_bin(
    input="value",
    width=1.0,
    orientation="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
widthfloatyesNumeric parameter for width.
orientationstringnoString parameter for orientation.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_point_return_analysis

  • Produces a return-sequence quality-control report (report_path) covering missing returns, duplicates, and r > n anomalies.
  • If create_output=True, also writes a classified QC LiDAR output (output) with class assignments for problematic return groups.

Outputs

  • return: str

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_point_return_analysis(
    input="value",
    output_path="result.tif",
    report_path="report.dat",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
create_outputboolnoBoolean option for create_output.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
report_pathstringnoPath value for report.
callbackfunctionnoOptional progress callback receiving JSON events.

flightline_overlap

  • Builds a raster whose cell values equal the number of distinct point_source_id values present in each cell.
  • In batch mode (input=None), scans the working directory for LiDAR tiles and writes one _flightline_overlap.tif raster per tile.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.flightline_overlap(
    input="value",
    resolution=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

recover_flightline_info

  • Sorts points by GPS time and starts a new inferred flightline when the time gap exceeds max_time_diff seconds.
  • Writes inferred flightline identifiers into any combination of point_source_id, user_data, and RGB.
  • If no output field flags are enabled, RGB output is enabled automatically.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.recover_flightline_info(
    input="value",
    max_time_diff=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
max_time_difffloatnoNumeric parameter for max_time_diff.
pt_src_idboolnoBoolean option for pt_src_id.
user_databoolnoBoolean option for user_data.
rgbboolnoBoolean option for rgb.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

find_flightline_edge_points

  • Filters the input LiDAR to only points carrying the LAS edge_of_flight_line flag.
  • Returns a LiDAR output containing just the edge points.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.analysis_metrics.find_flightline_edge_points(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_tophat_transform

  • Applies a white top-hat transform to point elevations by subtracting a locally opened surface from each point z value.
  • search_radius controls the XY neighbourhood used for the erosion and dilation steps.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.lidar_tophat_transform(
    input="value",
    search_radius=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
search_radiusfloatyesNumeric parameter for search_radius.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

normal_vectors

  • Estimates local plane normals from neighbouring points and writes a compatibility color encoding based on normal direction.
  • If search_radius <= 0, the backend estimates a nominal point spacing and derives a default neighbourhood size automatically.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.analysis_metrics.normal_vectors(
    input="value",
    search_radius=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
search_radiusfloatnoNumeric parameter for search_radius.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_kappa

  • Compares classifications in two LiDAR datasets using nearest-point matching and writes an HTML agreement report.
  • Also writes a raster of per-cell classification agreement percentages at resolution.
  • output_class_accuracy is accepted for legacy call-shape parity; the class-agreement raster is produced regardless.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_kappa(
    classification_lidar="value",
    reference_lidar="value",
    report_path="report.dat",
    resolution=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
classification_lidarLidaryesInput LiDAR dataset for classification_lidar.
reference_lidarLidaryesInput LiDAR dataset for reference_lidar.
report_pathstringyesPath value for report.
resolutionfloatnoNumeric parameter for resolution.
output_class_accuracyboolnoBoolean option for output_class_accuracy.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_eigenvalue_features

  • Computes local PCA-based neighbourhood features and writes a binary .eigen output plus a JSON schema sidecar.
  • Supports single-file mode (input=...) and working-directory batch mode (input=None).
  • num_neighbours must be at least 7 when specified; search_radius can be used alone or together with neighbour-count limiting.

Outputs

  • return: str

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_eigenvalue_features(
    input="value",
    num_neighbours=1,
    search_radius=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
num_neighboursintnoNumeric parameter for num_neighbours.
search_radiusfloatnoNumeric parameter for search_radius.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_ransac_planes

  • Uses local RANSAC plane fitting to identify planar points.
  • If classify=False, non-planar points are filtered out; if classify=True, all points are retained and tagged as planar vs non-planar by class value.
  • only_last_returns=True restricts model fitting to late returns.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_ransac_planes(
    input="value",
    search_radius=1.0,
    num_iterations=1,
    num_samples=1,
    inlier_threshold=1.0,
    acceptable_model_size=1,
    max_planar_slope=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
search_radiusfloatnoNumeric parameter for search_radius.
num_iterationsintnoNumeric parameter for num_iterations.
num_samplesintnoNumeric parameter for num_samples.
inlier_thresholdfloatnoNumeric parameter for inlier_threshold.
acceptable_model_sizeintnoNumeric parameter for acceptable_model_size.
max_planar_slopefloatnoNumeric parameter for max_planar_slope.
classifyboolnoBoolean option for classify.
only_last_returnsboolnoBoolean option for only_last_returns.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_rooftop_analysis

  • Identifies rooftop facets inside building_footprints and writes polygon output with rooftop attributes such as MAX_ELEV, HILLSHADE, SLOPE, ASPECT, and AREA.
  • lidar_inputs accepts one or more LiDAR tiles covering the buildings of interest.
  • Current parity implementation outputs convex-hull roof facets per detected planar segment.

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_rooftop_analysis(
    [lidar_inputs_1, lidar_inputs_2],
    building_footprints,
    search_radius=1.0,
    num_iterations=1,
    num_samples=1,
    inlier_threshold=1.0,
    acceptable_model_size=1,
    max_planar_slope=1.0,
    norm_diff_threshold=1.0,
    azimuth=1.0,
    altitude=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
lidar_inputsLidaryesInput LiDAR dataset for lidar_inputs.
building_footprintsVectoryesInput vector layer for building_footprints.
search_radiusfloatnoNumeric parameter for search_radius.
num_iterationsintnoNumeric parameter for num_iterations.
num_samplesintnoNumeric parameter for num_samples.
inlier_thresholdfloatnoNumeric parameter for inlier_threshold.
acceptable_model_sizeintnoNumeric parameter for acceptable_model_size.
max_planar_slopefloatnoNumeric parameter for max_planar_slope.
norm_diff_thresholdfloatnoNumeric parameter for norm_diff_threshold.
azimuthfloatnoNumeric parameter for azimuth.
altitudefloatnoNumeric parameter for altitude.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_qa_and_confidence

  • Runs a QA workflow that classifies/filters ground points and produces DTM, confidence, uncertainty, QA flags, and summary outputs.
  • Returns a tuple of (classified_lidar, dtm, confidence, uncertainty, qa_flags, summary_path).
  • profile supports strict, balanced, and permissive.

Outputs

Returned as tuple[Lidar, Raster, Raster, Raster, Raster, str] in this order:

  • classified_lidar: Lidar
  • dtm: Raster
  • confidence: Raster
  • uncertainty: Raster
  • qa_flags: Raster
  • summary: str

WbEnvironment usage

classified_lidar, dtm, confidence, uncertainty, qa_flags, summary = wbe.lidar.workflow_products.lidar_qa_and_confidence(
    input,
    profile="value",
    block_size=1.0,
    max_building_size=1.0,
    slope_threshold=1.0,
    elev_threshold=1.0,
    high_confidence_threshold=1.0,
    output_prefix="output/result",
    output_path="output_path.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
profilestringyesString parameter for profile.
block_sizefloatyesNumeric parameter for block_size.
max_building_sizefloatyesNumeric parameter for max_building_size.
slope_thresholdfloatyesNumeric parameter for slope_threshold.
elev_thresholdfloatyesNumeric parameter for elev_threshold.
high_confidence_thresholdfloatyesNumeric parameter for high_confidence_threshold.
output_prefixstringnoOptional output prefix for multi-product outputs.
output_pathstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_terrain_product_suite

  • Runs an end-to-end terrain product workflow and outputs DTM, DSM, slope, hillshade, confidence, uncertainty, metadata summary, and optional classified lidar.
  • Returns (dtm, dsm, slope, hillshade, confidence, uncertainty, metadata_path, classified_lidar_optional).
  • profile supports strict, balanced, and permissive.

Outputs

Returned as tuple[Raster, Vector, Vector, Raster, str] in this order:

  • risk: Raster
  • zones: Vector
  • table: Vector
  • confidence: Raster
  • summary: str

WbEnvironment usage

risk, zones, table, confidence, summary = wbe.lidar.workflow_products.lidar_terrain_product_suite(
    input,
    profile="value",
    block_size=1.0,
    max_building_size=1.0,
    slope_threshold=1.0,
    elev_threshold=1.0,
    z_factor=1.0,
    hillshade_azimuth=1.0,
    hillshade_altitude=1.0,
    high_confidence_threshold=1.0,
    output_prefix="output/result",
    output_path="output_path.tif",
    ) -> PyResult<(Raster, Raster, Raster, Raster, Raster, Raster, String, Option<Lidar>)> {
        let mut args = serde_json,
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
profilestringyesString parameter for profile.
block_sizefloatyesNumeric parameter for block_size.
max_building_sizefloatyesNumeric parameter for max_building_size.
slope_thresholdfloatyesNumeric parameter for slope_threshold.
elev_thresholdfloatyesNumeric parameter for elev_threshold.
z_factorfloatyesNumeric parameter for z_factor.
hillshade_azimuthfloatyesNumeric parameter for hillshade_azimuth.
hillshade_altitudefloatyesNumeric parameter for hillshade_altitude.
high_confidence_thresholdfloatyesNumeric parameter for high_confidence_threshold.
output_prefixstringnoOptional output prefix for multi-product outputs.
output_pathstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.
`) -> PyResult<(Raster, Raster, Raster, Raster, Raster, Raster, String, Option)> {
let mut args = serde_json`functionnoInput raster for `) -> PyResult<(Raster, Raster, Raster, Raster, Raster, Raster, String, Option)> {
let mut args = serde_json`.

utility_corridor_encroachment_intelligence

  • Detects LiDAR-derived vegetation encroachment risk near utility corridor centerlines.
  • Returns (encroachment_risk_raster, corridor_priority_zones_vector, asset_risk_table_vector, classification_confidence_raster, summary_path).
  • profile supports fast, balanced, and strict; priority_zone_threshold and max_zone_features control zone selection density.
  • risk_height_threshold controls the canopy height where risk increases, and corridor_influence_distance controls proximity decay.

Outputs

Returned as tuple[Raster, Vector, Vector, Raster, str] in this order:

  • risk: Raster
  • zones: Vector
  • table: Vector
  • confidence: Raster
  • summary: str

WbEnvironment usage

risk, zones, table, confidence, summary = wbe.terrain.workflow_products.utility_corridor_encroachment_intelligence(
    input,
    corridors,
    profile="value",
    resolution=1.0,
    risk_height_threshold=1.0,
    corridor_influence_distance=1.0,
    priority_zone_threshold=1.0,
    max_zone_features=1,
    output_prefix="output/result",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
corridorsVectoryesInput vector layer for corridors.
profilestringyesString parameter for profile.
resolutionfloatyesNumeric parameter for resolution.
risk_height_thresholdfloatyesNumeric parameter for risk_height_threshold.
corridor_influence_distancefloatyesNumeric parameter for corridor_influence_distance.
priority_zone_thresholdfloatnoNumeric parameter for priority_zone_threshold.
max_zone_featuresintyesNumeric parameter for max_zone_features.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

forestry_structure_and_biomass_intelligence

  • Produces canopy metrics, vertical structure classes, stand units, biomass proxy, and confidence outputs from LiDAR.
  • Returns (canopy_height_metrics_raster, vertical_structure_class_raster, stand_structure_units_vector, biomass_proxy_raster, confidence_raster, summary_path).
  • profile supports fast, balanced, and strict; stand_block_cells controls stand-level aggregation size.
  • biomass_cap sets an upper bound for biomass proxy scaling.

Outputs

Returned as tuple[Raster, Raster, Vector, Raster, Raster, str] in this order:

  • canopy: Raster
  • class: Raster
  • stand: Vector
  • biomass: Raster
  • confidence: Raster
  • summary: str

WbEnvironment usage

canopy, class, stand, biomass, confidence, summary = wbe.terrain.workflow_products.forestry_structure_and_biomass_intelligence(
    input,
    profile="value",
    resolution=1.0,
    stand_block_cells=1,
    biomass_cap=1.0,
    terrain_adaptation="value",
    output_prefix="output/result",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
profilestringyesString parameter for profile.
resolutionfloatyesNumeric parameter for resolution.
stand_block_cellsintyesNumeric parameter for stand_block_cells.
biomass_capfloatyesNumeric parameter for biomass_cap.
terrain_adaptationstringyesString parameter for terrain_adaptation.
output_prefixstringnoOptional output prefix for multi-product outputs.
callbackfunctionnoOptional progress callback receiving JSON events.

filter_lidar_classes

  • Removes points whose classification is listed in excluded_classes.
  • Backend batch-mode suffix: _filtered_cls with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.filter_lidar_classes(
    input="value",
    [excluded_classes_1, excluded_classes_2],
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
excluded_classeslist[int] |NonenoList input for excluded_classes.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_shift

  • Applies additive x_shift, y_shift, and z_shift offsets to each point.
  • Backend batch-mode suffix: _shifted with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.lidar_shift(
    input="value",
    x_shift=1.0,
    y_shift=1.0,
    z_shift=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
x_shiftfloatnoNumeric parameter for x_shift.
y_shiftfloatnoNumeric parameter for y_shift.
z_shiftfloatnoNumeric parameter for z_shift.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

remove_duplicates

  • Removes duplicate points by x/y coordinates, optionally including z when include_z=True.
  • Backend batch-mode suffix: _dedup with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.remove_duplicates(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
include_zboolnoBoolean option for include_z.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

filter_lidar_scan_angles

  • Removes points with absolute scan angle greater than threshold.
  • threshold uses LAS scan-angle integer units (1 unit = 0.006°).
  • Backend batch-mode suffix: _scan_filtered with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.filter_lidar_scan_angles(
    input="value",
    threshold=1,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
thresholdintnoNumeric parameter for threshold.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

filter_lidar_noise

  • Removes points classified as low noise (class=7) or high noise (class=18).
  • Backend batch-mode suffix: _denoised with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.filter_lidar_noise(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_thin

  • Keeps at most one point per grid cell at resolution.
  • method supports first, last, lowest, highest, and nearest.
  • Backend batch-mode suffix: _thinned with LiDAR output extension.
  • If save_filtered=True, filtered-out points are also written and exposed as filtered_path in backend outputs (wrapper return remains the kept-point Lidar).

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_thin(
    input="value",
    resolution=1.0,
    method="value",
    output_path="result.tif",
    filtered_output="value",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
methodstringnoString parameter for method.
save_filteredboolnoBoolean option for save_filtered.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
filtered_outputstringnoString parameter for filtered_output.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_elevation_slice

  • In filter mode (classify=False), keeps only points with minz <= z <= maxz.
  • In classify mode (classify=True), keeps all points and reassigns class values using in_class_value and out_class_value.
  • Backend batch-mode suffix: _elev_slice with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.lidar_elevation_slice(
    input="value",
    minz=1.0,
    maxz=1.0,
    in_class_value=1,
    out_class_value=1,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
minzfloatnoNumeric parameter for minz.
maxzfloatnoNumeric parameter for maxz.
classifyboolnoBoolean option for classify.
in_class_valueintnoNumeric parameter for in_class_value.
out_class_valueintnoNumeric parameter for out_class_value.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_join

  • Merges multiple input LiDAR files into a single output point cloud.
  • Expects inputs to be a list of LiDAR objects/paths.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.lidar_join(
    [inputs_1, inputs_2],
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputsLidaryesInput LiDAR dataset for inputs.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_thin_high_density

  • Performs density-aware thinning by x/y blocks and z bins.
  • density sets target points-per-area threshold; areas above threshold are thinned.
  • If save_filtered=True, filtered points are also written and returned via backend filtered_path metadata.
  • Backend batch-mode suffix: _thinned_hd with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.interpolation_gridding.lidar_thin_high_density(
    input="value",
    density=1.0,
    resolution=1.0,
    output_path="result.tif",
    filtered_output="value",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
densityfloatnoNumeric parameter for density.
resolutionfloatnoNumeric parameter for resolution.
save_filteredboolnoBoolean option for save_filtered.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
filtered_outputstringnoString parameter for filtered_output.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_tile

  • Splits a single input LiDAR into row/column tile outputs using a regular grid.
  • Writes multiple files to output_directory (or <input_stem>/ by default) and returns a placeholder path to one written tile.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.lidar_tile(
    input="value",
    tile_width=1.0,
    tile_height=1.0,
    origin_x=1.0,
    origin_y=1.0,
    min_points_in_tile=1,
    output_directory="value",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
tile_widthfloatnoNumeric parameter for tile_width.
tile_heightfloatnoNumeric parameter for tile_height.
origin_xfloatnoNumeric parameter for origin_x.
origin_yfloatnoNumeric parameter for origin_y.
min_points_in_tileintnoNumeric parameter for min_points_in_tile.
output_laz_formatboolnoBoolean option for output_laz_format.
output_directorystringnoString parameter for output_directory.
callbackfunctionnoOptional progress callback receiving JSON events.

sort_lidar

  • Sorts points by one or more criteria (e.g., "x 100, y 100, z").
  • Supports optional bin sizes per criterion for grouped sorting.
  • Backend batch-mode suffix: _sorted with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.sort_lidar(
    sort_criteria="value",
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
sort_criteriastringyesString parameter for sort_criteria.
inputLidarnoInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

filter_lidar_by_percentile

  • Selects one representative point per grid block by elevation percentile.
  • percentile=0 selects local minima, 100 selects maxima, 50 approximates medians.
  • Excludes withheld and noise-classified points from percentile candidate sets.
  • Backend batch-mode suffix: _percentile with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.filter_lidar_by_percentile(
    input="value",
    percentile=1.0,
    block_size=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
percentilefloatnoNumeric parameter for percentile.
block_sizefloatnoNumeric parameter for block_size.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

split_lidar

  • Splits a LiDAR file into multiple outputs using a grouping criterion (num_pts, x, y, z, intensity, class, user_data, point_source_id, scan_angle, time).
  • interval controls bin width for numeric criteria and points-per-file when split_criterion="num_pts".
  • min_pts filters sparse split outputs.
  • In both single and batch mode, tool returns a placeholder path to one written split file plus backend output_count metadata.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.split_lidar(
    split_criterion="value",
    input="value",
    interval=1.0,
    min_pts=1,
    output_directory="value",
)

Parameters

NameTypeRequiredDescription
split_criterionstringyesString parameter for split_criterion.
inputLidarnoInput LiDAR dataset for input.
intervalfloatnoNumeric parameter for interval.
min_ptsintnoNumeric parameter for min_pts.
output_directorystringnoString parameter for output_directory.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_remove_outliers

  • Computes local elevation residuals from neighborhood mean/median and either filters or reclassifies outliers.
  • classify=False: removes outliers; classify=True: keeps all points and assigns low/high noise classes 7/18.
  • Backend batch-mode suffix: _outliers_removed (filter mode) or _outliers_classified (classify mode).

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.lidar_remove_outliers(
    input="value",
    search_radius=1.0,
    elev_diff=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
search_radiusfloatnoNumeric parameter for search_radius.
elev_difffloatnoNumeric parameter for elev_diff.
use_medianboolnoBoolean option for use_median.
classifyboolnoBoolean option for classify.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

normalize_lidar

  • Uses an input DTM raster to convert LiDAR elevations to height above terrain (z = z_lidar - z_dtm).
  • dtm may be provided as a path string or typed raster object.
  • If no_negatives=True, negative normalized values are clamped to 0.0.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.normalize_lidar(
    input="value",
    dtm,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
dtmRasteryesInput raster for dtm.
no_negativesboolnoBoolean option for no_negatives.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

height_above_ground

  • Converts each point elevation to height above the nearest ground-classified point (class=2).
  • Ground-classified points are assigned z=0.0 in output.
  • Fails with a validation/runtime error if there are no ground-classified points.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.height_above_ground(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_ground_point_filter

  • Applies a slope-and-height neighborhood test to identify off-terrain points.
  • classify=True writes classification labels (ground=2, off-terrain=1); otherwise off-terrain points are removed.
  • Supports optional height_above_ground=True output z normalization from local neighborhood minima.
  • Backend batch-mode suffix: _ground_filtered with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.remote_sensing.filters.lidar_ground_point_filter(
    input="value",
    search_radius=1.0,
    min_neighbours=1,
    slope_threshold=1.0,
    height_threshold=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
search_radiusfloatnoNumeric parameter for search_radius.
min_neighboursintnoNumeric parameter for min_neighbours.
slope_thresholdfloatnoNumeric parameter for slope_threshold.
height_thresholdfloatnoNumeric parameter for height_threshold.
classifyboolnoBoolean option for classify.
height_above_groundboolnoBoolean option for height_above_ground.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

filter_lidar

  • Filters points with a boolean statement evaluated against point attributes.
  • Supports core variables: coordinates (x,y,z), returns (ret,nret,is_late,...), class flags, scan metrics, color/time, and file min/mid/max stats.
  • Backend batch-mode suffix: _filtered with LiDAR output extension.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.filter_lidar(
    statement="value",
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
statementstringyesString parameter for statement.
inputLidarnoInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

modify_lidar

  • Applies assignment expressions to mutate LiDAR point attributes (e.g., z = z + 1, class = if(z > 10, 2, class), rgb = (255,0,0)).
  • Supports semicolon-separated multi-expression statements evaluated per point.
  • Supports no-input batch mode with _modified output suffix.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.modify_lidar(
    statement="value",
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
statementstringyesString parameter for statement.
inputLidarnoInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

filter_lidar_by_reference_surface

  • Compares each point elevation against a raster reference surface using query modes: within, <, <=, >, >=.
  • In filter mode (classify=False), outputs only points that satisfy the query.
  • In classify mode, all points are retained and classes are written using true_class_value and false_class_value (or preserved when preserve_classes=True).

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.filter_lidar_by_reference_surface(
    input="value",
    ref_surface,
    query="value",
    threshold=1.0,
    true_class_value=1,
    false_class_value=1,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
ref_surfaceRasteryesInput raster for ref_surface.
querystringnoString parameter for query.
thresholdfloatnoNumeric parameter for threshold.
classifyboolnoBoolean option for classify.
true_class_valueintnoNumeric parameter for true_class_value.
false_class_valueintnoNumeric parameter for false_class_value.
preserve_classesboolnoBoolean option for preserve_classes.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

classify_lidar

  • Performs basic neighborhood-based classification into ground (2), building (6), vegetation (5), and unclassified (1).
  • Uses search_radius, grd_threshold, and oto_threshold as primary controls, with RANSAC-style local planarity/linearity estimation.
  • Supports no-input batch mode; backend batch-mode suffix: _classified with LiDAR output extension.
  • linearity_threshold, planarity_threshold, num_iter, and facade_threshold are actively used during segmentation and refinement stages.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.classify_lidar(
    input="value",
    search_radius=1.0,
    grd_threshold=1.0,
    oto_threshold=1.0,
    linearity_threshold=1.0,
    planarity_threshold=1.0,
    num_iter=1,
    facade_threshold=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
search_radiusfloatnoNumeric parameter for search_radius.
grd_thresholdfloatnoNumeric parameter for grd_threshold.
oto_thresholdfloatnoNumeric parameter for oto_threshold.
linearity_thresholdfloatnoNumeric parameter for linearity_threshold.
planarity_thresholdfloatnoNumeric parameter for planarity_threshold.
num_iterintnoNumeric parameter for num_iter.
facade_thresholdfloatnoNumeric parameter for facade_threshold.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

classify_buildings_in_lidar

  • Reclassifies points to building class (6) when they fall within polygon building footprints.
  • Input polygons should represent building outlines in the same CRS as the LiDAR input.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.classify_buildings_in_lidar(
    in_lidar="value",
    building_footprints,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
in_lidarLidaryesInput LiDAR dataset for in_lidar.
building_footprintsVectoryesInput vector layer for building_footprints.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

ascii_to_las

  • Converts one or more ASCII point files into LAS output files.
  • pattern must include x,y,z and can include: i,c,rn,nr,time,sa,r,g,b.
  • If rn is used, nr must also be used; RGB fields must be supplied as a full r,g,b set.
  • epsg_code sets output LAS CRS metadata; outputs are written to output_directory when provided.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.ascii_to_las(
    [input_ascii_files_1, input_ascii_files_2],
    pattern="value",
    epsg_code=1,
    output_directory="value",
)

Parameters

NameTypeRequiredDescription
input_ascii_fileslist[stringinginging]yesList input for input_ascii_files.
patternstringyesString parameter for pattern.
epsg_codeintnoNumeric parameter for epsg_code.
output_directorystringnoString parameter for output_directory.
callbackfunctionnoOptional progress callback receiving JSON events.

las_to_ascii

  • Converts an input LiDAR file to CSV with columns based on available attributes (time/RGB columns are included when present).
  • If input=None, runs in batch mode over LiDAR files in the current working directory and returns a placeholder path to one produced CSV.

Outputs

  • return: str

WbEnvironment usage

result = wbe.lidar.io_management.las_to_ascii(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

select_tiles_by_polygon

  • Scans LiDAR tiles in input_directory and copies selected tiles to output_directory based on polygon overlap.
  • Tile selection uses representative tile-bounding-box sample points (corners, center, and edge midpoints) against polygon geometry.
  • Returns the output directory path and writes selected tile files directly to disk.

Outputs

  • return: str

WbEnvironment usage

result = wbe.lidar.io_management.select_tiles_by_polygon(
    input_directory="value",
    output_directory="value",
    polygons,
)

Parameters

NameTypeRequiredDescription
input_directorystringyesString parameter for input_directory.
output_directorystringyesString parameter for output_directory.
polygonsVectoryesInput vector layer for polygons.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_info

  • Produces a LiDAR summary report with point counts, coordinate/intensity ranges, class counts, and return counts.
  • Writes to .txt or .html report output and returns the report path.

Outputs

  • return: str

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_info(
    input="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
show_point_densityboolnoBoolean option for show_point_density.
show_vlrsboolnoBoolean option for show_vlrs.
show_geokeysboolnoBoolean option for show_geokeys.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_histogram

  • Builds a histogram report for one parameter (elevation, intensity, scan angle, class, or time).
  • Supports lower/upper tail clipping using clip_percent.
  • Writes an HTML report and returns its path.

Outputs

  • return: str

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_histogram(
    input="value",
    output_path="result.tif",
    parameter="value",
    clip_percent=1.0,
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
parameterstringnoString parameter for parameter.
clip_percentfloatnoNumeric parameter for clip_percent.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_point_stats

  • Generates one or more summary rasters (point count, pulse count, avg points/pulse, z range, intensity range, predominant class).
  • If no output flags are set, all point-stat rasters are generated.
  • Returns the output directory path containing generated GeoTIFF rasters.

Outputs

  • return: str

WbEnvironment usage

result = wbe.lidar.analysis_metrics.lidar_point_stats(
    input="value",
    resolution=1.0,
    output_directory="value",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
num_pointsboolnoBoolean option for num_points.
num_pulsesboolnoBoolean option for num_pulses.
avg_points_per_pulseboolnoBoolean option for avg_points_per_pulse.
z_rangeboolnoBoolean option for z_range.
intensity_rangeboolnoBoolean option for intensity_range.
predominant_classboolnoBoolean option for predominant_class.
output_directorystringnoString parameter for output_directory.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_classify_subset

  • Reclassifies points in a base cloud when they spatially match points in a subset cloud.
  • Uses 3D nearest-neighbour matching with configurable tolerance (map units).
  • Assigns subset_class_value to matches and nonsubset_class_value to non-matches (255 preserves original classes).

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.lidar_classify_subset(
    base_lidar="value",
    subset_lidar="value",
    subset_class_value=1,
    nonsubset_class_value=1,
    tolerance=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
base_lidarLidaryesInput LiDAR dataset for base_lidar.
subset_lidarLidaryesInput LiDAR dataset for subset_lidar.
subset_class_valueintnoNumeric parameter for subset_class_value.
nonsubset_class_valueintnoNumeric parameter for nonsubset_class_value.
tolerancefloatnoNumeric parameter for tolerance.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

clip_lidar_to_polygon

  • Retains only points that lie within input polygon geometry (polygons vector path/object).
  • Supports polygon holes; points inside holes are excluded from output.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.clip_lidar_to_polygon(
    input="value",
    polygons,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
polygonsVectoryesInput vector layer for polygons.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

erase_polygon_from_lidar

  • Removes points that lie within input polygon geometry (polygons vector path/object).
  • Complement of clip_lidar_to_polygon; points outside polygons are retained.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.erase_polygon_from_lidar(
    input="value",
    polygons,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
polygonsVectoryesInput vector layer for polygons.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

classify_overlap_points

  • Identifies overlap points in grid cells containing multiple point-source IDs and either classifies (class=12) or filters them.
  • Supported criteria: max scan angle, not min point source id, not min time, multiple point source IDs.
  • filter=True removes overlap points; otherwise flagged points are reclassified.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.classify_overlap_points(
    input="value",
    resolution=1.0,
    overlap_criterion="value",
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
resolutionfloatnoNumeric parameter for resolution.
overlap_criterionstringnoString parameter for overlap_criterion.
filterboolnoBoolean option for filter.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_segmentation

  • Segments points into connected components using XY neighbourhood (search_radius) and vertical continuity (max_z_diff).
  • Writes per-segment colours into point RGB values; largest segment receives dark green (25,120,0).
  • Compatibility parameters for legacy call-shape are accepted (num_iterations, num_samples, inlier_threshold, acceptable_model_size, max_planar_slope, norm_diff_threshold).
  • Optional ground=True assigns class 2 to the largest segment and class 1 to other segmented points.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.lidar_segmentation(
    input="value",
    search_radius=1.0,
    num_iterations=1,
    num_samples=1,
    inlier_threshold=1.0,
    acceptable_model_size=1,
    max_planar_slope=1.0,
    norm_diff_threshold=1.0,
    max_z_diff=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
search_radiusfloatnoNumeric parameter for search_radius.
num_iterationsintnoNumeric parameter for num_iterations.
num_samplesintnoNumeric parameter for num_samples.
inlier_thresholdfloatnoNumeric parameter for inlier_threshold.
acceptable_model_sizeintnoNumeric parameter for acceptable_model_size.
max_planar_slopefloatnoNumeric parameter for max_planar_slope.
norm_diff_thresholdfloatnoNumeric parameter for norm_diff_threshold.
max_z_difffloatnoNumeric parameter for max_z_diff.
classesboolnoBoolean option for classes.
groundboolnoBoolean option for ground.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

individual_tree_segmentation

  • Segments individual tree points using a mean-shift mode-seeking workflow over LiDAR points.
  • Algorithm inspiration and credit: this implementation is inspired by the self-adaptive mean-shift tree-segmentation approach described in the 2020 MDPI Remote Sensing article on individual-tree segmentation, and by the grid-accelerated approximation ideas in the MeanShift++ paper (arXiv, 2021).
  • Defaults to vegetation-only segmentation (only_use_veg=True, veg_classes="3,4,5") and height filtering (min_height=2.0).
  • Uses adaptive per-seed horizontal bandwidth by default (adaptive_bandwidth=True) based on local neighbour density and angular sector crown-radius cues.
  • Adaptive controls: adaptive_neighbors (default 24) and adaptive_sector_count (default 8), with fallback to bounded height-based scaling when adaptive mode is disabled.
  • Supports optional MeanShift++-style grid approximation (grid_acceleration=True) that runs mode updates against aggregated grid cells for faster large-cloud processing.
  • Grid approximation control: grid_cell_size (default 0.5 in XY map units).
  • Optional post-grid exact refinement: grid_refine_exact=True with grid_refine_iterations (default 2) to recover local precision after coarse grid updates.
  • Optional tiled seed scheduling for very large inputs: tile_size (default 0.0, disabled) and tile_overlap (default 0.0, must be smaller than tile_size).
  • Supports deterministic random segment colouring (output_id_mode="rgb"), optional id storage in user_data / point_source_id, and optional sidecar CSV output (output_sidecar_csv=True).
  • Includes performance controls: threads and simd.

Benchmarking notes (developer reference):

DateDatasetPointsModeThreadsSIMDWall time (ms)Assigned veg pointsSegment count
YYYY-MM-DDnamenexact / grid_accelttrue/falsevaluevaluevalue

Expanded local matrix (2026-03-24):

DateDatasetPointsModeThreadsSIMDWall time (ms)Assigned veg pointsSegment count
2026-03-24synthetic small_t32_p1805952exactautotrue28.28 (median)553632
2026-03-24synthetic small_t32_p1805952grid_accelautotrue9.20 (median)553632
2026-03-24synthetic small_t32_p1805952grid_refineautotrue14.29 (median)553632
2026-03-24synthetic small_t32_p1805952grid_refine_tiledautotrue14.86 (median)553632
2026-03-24synthetic small_t32_p1805952grid_refine_tiled_t11true61.15 (median)553632
2026-03-24synthetic medium_t64_p22014464exactautotrue90.10 (median)1363264
2026-03-24synthetic medium_t64_p22014464grid_accelautotrue28.40 (median)1363264
2026-03-24synthetic medium_t64_p22014464grid_refineautotrue44.48 (median)1363264
2026-03-24synthetic medium_t64_p22014464grid_refine_tiledautotrue48.20 (median)1363264
2026-03-24synthetic medium_t64_p22014464grid_refine_tiled_t11true191.91 (median)1363264
2026-03-24synthetic medium_t64_p22014464grid_refine_tiled_t44true72.74 (median)1363264

Observed speed/quality summary:

  • Quality parity on synthetic data: assigned-point and segment-count ratios are 1.0 for all measured variants versus exact.
  • Fastest profile in this matrix: grid_accel (about 3.07x faster on small, 3.17x faster on medium versus exact).
  • Grid refine improves precision pathway while retaining speedup (about 1.98x small, 2.03x medium versus exact).
  • Tiling is useful for scalability controls, but on these moderate synthetic sizes it adds overhead unless required for memory/partitioning constraints.

Parameter tuning guidance: For recommended parameter profiles tailored to your use case (speed-critical, precision-optimized, balanced, or memory-constrained), see Section 16 (Parameter tuning guide) in lidar_individual_tree_segmentation_design.md. This guide provides ready-to-use parameter sets plus hyperparameter tuning directions for common forest types.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.individual_tree_segmentation(
    input="value",
    veg_classes="value",
    4,
    5",
    min_height=1.0,
    max_height=1.0,
    bandwidth_min=1.0,
    bandwidth_max=1.0,
    adaptive_neighbors=1,
    adaptive_sector_count=1,
    grid_cell_size=1.0,
    grid_refine_iterations=1,
    tile_size=1.0,
    tile_overlap=1.0,
    vertical_bandwidth=1.0,
    max_iterations=1,
    convergence_tol=1.0,
    min_cluster_points=1,
    mode_merge_dist=1.0,
    threads=1,
    output_id_mode="value",
    seed=1,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
only_use_vegboolnoBoolean option for only_use_veg.
veg_classesstringnoString parameter for veg_classes.
4AnyyesParameter 4.
5"AnyyesParameter 5".
min_heightfloatnoNumeric parameter for min_height.
max_heightfloatnoNumeric parameter for max_height.
bandwidth_minfloatnoNumeric parameter for bandwidth_min.
bandwidth_maxfloatnoNumeric parameter for bandwidth_max.
adaptive_bandwidthboolnoBoolean option for adaptive_bandwidth.
adaptive_neighborsintnoNumeric parameter for adaptive_neighbors.
adaptive_sector_countintnoNumeric parameter for adaptive_sector_count.
grid_accelerationboolnoBoolean option for grid_acceleration.
grid_cell_sizefloatnoNumeric parameter for grid_cell_size.
grid_refine_exactboolnoBoolean option for grid_refine_exact.
grid_refine_iterationsintnoNumeric parameter for grid_refine_iterations.
tile_sizefloatnoNumeric parameter for tile_size.
tile_overlapfloatnoNumeric parameter for tile_overlap.
vertical_bandwidthfloatnoNumeric parameter for vertical_bandwidth.
max_iterationsintnoNumeric parameter for max_iterations.
convergence_tolfloatnoNumeric parameter for convergence_tol.
min_cluster_pointsintnoNumeric parameter for min_cluster_points.
mode_merge_distfloatnoNumeric parameter for mode_merge_dist.
threadsintnoNumeric parameter for threads.
simdboolnoBoolean option for simd.
output_id_modestringnoString parameter for output_id_mode.
output_sidecar_csvboolnoBoolean option for output_sidecar_csv.
seedintnoNumeric parameter for seed.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

individual_tree_detection

  • Identifies tree top points in a LiDAR cloud using local maxima detection.
  • Detects points that are the highest within a local search neighbourhood in XY, with optional height range constraints.
  • Search neighbourhood size can vary with height: min_search_radius applies at lower heights, max_search_radius at upper heights, with linear interpolation between.
  • Requires vegetation-only filtering by default (only_use_veg=True, vegetation classes 3, 4, 5); can be disabled if input is unclassified.
  • Outputs a vector shapefile of tree top points with attributes: FID (1-based point index) and Z (height value).
  • Use case: rapid treetop detection for forest inventory, DBH estimation, or canopy analysis; complements individual_tree_segmentation for cases where only crown centroids are needed.
  • Parameters:
    • min_search_radius (default 1.0): search neighbourhood radius at minimum height
    • max_search_radius (optional): neighbourhood size at upper heights; if not specified, uses min_search_radius (constant neighbourhood)
    • min_height (default 0.0): minimum height threshold (points below this are skipped)
    • max_height (optional): height value where max_search_radius applies (linear interpolation between min and max)
    • only_use_veg (default true): if true, process only vegetation classes 3, 4, 5; if false, use all non-withheld, non-noise points

Outputs

  • return: Vector

WbEnvironment usage

result = wbe.lidar.analysis_metrics.individual_tree_detection(
    input="value",
    min_search_radius=1.0,
    min_height=1.0,
    max_search_radius=1.0,
    max_height=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
min_search_radiusfloatnoNumeric parameter for min_search_radius.
min_heightfloatnoNumeric parameter for min_height.
max_search_radiusfloatnoNumeric parameter for max_search_radius.
max_heightfloatnoNumeric parameter for max_height.
only_use_vegboolnoBoolean option for only_use_veg.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_segmentation_based_filter

  • Performs neighbourhood-connected low-relief ground extraction using search_radius and max_z_diff.
  • classify_points=False outputs only extracted ground-like points.
  • classify_points=True retains all points and assigns class 2 (ground-like) or class 1 (other).

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.filtering_classification.lidar_segmentation_based_filter(
    input="value",
    search_radius=1.0,
    norm_diff_threshold=1.0,
    max_z_diff=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
search_radiusfloatnoNumeric parameter for search_radius.
norm_diff_thresholdfloatnoNumeric parameter for norm_diff_threshold.
max_z_difffloatnoNumeric parameter for max_z_diff.
classify_pointsboolnoBoolean option for classify_points.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lidar_colourize

  • Assigns point RGB values from an overlapping raster image sampled at each point XY location.
  • image can be provided as a raster object/path; out-of-image or nodata samples are assigned black.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.io_management.lidar_colourize(
    input="value",
    image,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidaryesInput LiDAR dataset for input.
imageRasteryesInput raster for image.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

colourize_based_on_class

  • Applies class-based colours for LAS classes 0-18, with optional per-class overrides via clr_str.
  • Supports optional intensity blending (intensity_blending_amount in percent).
  • use_unique_clrs_for_buildings=True assigns unique colours to connected building clusters (class=6) using search_radius.
  • Supports batch mode when input=None.

Outputs

  • return: Lidar

WbEnvironment usage

result = wbe.lidar.analysis_metrics.colourize_based_on_class(
    input="value",
    intensity_blending_amount=1.0,
    clr_str="value",
    search_radius=1.0,
    output_path="result.tif",
)

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
intensity_blending_amountfloatnoNumeric parameter for intensity_blending_amount.
clr_strstringnoString parameter for clr_str.
use_unique_clrs_for_buildingsboolnoBoolean option for use_unique_clrs_for_buildings.
search_radiusfloatnoNumeric parameter for search_radius.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

colourize_based_on_point_returns

  • Applies colours by return type: only, first, intermediate, and last returns.
  • Supports optional intensity blending (intensity_blending_amount in percent).
  • Supports batch mode when input=None.

Callback Payload Examples

All LiDAR interpolation methods emit JSON strings through callback using message/progress events.

Example message event:

{"type":"message","message":"reading input lidar"}

Example progress event:

{"type":"progress","percent":0.63}

Parameters

NameTypeRequiredDescription
inputLidarnoInput LiDAR dataset for input.
intensity_blending_amountfloatnoNumeric parameter for intensity_blending_amount.
only_ret_colourstringnoString parameter for only_ret_colour.
first_ret_colourstringnoString parameter for first_ret_colour.
intermediate_ret_colourstringnoString parameter for intermediate_ret_colour.
last_ret_colourstringnoString parameter for last_ret_colour.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

percent is normalized in [0, 1] and reaches 1.0 on completion.

Outputs

  • return: Lidar

Example:

import whitebox_workflows as wbw

wbe = wbw.WbEnvironment()
lidar = wbe.read_lidar("tile.laz")

dem = wbe.lidar_idw_interpolation(
	lidar,
	resolution=1.0,
	weight=2.0,
	returns_included="last",
	excluded_classes=[7, 18],
)

Notes

  • This document is intentionally planning-oriented for now.
  • As each tool is ported, add full parameter and examples sections in this file.

Stream Network Analysis

Stream Network Analysis Tools

This document provides comprehensive documentation for stream network analysis tools. For common raster I/O conventions, parameter formats, and usage patterns, see the main TOOLS.md reference.

Overview

Stream network analysis tools operate on digital elevation models (DEMs) to extract, analyze, and characterize stream networks. These tools use D8 (eight-directional) flow direction algorithms to trace flow paths and compute stream properties.

Key Concepts

  • D8 Pointer: A raster encoding the direction of steepest descent from each cell to one of its 8 neighbors. Required input for most tools.
  • Streams Raster: A binary or continuous raster where positive values mark stream cells; zero and NoData values mark non-stream cells.
  • Stream Order: A hierarchical classification system ranking stream segments based on tributaries and confluence patterns.
  • Stream Link: A continuous stream segment between junctions (confluences) or from a source to the first junction.

Tool Index

Stream Ordering Tools

Stream ordering systems classify streams hierarchically based on network structure. Each system makes different assumptions about what constitutes the "main stem" and how order changes at confluences.

Strahler Stream Order

Assigns stream order based on the algorithm: headwater links are order 1; when two links of equal order join, the downstream link is order+1; when links of different orders join, the downstream link takes the higher order.

Parameters:

  • d8_pntr (Raster): D8 flow direction pointer raster
  • streams (Raster): Stream network raster (positive values = streams)
  • esri_pntr (bool, optional): If true, use ESRI-style pointer values; otherwise use Whitebox style (default: false)
  • zero_background (bool, optional): If true, assign zero to non-stream cells; otherwise use NoData (default: false)
  • output (str, optional): Output raster path

Output: Raster with Strahler order values

References:

  • Strahler, A. N. (1957). Quantitative analysis of watershed geomorphology. EOS Transactions American Geophysical Union, 38(6), 913-920.

Horton Stream Order

Assigns stream order starting from Strahler order, then replaces all cells along the main trunk (longest path from outlet) with the outlet's order value. This emphasizes the main channel rather than tributary networks.

Parameters: Same as Strahler Stream Order

Output: Raster with Horton order values

References:

  • Horton, R. E. (1945). Erosional development of streams and their drainage basins. GSA Bulletin, 56(3), 275-370.

Hack Stream Order

Assigns order from the outlet upstream: the outlet (main stem) is order 1, tributaries to the main stem are order 2, and tributary order increases upstream. Unlike Strahler, order increases away from the outlet, which is useful when outlet location is certain but headwater extent is uncertain.

Parameters: Same as Strahler Stream Order

Output: Raster with Hack order values

References:

  • Hack, J. T. (1957). Studies of longitudinal stream profiles in Virginia and Maryland. USGS Professional Paper 294-B.

Topological Stream Order

Assigns order based on the count of upstream links (topological distance from the outlet). Each confluence increases order by one moving downstream.

Parameters: Same as Strahler Stream Order

Output: Raster with topological order values

Shreve Stream Magnitude

Calculates Shreve stream magnitude: the sum of magnitude values of upstream headwater cells (all headwaters count as magnitude 1). Magnitude increases when tributaries join—new magnitude = sum of upstream tributaries.

Parameters: Same as Strahler Stream Order

Output: Raster with Shreve magnitude values

References:

  • Shreve, R. L. (1966). Statistical law of stream numbers. Journal of Geology, 74(1), 17-37.

Assigns unique integer identifiers to each stream link (continuous segment between junctions or from headwater to first junction). Useful for extracting and analyzing individual segments.

Parameters:

  • d8_pntr (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • esri_pntr (bool, optional): ESRI-style pointer flag
  • zero_background (bool, optional): Zero background flag
  • output (str, optional): Output raster path

Output: Raster with unique link identifiers

Classifies each stream link by type:

  • 1: Exterior (headwater link with no upstream)
  • 2: Interior (link with 1+ upstream tributaries, drains to another link)
  • 3: Source (similar to exterior)
  • 4: Link (standard interior link)
  • 5: Sink (terminal outlet)

Parameters: Same as Stream Link Identifier

Output: Raster with classified link types

Calculates total length for each stream link. All cells in the same link have the same value (the complete link length).

Parameters)

  • d8_pntr (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • dem (Raster): Digital elevation model (for cell size/distance calculation)
  • esri_pntr (bool, optional): ESRI-style pointer flag
  • output (str, optional): Output raster path

Output: Raster with link lengths

Calculates average slope for each stream link. Slope is computed as vertical drop over horizontal distance along the stream.

Parameters:

  • d8_pntr (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • dem (Raster): Digital elevation model
  • esri_pntr (bool, optional): ESRI-style pointer flag
  • output (str, optional): Output raster path

Output: Raster with link slopes

Stream Slope Continuous

Calculates slope at each stream cell using neighbors along the flow direction. Provides cell-by-cell slope rather than constant per-link values.

Parameters: Same as Stream Link Slope

Output: Raster with per-cell slopes

Stream Network Extraction Tools

Extract Streams

Extracts stream network from flow accumulation raster using a user-defined threshold. Cells with flow accumulation >= threshold are marked as streams.

Parameters:

  • flow_accumulation (Raster): Flow accumulation raster (output from a flow accumulation tool)
  • threshold (float): Minimum flow accumulation value to designate as stream
  • output (str, optional): Output raster path

Output: Binary stream raster (1 = stream, 0 = non-stream)

Extract Valleys

Extracts valley networks (broader low-lying areas) from a DEM. Offers multiple algorithms:

  • Laplace/Quadratic: Curvature-based valley detection
  • Lindsay-Curvature: Custom curvature index
  • Peucker-Douglas: Tangential curvature method

Parameters:

  • dem (Raster): Digital elevation model
  • type (str): Valley detection method (default: "quadratic")
  • thin (bool, optional): Thin valley lines to single-cell width (default: false)
  • output (str, optional): Output raster path

Output: Valley network raster

Stream Network Distance and Upstream Analysis Tools

Distance to Outlet

Calculates downstream channel distance along the D8 network to the outlet for each stream cell.

Parameters:

  • d8_pntr (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • dem (Raster): Digital elevation model (for distance calculation)
  • esri_pntr (bool, optional): ESRI-style pointer flag
  • output (str, optional): Output raster path

Output: Raster with distance to outlet (in horizontal distance units)

Length of Upstream Channels

Calculates total upstream channel length for each stream cell. Useful for identifying headwater areas and stream densities.

Parameters:

  • d8_pntr (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • dem (Raster): Digital elevation model
  • esri_pntr (bool, optional): ESRI-style pointer flag
  • output (str, optional): Output raster path

Output: Raster with upstream channel lengths

Farthest Channel Head

Calculates upstream distance to the most distant channel head for each stream cell.

Parameters: Same as Length of Upstream Channels

Output: Raster with distance to farthest upstream head

Stream Main Stem and Tributary Tools

Find Main Stem

Identifies cells belonging to the main channel (longest stream path from outlet). Outputs a binary mask.

Parameters:

  • d8_pntr (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • esri_pntr (bool, optional): ESRI-style pointer flag
  • output (str, optional): Output raster path

Output: Boolean raster (1 = main stem, 0 = tributary)

Tributary Identifier

Assigns unique identifier to each tributary system. Useful for analyzing tributary properties.

Parameters: Same as Find Main Stem

Output: Raster with tributary identifiers

Remove Short Streams

Prunes stream links shorter than a minimum length threshold. Useful for cleaning noisy stream networks.

Parameters:

  • d8_pntr (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • dem (Raster): Digital elevation model
  • min_length (float): Minimum link length to retain (in map units)
  • esri_pntr (bool, optional): ESRI-style pointer flag
  • output (str, optional): Output raster path

Output: Pruned stream raster with short links removed

Stream Network Conversion Tools

Raster Streams to Vector

Converts a raster stream network to a vector line layer. Each stream link becomes a PolyLine feature with attributes showing stream value and link length.

Parameters:

  • streams (Raster): Stream network raster
  • d8_pointer (Raster): D8 flow direction pointer
  • esri_pointer (bool, optional): ESRI-style pointer flag
  • all_vertices (bool, optional): Include all vertices or only direction changes (default: false)

Output: Vector layer with stream PolyLines

Rasterize Streams

Converts a vector stream line layer to a raster grid.

Parameters:

  • input_vector (Vector): Input stream network vector layer
  • reference_raster (Raster): Reference raster for grid specification
  • field (str, optional): Attribute field for output values (default: stream ID)
  • output (str, optional): Output raster path

Output: Raster stream network

Repair Stream Vector Topology

Repairs broken topology in vector stream networks, including:

  • Snapping nearly-overlapping endpoints
  • Splitting lines at intersections
  • Removing duplicate segments
  • Removing invalid geometries

Parameters:

  • input_vector (Vector): Input stream vector layer
  • snap_distance (float): Maximum distance for snapping endpoints (default: 1 cell size)
  • output (str, optional): Output vector path

Output: Repaired vector stream layer

Long Profile Tools

Long profiles are plots of elevation against downstream distance. Useful for analyzing stream gradient and identifying bedrock steps.

Long Profile

Creates an interactive SVG line graph showing elevation against distance to outlet for the entire stream network. Outputs an HTML document with embedded SVG.

Parameters:

  • d8_pointer (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • dem (Raster): Digital elevation model
  • output_html_file (str): Output HTML file path
  • esri_pointer (bool, optional): ESRI-style pointer flag

Output: Interactive HTML document with longitudinal profile

Long Profile from Points

Creates long profiles for sample points along stream network. Useful for extracting profiles at specific locations.

Parameters:

  • points_vector (Vector): Vector points at profile sample locations
  • d8_pointer (Raster): D8 flow direction pointer
  • streams_raster (Raster): Stream network raster
  • dem (Raster): Digital elevation model
  • output_folder (str): Output folder for HTML files
  • esri_pointer (bool, optional): ESRI-style pointer flag

Output: Set of HTML profile documents (one per input point)

Comprehensive Stream Analysis Tools

Vector Stream Network Analysis

Performs comprehensive analysis on a vector stream network, generating multiple output layers:

  • Stream links with order, magnitude, length, and slope
  • Stream thalwegs (centerlines)
  • Drainage basins (catchments)
  • Stream confluences (junctions)

Parameters:

  • input_vector (Vector): Input stream network
  • dem (Raster, optional): Digital elevation model for slope/aspect analysis
  • output_folder (str): Output folder for generated layers

Output: Multiple vector layers with comprehensive stream attributes

Professional Tools (Pro License Required)

Prune Vector Streams

Advanced vector stream pruning based on Shreve magnitude and stream type criteria. Allows selective removal of minor tributaries while preserving main stem structure.

Parameters:

  • input (Vector): Input stream network
  • magnitude_threshold (float): Minimum Shreve magnitude to retain (default: 2)
  • output (str, optional): Output vector path

Output: Pruned stream network

River Centerlines

Extracts river centerlines from a binary water mask raster using medial axis transformation. Useful for generating channel centerlines from satellite or aerial imagery.

Parameters:

  • water_raster (Raster): Binary water/non-water raster
  • output (str, optional): Output vector centerline path

Output: Vector centerline PolyLines

Usage Notes

D8 Pointer Conventions

Stream network tools accept both Whitebox and ESRI D8 pointer conventions. Whitebox convention:

  • 1 = E, 2 = NE, 4 = N, 8 = NW, 16 = W, 32 = SW, 64 = S, 128 = SE

ESRI convention:

  • 1 = E, 2 = SE, 4 = S, 8 = SW, 16 = W, 32 = NW, 64 = N, 128 = NE

Set esri_pntr=True when using ESRI-convention pointers.

DEM Preparation

Before extracting streams, DEMs should be preprocessed to remove topographic depressions and flat areas. Tools are typically:

  1. fill_depressions or breach_depressions_least_cost (from geomorphometry tools)
  2. d8_pointer (compute D8 flow directions on depressionless DEM)
  3. flow_accumulation (compute d8 flow accumulation)

Typical Workflow

# Example workflow (pseudocode)
dem_filled = fill_depressions(dem)
d8_ptr = d8_pointer(dem_filled)
flow_accum = flow_accumulation(d8_ptr)
streams = extract_streams(flow_accum, threshold=100)
strahler_order = strahler_stream_order(d8_ptr, streams)
streams_vector = raster_streams_to_vector(streams, d8_ptr)

See Also

Data Tools

Data Tools

This document covers the first batch of data and format conversion tools ported into the new backend.

Tool Index

  • add_point_coordinates_to_table
  • clean_vector
  • convert_nodata_to_zero
  • csv_points_to_vector
  • export_table_to_csv
  • fix_dangling_arcs
  • join_tables
  • lines_to_polygons
  • merge_table_with_csv
  • merge_vectors
  • modify_nodata_value
  • multipart_to_singlepart
  • new_raster_from_base_raster
  • new_raster_from_base_vector
  • polygons_to_lines
  • print_geotiff_tags
  • raster_to_vector_lines
  • raster_to_vector_polygons
  • raster_to_vector_points
  • reinitialize_attribute_table
  • remove_polygon_holes
  • remove_raster_polygon_holes
  • set_nodata_value
  • singlepart_to_multipart
  • vector_lines_to_raster
  • vector_polygons_to_raster
  • vector_points_to_raster

add_point_coordinates_to_table

Copies a point layer and appends XCOORD and YCOORD fields using each feature's point coordinates.

Outputs

  • return: Vector

WbEnvironment usage

points_with_xy = wbe.conversion.vector_table_io.add_point_coordinates_to_table(points, output_path="points_with_xy.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

clean_vector

Removes null and invalid geometries from a vector layer. For line and polygon data, undersized parts are removed and fully invalid features are dropped.

Outputs

  • return: Vector

WbEnvironment usage

cleaned = wbe.conversion.vector_table_io.clean_vector(input_vector, output_path="cleaned.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

convert_nodata_to_zero

Replaces nodata cells in a raster with 0 while leaving all valid cells unchanged.

Outputs

  • return: Raster

WbEnvironment usage

result = wbe.conversion.raster_vector_conversion.convert_nodata_to_zero(input_raster, output_path="zeroed.tif")

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

csv_points_to_vector

Imports point features from a CSV text table using selected X and Y field indices.

Outputs

  • return: Vector

WbEnvironment usage

points = wbe.conversion.vector_table_io.csv_points_to_vector(
	input_file="samples.csv",
	x_field_num=2,
	y_field_num=3,
	epsg=4326,
	output_path="samples_points.geojson",
)

Parameters

NameTypeRequiredDescription
input_filestringyesString parameter for input_file.
x_field_numintnoNumeric parameter for x_field_num.
y_field_numintnoNumeric parameter for y_field_num.
epsgint |NonenoNumeric parameter for epsg.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

export_table_to_csv

Exports a vector layer's attribute table to CSV format.

Outputs

  • return: str

WbEnvironment usage

csv_path = wbe.conversion.vector_table_io.export_table_to_csv(parcels, output_csv_file="parcels_table.csv", headers=True)

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
output_csv_filestring |NonenoString parameter for output_csv_file.
headersboolnoBoolean option for headers.
callbackfunctionnoOptional progress callback receiving JSON events.

fix_dangling_arcs

Fixes undershot and overshot dangling arcs in a line network by snapping line endpoints that fall within a distance threshold.

Outputs

  • return: Vector

WbEnvironment usage

fixed_lines = wbe.conversion.geometry_topology.fix_dangling_arcs(lines, snap_dist=5.0, output_path="lines_fixed.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
snap_distfloatyesNumeric parameter for snap_dist.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

new_raster_from_base_raster

Creates a new raster with the same rows, columns, extent, cell size, and CRS as a base raster.

Outputs

  • return: Raster

WbEnvironment usage

blank = wbe.conversion.raster_vector_conversion.new_raster_from_base_raster(base_raster, out_val=0.0, data_type="float", output_path="blank.tif")

Parameters:

  • base: Base raster.
  • out_val: Optional fill value. Defaults to the base raster nodata value.
  • data_type: One of float, double, or integer.
  • output_path: Optional output path.

Parameters

NameTypeRequiredDescription
baseRasteryesInput raster for base.
out_valfloat |NonenoNumeric parameter for out_val.
data_typestringnoString parameter for data_type.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

new_raster_from_base_vector

Creates a new raster using the extent and CRS from a base vector layer and a required cell_size.

Outputs

  • return: Raster

WbEnvironment usage

blank = wbe.conversion.raster_vector_conversion.new_raster_from_base_vector(
	base=study_area,
	cell_size=10.0,
	out_val=0.0,
	data_type="float",
	output_path="blank_from_vector.tif",
)

Parameters:

  • base: Base vector defining extent.
  • cell_size: Output cell size (> 0).
  • out_val: Optional fill value. Defaults to nodata (-32768).
  • data_type: One of float, double, or integer.
  • output_path: Optional output path.

Parameters

NameTypeRequiredDescription
baseVectoryesInput vector layer for base.
cell_sizefloatyesNumeric parameter for cell_size.
out_valfloat |NonenoNumeric parameter for out_val.
data_typeLiteral["integer", "float", "double"]noNumeric parameter for data_type.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

polygons_to_lines

Converts polygon or multipolygon features into boundary linework.

Outputs

  • return: Vector

WbEnvironment usage

lines = wbe.conversion.geometry_topology.polygons_to_lines(polygons, output_path="boundaries.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

lines_to_polygons

Converts polyline features into polygon features. The first part of a multipart line becomes the exterior ring and later parts become holes.

Outputs

  • return: Vector

WbEnvironment usage

polygons = wbe.conversion.geometry_topology.lines_to_polygons(lines, output_path="polygons.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

join_tables

Joins attributes from one vector table onto another by matching key fields.

Outputs

  • return: Vector

WbEnvironment usage

joined = wbe.conversion.vector_table_io.join_tables(
	primary_vector=countries,
	primary_key_field="COUNTRY",
	foreign_vector=stats,
	foreign_key_field="COUNTRY",
	import_field="POPULATION",
	output_path="countries_joined.gpkg",
)

Parameters

NameTypeRequiredDescription
primary_vectorVectoryesInput vector layer for primary_vector.
primary_key_fieldstringyesString parameter for primary_key_field.
foreign_vectorVectoryesInput vector layer for foreign_vector.
foreign_key_fieldstringyesString parameter for foreign_key_field.
import_fieldstring |NonenoString parameter for import_field.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

merge_table_with_csv

Merges attributes from a CSV table into a vector attribute table using key fields.

Outputs

  • return: Vector

WbEnvironment usage

merged = wbe.conversion.vector_table_io.merge_table_with_csv(
	primary_vector=countries,
	primary_key_field="COUNTRY",
	foreign_csv_filename="country_stats.csv",
	foreign_key_field="COUNTRY",
	import_field="GDP",
	output_path="countries_merged.gpkg",
)

Parameters

NameTypeRequiredDescription
primary_vectorVectoryesInput vector layer for primary_vector.
primary_key_fieldstringyesString parameter for primary_key_field.
foreign_csv_filenamestringyesString parameter for foreign_csv_filename.
foreign_key_fieldstringyesString parameter for foreign_key_field.
import_fieldstring |NonenoString parameter for import_field.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

modify_nodata_value

Changes the raster nodata value and rewrites any existing nodata cells to the new value.

Outputs

  • return: Raster

WbEnvironment usage

updated = wbe.conversion.raster_vector_conversion.modify_nodata_value(input_raster, new_value=-9999.0, output_path="nodata_modified.tif")

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
new_valuefloatnoNumeric parameter for new_value.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

Builds a text report describing TIFF/GeoTIFF tags and key metadata. If the input is not a TIFF-family raster, the tool returns a warning message instead of a hard failure.

Outputs

  • return: str

WbEnvironment usage

report = wbe.raster.print_geotiff_tags(input_raster)

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
callbackfunctionnoOptional progress callback receiving JSON events.

raster_to_vector_points

Converts each non-zero, non-nodata cell in a single-band raster into a point feature located at the cell centre, with FID and VALUE attributes.

Outputs

  • return: Vector

WbEnvironment usage

points = wbe.conversion.raster_vector_conversion.raster_to_vector_points(classified_raster, output_path="classified_points.geojson")

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

raster_to_vector_lines

Converts non-zero, non-nodata cells in a single-band raster to polyline features. Output attributes include FID and the raster VALUE represented by each traced line.

Outputs

  • return: Vector

WbEnvironment usage

lines = wbe.conversion.raster_vector_conversion.raster_to_vector_lines(line_raster, output_path="line_features.geojson")

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

raster_to_vector_polygons

Converts contiguous non-zero, non-nodata raster regions into polygon vector features. Output attributes include FID and source raster VALUE for each polygonized region.

Outputs

  • return: Vector

WbEnvironment usage

polys = wbe.conversion.raster_vector_conversion.raster_to_vector_polygons(classified_raster, output_path="regions.geojson")

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

reinitialize_attribute_table

Creates a copy of a vector layer whose attribute table contains only a regenerated FID field.

Outputs

  • return: Vector

WbEnvironment usage

fid_only = wbe.conversion.vector_table_io.reinitialize_attribute_table(input_vector, output_path="fid_only.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

remove_polygon_holes

Removes all interior rings from polygon and multipolygon features while preserving attributes.

Outputs

  • return: Vector

WbEnvironment usage

solid_polygons = wbe.conversion.geometry_topology.remove_polygon_holes(polygons, output_path="polygons_no_holes.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

remove_raster_polygon_holes

Removes enclosed background holes from raster polygons, where background is defined as 0 or nodata. Holes connected to raster edges are preserved. Optionally limits removals to holes below a threshold_size and can use 8-neighbour connectedness with use_diagonals=True.

Outputs

  • return: Raster

WbEnvironment usage

filled = wbe.conversion.raster_vector_conversion.remove_raster_polygon_holes(
	input=classified,
	threshold_size=500,
	use_diagonals=True,
	output_path="classified_no_holes.tif",
)

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
threshold_sizeint |NonenoNumeric parameter for threshold_size.
use_diagonalsboolnoBoolean option for use_diagonals.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

set_nodata_value

Sets a new nodata background value for a raster and maps existing nodata cells to that value. If a negative value is used with an unsigned input, the output raster type is promoted to a compatible signed integer type.

Outputs

  • return: Raster

WbEnvironment usage

updated = wbe.conversion.raster_vector_conversion.set_nodata_value(input_raster, back_value=-9999.0, output_path="nodata_set.tif")

Parameters

NameTypeRequiredDescription
inputRasteryesInput raster for input.
back_valuefloatnoNumeric parameter for back_value.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

merge_vectors

Combines two or more input vectors of the same geometry type into a single output vector. The output attribute table contains FID, PARENT (source layer filename stem), PARENT_FID, and any attribute fields that are common to all input layers (same name and field type).

Outputs

  • return: Vector

WbEnvironment usage

merged = wbe.conversion.vector_table_io.merge_vectors([roads_a, roads_b, roads_c], output_path="roads_merged.geojson")

Parameters

NameTypeRequiredDescription
inputsVectoryesInput vector layer for inputs.
output_pathstringyesOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

multipart_to_singlepart

Splits multi-part features (MultiPoint, MultiLineString, MultiPolygon) into individual single-part features. Each sub-geometry becomes a new output feature inheriting the source feature's attributes. For polygon inputs, setting exclude_holes=True keeps interior rings attached to their enclosing exterior ring rather than splitting them into independent features.

Outputs

  • return: Vector

WbEnvironment usage

# Split all parts (holes become independent polygons)
single = wbe.conversion.geometry_topology.multipart_to_singlepart(parcels, output_path="parcels_single.geojson")

# Keep holes attached to their enclosing polygon
single = wbe.conversion.geometry_topology.multipart_to_singlepart(parcels, exclude_holes=True, output_path="parcels_single.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
exclude_holesboolnoBoolean option for exclude_holes.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

singlepart_to_multipart

Merges single-part features into multi-part features. When field is provided, features sharing the same value for that field are grouped into one multi-part geometry. When field is omitted, all features in the layer are merged into a single geometry. Output geometry type is promoted to the corresponding multi-part type (Point → MultiPoint; LineString → MultiLineString; Polygon → MultiPolygon).

Outputs

  • return: Vector

WbEnvironment usage

# Group parcels belonging to the same owner
multi = wbe.conversion.geometry_topology.singlepart_to_multipart(parcels, field="OWNER_ID", output_path="parcels_multi.geojson")

# Merge all features into one geometry
multi = wbe.conversion.geometry_topology.singlepart_to_multipart(parcels, output_path="all_merged.geojson")

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
fieldstring |NonenoString parameter for field.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

vector_points_to_raster

Rasterizes point or multipoint vectors to a grid using a selected assignment operation (last, first, min, max, sum, num, mean). Grid definition can come from a base_raster or from cell_size plus vector extent.

Outputs

  • return: Raster

WbEnvironment usage

# Use a base raster grid and compute per-cell mean
out = wbe.conversion.raster_vector_conversion.vector_points_to_raster(
	input=points,
	field_name="VALUE",
	assign_op="mean",
	base_raster=base,
	output_path="points_mean.tif",
)

# Build output grid from point extent and cell size
out2 = wbe.conversion.raster_vector_conversion.vector_points_to_raster(
	input=points,
	field_name="VALUE",
	assign_op="max",
	cell_size=5.0,
	zero_background=True,
	output_path="points_max.tif",
)

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
field_namestring |NonenoString parameter for field_name.
assign_opstringnoString parameter for assign_op.
zero_backgroundboolnoBoolean option for zero_background.
cell_sizefloatnoNumeric parameter for cell_size.
base_rasterRasternoInput raster for base_raster.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

vector_lines_to_raster

Rasterizes line or polygon-boundary geometries to a raster grid. Burn values come from an optional numeric field_name or from feature IDs when no field is supplied. Grid geometry can be inherited from a base_raster or created from input extent and cell_size.

Outputs

  • return: Raster

WbEnvironment usage

# Burn road class values onto an existing base raster grid
roads_r = wbe.conversion.raster_vector_conversion.vector_lines_to_raster(
	input=roads,
	field_name="CLASS_ID",
	base_raster=base,
	output_path="roads_burned.tif",
)

# Build output grid from vector extent
lines_r = wbe.conversion.raster_vector_conversion.vector_lines_to_raster(
	input=lines,
	cell_size=10.0,
	zero_background=True,
	output_path="lines_extent_grid.tif",
)

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
field_namestring |NonenoString parameter for field_name.
zero_backgroundboolnoBoolean option for zero_background.
cell_sizefloatnoNumeric parameter for cell_size.
base_rasterRasternoInput raster for base_raster.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

vector_polygons_to_raster

Rasterizes polygon features using an optional numeric attribute field; otherwise burns feature IDs.

Outputs

  • return: Raster

WbEnvironment usage

poly_raster = wbe.conversion.raster_vector_conversion.vector_polygons_to_raster(
	input=landcover_polys,
	field_name="CLASS_ID",
	zero_background=True,
	base_raster=base,
	output_path="landcover.tif",
)

Parameters

NameTypeRequiredDescription
inputVectoryesInput vector layer for input.
field_namestring |NonenoString parameter for field_name.
zero_backgroundboolnoBoolean option for zero_background.
cell_sizefloatnoNumeric parameter for cell_size.
base_rasterRasternoInput raster for base_raster.
outputstringnoOptional output path. If omitted, the result is returned in memory when supported.
callbackfunctionnoOptional progress callback receiving JSON events.

Tool Call Paths (Python)

This chapter maps each tool identifier to the preferred call path on WbEnvironment and summarizes outputs.

Call pattern:

  • General-subcategory tools: wbe.category.tool_id(...)
  • Other tools: wbe.category.subcategory.tool_id(...)
  • Generic execution: wbe.run_tool("tool_id", args)

Total tools: 747

Tool IDCategorySubcategoryPreferred CallReturn TypeOutput Summary
absrastergeneralwbe.raster.abs(...)RasterRaster output
accumulation_curvatureterrainderivativeswbe.terrain.derivatives.accumulation_curvature(...)RasterRaster output
adaptive_filterremote_sensingfilterswbe.remote_sensing.filters.adaptive_filter(...)RasterRaster output
addrasteroverlay_mathwbe.raster.overlay_math.add(...)RasterRaster output
add_fieldvectorattribute_analysiswbe.vector.attribute_analysis.add_field(...)VectorVector output
add_geometry_attributesvectorattribute_analysiswbe.vector.attribute_analysis.add_geometry_attributes(...)VectorVector output
add_point_coordinates_to_tableconversionvector_table_iowbe.conversion.vector_table_io.add_point_coordinates_to_table(...)VectorVector output
aggregate_rasterrastergeneralwbe.raster.aggregate_raster(...)RasterRaster output
anisotropic_diffusion_filterremote_sensingfilterswbe.remote_sensing.filters.anisotropic_diffusion_filter(...)RasterRaster output
anovarastergeneralwbe.raster.anova(...)strReport/path string output
arccosrastergeneralwbe.raster.arccos(...)RasterRaster output
arcoshrastergeneralwbe.raster.arcosh(...)RasterRaster output
arcsinrastergeneralwbe.raster.arcsin(...)RasterRaster output
arctanrastergeneralwbe.raster.arctan(...)RasterRaster output
arsinhrastergeneralwbe.raster.arsinh(...)RasterRaster output
artanhrastergeneralwbe.raster.artanh(...)RasterRaster output
ascii_to_laslidario_managementwbe.lidar.io_management.ascii_to_las(...)LidarLiDAR output
aspectterrainderivativeswbe.terrain.derivatives.aspect(...)RasterRaster output
assess_routeterraingeneralwbe.terrain.assess_route(...)VectorVector output
assign_projection_lidarprojection_georeferencinggeneralwbe.projection_georeferencing.assign_projection_lidar(...)AnySee tool docs
assign_projection_rasterprojection_georeferencinggeneralwbe.projection_georeferencing.assign_projection_raster(...)AnySee tool docs
assign_projection_vectorprojection_georeferencinggeneralwbe.projection_georeferencing.assign_projection_vector(...)AnySee tool docs
atan2rastergeneralwbe.raster.atan2(...)RasterRaster output
attribute_correlationvectorattribute_analysiswbe.vector.attribute_analysis.attribute_correlation(...)strReport/path string output
attribute_histogramvectorattribute_analysiswbe.vector.attribute_analysis.attribute_histogram(...)strReport/path string output
attribute_scattergramvectorattribute_analysiswbe.vector.attribute_analysis.attribute_scattergram(...)strReport/path string output
average_flowpath_slopehydrologyflow_routingwbe.hydrology.flow_routing.average_flowpath_slope(...)RasterRaster output
average_horizon_distanceterrainvisibilitywbe.terrain.visibility.average_horizon_distance(...)RasterRaster output
average_normal_vector_angular_deviationterrainroughness_texturewbe.terrain.roughness_texture.average_normal_vector_angular_deviation(...)RasterRaster output
average_overlayrasteroverlay_mathwbe.raster.overlay_math.average_overlay(...)RasterRaster output
average_upslope_flowpath_lengthhydrologyflow_routingwbe.hydrology.flow_routing.average_upslope_flowpath_length(...)RasterRaster output
balance_contrast_enhancementremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.balance_contrast_enhancement(...)RasterRaster output
basinshydrologywatersheds_basinswbe.hydrology.watersheds_basins.basins(...)RasterRaster output
bilateral_filterremote_sensingfilterswbe.remote_sensing.filters.bilateral_filter(...)RasterRaster output
block_maximumrastergeneralwbe.raster.block_maximum(...)RasterRaster output
block_minimumrastergeneralwbe.raster.block_minimum(...)RasterRaster output
bool_andrasteroverlay_mathwbe.raster.overlay_math.bool_and(...)RasterRaster output
bool_notrasteroverlay_mathwbe.raster.overlay_math.bool_not(...)RasterRaster output
bool_orrasteroverlay_mathwbe.raster.overlay_math.bool_or(...)RasterRaster output
bool_xorrasteroverlay_mathwbe.raster.overlay_math.bool_xor(...)RasterRaster output
boundary_shape_complexityrastergeneralwbe.raster.boundary_shape_complexity(...)RasterRaster output
brdf_normalizationremote_sensingradiometric_correctionwbe.remote_sensing.radiometric_correction.brdf_normalization(...)AnySee tool docs
brdf_surface_reflectance_consistencyremote_sensingradiometric_correctionwbe.remote_sensing.radiometric_correction.brdf_surface_reflectance_consistency(...)tuple[Raster, Raster, Raster, str]Multiple outputs (tuple)
breach_depressions_least_costhydrologydepressions_storagewbe.hydrology.depressions_storage.breach_depressions_least_cost(...)RasterRaster output
breach_single_cell_pitshydrologydepressions_storagewbe.hydrology.depressions_storage.breach_single_cell_pits(...)RasterRaster output
breakline_mappingterraingeneralwbe.terrain.breakline_mapping(...)VectorVector output
buffer_rasterrasterdistance_costwbe.raster.distance_cost.buffer_raster(...)RasterRaster output
build_network_topologyvectornetwork_analysiswbe.vector.network_analysis.build_network_topology(...)AnySee tool docs
build_object_hierarchy_multiscaleremote_sensingobiawbe.remote_sensing.obia.build_object_hierarchy_multiscale(...)strReport/path string output
burn_streamshydrologydepressions_storagewbe.hydrology.depressions_storage.burn_streams(...)RasterRaster output
burn_streams_at_roadshydrologydepressions_storagewbe.hydrology.depressions_storage.burn_streams_at_roads(...)RasterRaster output
canny_edge_detectionremote_sensingedge_feature_detectionwbe.remote_sensing.edge_feature_detection.canny_edge_detection(...)RasterRaster output
carbon_sequestration_verification_auditterrainworkflow_productswbe.terrain.workflow_products.carbon_sequestration_verification_audit(...)AnySee tool docs
casorati_curvatureterrainderivativeswbe.terrain.derivatives.casorati_curvature(...)RasterRaster output
ceilrastergeneralwbe.raster.ceil(...)RasterRaster output
centroid_rasterrastergeneralwbe.raster.centroid_raster(...)tuple[Raster, str]Multiple outputs (tuple)
centroid_vectorvectorgeometry_processingwbe.vector.geometry_processing.centroid_vector(...)VectorVector output
change_vector_analysisremote_sensingchange_detectionwbe.remote_sensing.change_detection.change_vector_analysis(...)tuple[Raster, Raster]Multiple outputs (tuple)
circular_variance_of_aspectterrainroughness_texturewbe.terrain.roughness_texture.circular_variance_of_aspect(...)RasterRaster output
classify_buildings_in_lidarlidarfiltering_classificationwbe.lidar.filtering_classification.classify_buildings_in_lidar(...)LidarLiDAR output
classify_lidarlidarfiltering_classificationwbe.lidar.filtering_classification.classify_lidar(...)LidarLiDAR output
classify_objects_ensemble_proremote_sensingobiawbe.remote_sensing.obia.classify_objects_ensemble_pro(...)strReport/path string output
classify_objects_random_forestremote_sensingobiawbe.remote_sensing.obia.classify_objects_random_forest(...)strReport/path string output
classify_objects_rules_basicremote_sensingobiawbe.remote_sensing.obia.classify_objects_rules_basic(...)strReport/path string output
classify_objects_rules_hierarchicalremote_sensingobiawbe.remote_sensing.obia.classify_objects_rules_hierarchical(...)strReport/path string output
classify_objects_svmremote_sensingobiawbe.remote_sensing.obia.classify_objects_svm(...)strReport/path string output
classify_overlap_pointslidarfiltering_classificationwbe.lidar.filtering_classification.classify_overlap_points(...)LidarLiDAR output
clean_vectorconversionvector_table_iowbe.conversion.vector_table_io.clean_vector(...)VectorVector output
clipvectoroverlay_analysiswbe.vector.overlay_analysis.clip(...)VectorVector output
clip_lidar_to_polygonlidarfiltering_classificationwbe.lidar.filtering_classification.clip_lidar_to_polygon(...)LidarLiDAR output
clip_raster_to_polygonrastergeneralwbe.raster.clip_raster_to_polygon(...)RasterRaster output
closest_facility_networkvectornetwork_analysiswbe.vector.network_analysis.closest_facility_network(...)VectorVector output
closingremote_sensingfilterswbe.remote_sensing.filters.closing(...)RasterRaster output
cloude_pottier_decompositionremote_sensingsarwbe.remote_sensing.sar.cloude_pottier_decomposition(...)AnySee tool docs
clumprastergeneralwbe.raster.clump(...)RasterRaster output
colourize_based_on_classlidaranalysis_metricswbe.lidar.analysis_metrics.colourize_based_on_class(...)LidarLiDAR output
colourize_based_on_point_returnslidaranalysis_metricswbe.lidar.analysis_metrics.colourize_based_on_point_returns(...)LidarLiDAR output
compactness_ratiovectorshape_metricswbe.vector.shape_metrics.compactness_ratio(...)VectorVector output
concave_hullvectorgeometry_processingwbe.vector.geometry_processing.concave_hull(...)VectorVector output
conditional_evaluationrasterreclass_maskwbe.raster.reclass_mask.conditional_evaluation(...)RasterRaster output
conservative_smoothing_filterremote_sensingfilterswbe.remote_sensing.filters.conservative_smoothing_filter(...)RasterRaster output
construct_vector_tinvectorsampling_griddingwbe.vector.sampling_gridding.construct_vector_tin(...)VectorVector output
continuum_removalremote_sensingspectral_analyticswbe.remote_sensing.spectral_analytics.continuum_removal(...)AnySee tool docs
contours_from_pointsvectorsampling_griddingwbe.vector.sampling_gridding.contours_from_points(...)VectorVector output
contours_from_rastervectorsampling_griddingwbe.vector.sampling_gridding.contours_from_raster(...)VectorVector output
convergence_indexterraingeneralwbe.terrain.convergence_index(...)RasterRaster output
convert_nodata_to_zeroconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.convert_nodata_to_zero(...)RasterRaster output
corner_detectionremote_sensingedge_feature_detectionwbe.remote_sensing.edge_feature_detection.corner_detection(...)RasterRaster output
correct_vignettingremote_sensingradiometric_correctionwbe.remote_sensing.radiometric_correction.correct_vignetting(...)RasterRaster output
corridor_mapping_intelligenceterrainworkflow_productswbe.terrain.workflow_products.corridor_mapping_intelligence(...)AnySee tool docs
cosrastergeneralwbe.raster.cos(...)RasterRaster output
coshrastergeneralwbe.raster.cosh(...)RasterRaster output
cost_allocationrasterdistance_costwbe.raster.distance_cost.cost_allocation(...)RasterRaster output
cost_distancerasterdistance_costwbe.raster.distance_cost.cost_distance(...)tuple[Raster, Raster]Multiple outputs (tuple)
cost_pathwayrasterdistance_costwbe.raster.distance_cost.cost_pathway(...)RasterRaster output
count_ifrasteroverlay_mathwbe.raster.overlay_math.count_if(...)RasterRaster output
create_colour_compositeremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.create_colour_composite(...)RasterRaster output
create_planerastergeneralwbe.raster.create_plane(...)RasterRaster output
crispness_indexrastergeneralwbe.raster.crispness_index(...)strReport/path string output
cross_tabulationrastergeneralwbe.raster.cross_tabulation(...)strReport/path string output
csv_points_to_vectorconversionvector_table_iowbe.conversion.vector_table_io.csv_points_to_vector(...)VectorVector output
cumulative_distributionrastergeneralwbe.raster.cumulative_distribution(...)RasterRaster output
curvednessterrainderivativeswbe.terrain.derivatives.curvedness(...)RasterRaster output
d8_flow_accumhydrologyflow_routingwbe.hydrology.flow_routing.d8_flow_accum(...)RasterRaster output
d8_mass_fluxhydrologyflow_routingwbe.hydrology.flow_routing.d8_mass_flux(...)RasterRaster output
d8_pointerhydrologyflow_routingwbe.hydrology.flow_routing.d8_pointer(...)RasterRaster output
dark_object_subtractionremote_sensingradiometric_correctionwbe.remote_sensing.radiometric_correction.dark_object_subtraction(...)AnySee tool docs
dbscanrastergeneralwbe.raster.dbscan(...)tuple[Raster, str]Multiple outputs (tuple)
decrementrastergeneralwbe.raster.decrement(...)RasterRaster output
delete_fieldvectorattribute_analysiswbe.vector.attribute_analysis.delete_field(...)VectorVector output
dem_void_fillingterraingeneralwbe.terrain.dem_void_filling(...)RasterRaster output
densify_featuresvectorgeometry_processingwbe.vector.geometry_processing.densify_features(...)VectorVector output
depth_in_sinkhydrologydepressions_storagewbe.hydrology.depressions_storage.depth_in_sink(...)RasterRaster output
depth_to_waterhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.depth_to_water(...)RasterRaster output
deviation_from_mean_elevationterraingeneralwbe.terrain.deviation_from_mean_elevation(...)RasterRaster output
deviation_from_regional_directionvectorshape_metricswbe.vector.shape_metrics.deviation_from_regional_direction(...)VectorVector output
diff_of_gaussians_filterremote_sensingfilterswbe.remote_sensing.filters.diff_of_gaussians_filter(...)RasterRaster output
differencevectoroverlay_analysiswbe.vector.overlay_analysis.difference(...)VectorVector output
difference_curvatureterrainderivativeswbe.terrain.derivatives.difference_curvature(...)RasterRaster output
difference_from_mean_elevationterraingeneralwbe.terrain.difference_from_mean_elevation(...)RasterRaster output
dinf_flow_accumhydrologyflow_routingwbe.hydrology.flow_routing.dinf_flow_accum(...)RasterRaster output
dinf_mass_fluxhydrologyflow_routingwbe.hydrology.flow_routing.dinf_mass_flux(...)RasterRaster output
dinf_pointerhydrologyflow_routingwbe.hydrology.flow_routing.dinf_pointer(...)RasterRaster output
direct_decorrelation_stretchremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.direct_decorrelation_stretch(...)RasterRaster output
directional_reliefterraingeneralwbe.terrain.directional_relief(...)RasterRaster output
dissolvevectoroverlay_analysiswbe.vector.overlay_analysis.dissolve(...)VectorVector output
distance_to_outlethydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.distance_to_outlet(...)RasterRaster output
diversity_filterremote_sensingfilterswbe.remote_sensing.filters.diversity_filter(...)RasterRaster output
dividerasteroverlay_mathwbe.raster.overlay_math.divide(...)RasterRaster output
dn_to_toa_reflectanceremote_sensingradiometric_correctionwbe.remote_sensing.radiometric_correction.dn_to_toa_reflectance(...)AnySee tool docs
download_osm_vectorvectoronline_datawbe.vector.online_data.download_osm_vector(...)AnySee tool docs
downslope_distance_to_streamhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.downslope_distance_to_stream(...)RasterRaster output
downslope_flowpath_lengthhydrologyflow_routingwbe.hydrology.flow_routing.downslope_flowpath_length(...)RasterRaster output
downslope_indexhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.downslope_index(...)RasterRaster output
edge_contaminationhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.edge_contamination(...)RasterRaster output
edge_densityterrainroughness_texturewbe.terrain.roughness_texture.edge_density(...)RasterRaster output
edge_preserving_mean_filterremote_sensingfilterswbe.remote_sensing.filters.edge_preserving_mean_filter(...)RasterRaster output
edge_proportionrastergeneralwbe.raster.edge_proportion(...)RasterRaster output
elev_above_pitterraingeneralwbe.terrain.elev_above_pit(...)RasterRaster output
elev_above_pit_distterraingeneralwbe.terrain.elev_above_pit_dist(...)RasterRaster output
elev_relative_to_min_maxterrainlandform_indiceswbe.terrain.landform_indices.elev_relative_to_min_max(...)RasterRaster output
elev_relative_to_watershed_min_maxhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.elev_relative_to_watershed_min_max(...)RasterRaster output
elevation_above_streamhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.elevation_above_stream(...)RasterRaster output
elevation_above_stream_euclideanhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.elevation_above_stream_euclidean(...)RasterRaster output
elevation_percentileterraingeneralwbe.terrain.elevation_percentile(...)RasterRaster output
eliminate_coincident_pointsvectorgeometry_processingwbe.vector.geometry_processing.eliminate_coincident_points(...)VectorVector output
elongation_ratiovectorshape_metricswbe.vector.shape_metrics.elongation_ratio(...)VectorVector output
embankment_mappingterraingeneralwbe.terrain.embankment_mapping(...)`tuple[Raster, RasterNone]`
emboss_filterremote_sensingfilterswbe.remote_sensing.filters.emboss_filter(...)RasterRaster output
emergency_scenario_routing_and_accessibility_simulatorvectornetwork_analysiswbe.vector.network_analysis.emergency_scenario_routing_and_accessibility_simulator(...)AnySee tool docs
enhanced_lee_filterremote_sensingsarwbe.remote_sensing.sar.enhanced_lee_filter(...)RasterRaster output
equal_torastergeneralwbe.raster.equal_to(...)RasterRaster output
erasevectoroverlay_analysiswbe.vector.overlay_analysis.erase(...)VectorVector output
erase_polygon_from_lidarlidarfiltering_classificationwbe.lidar.filtering_classification.erase_polygon_from_lidar(...)LidarLiDAR output
erase_polygon_from_rasterrastergeneralwbe.raster.erase_polygon_from_raster(...)RasterRaster output
euclidean_allocationrasterdistance_costwbe.raster.distance_cost.euclidean_allocation(...)RasterRaster output
euclidean_distancerasterdistance_costwbe.raster.distance_cost.euclidean_distance(...)RasterRaster output
evaluate_object_classification_accuracyremote_sensingobiawbe.remote_sensing.obia.evaluate_object_classification_accuracy(...)strReport/path string output
evaluate_segmentation_quality_proremote_sensingobiawbe.remote_sensing.obia.evaluate_segmentation_quality_pro(...)strReport/path string output
evaluate_training_sitesremote_sensingclassificationwbe.remote_sensing.classification.evaluate_training_sites(...)strReport/path string output
exprastergeneralwbe.raster.exp(...)RasterRaster output
exp2rastergeneralwbe.raster.exp2(...)RasterRaster output
export_table_to_csvconversionvector_table_iowbe.conversion.vector_table_io.export_table_to_csv(...)strReport/path string output
exposure_towards_wind_fluxterraingeneralwbe.terrain.exposure_towards_wind_flux(...)RasterRaster output
extend_vector_linesvectorgeometry_processingwbe.vector.geometry_processing.extend_vector_lines(...)VectorVector output
extract_by_attributevectorattribute_analysiswbe.vector.attribute_analysis.extract_by_attribute(...)VectorVector output
extract_nodesvectorsampling_griddingwbe.vector.sampling_gridding.extract_nodes(...)VectorVector output
extract_raster_values_at_pointsvectorsampling_griddingwbe.vector.sampling_gridding.extract_raster_values_at_points(...)tuple[Vector, str]Multiple outputs (tuple)
extract_streamsstreamsnetwork_extractionwbe.streams.network_extraction.extract_streams(...)RasterRaster output
extract_valleysstreamsnetwork_extractionwbe.streams.network_extraction.extract_valleys(...)RasterRaster output
false_colour_compositeremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.false_colour_composite(...)AnySee tool docs
farthest_channel_headstreamslongitudinal_analysiswbe.streams.longitudinal_analysis.farthest_channel_head(...)RasterRaster output
fast_almost_gaussian_filterremote_sensingfilterswbe.remote_sensing.filters.fast_almost_gaussian_filter(...)RasterRaster output
fd8_flow_accumhydrologyflow_routingwbe.hydrology.flow_routing.fd8_flow_accum(...)RasterRaster output
fd8_pointerhydrologyflow_routingwbe.hydrology.flow_routing.fd8_pointer(...)RasterRaster output
feature_preserving_smoothingterraingeneralwbe.terrain.feature_preserving_smoothing(...)RasterRaster output
feature_preserving_smoothing_multiscaleterraingeneralwbe.terrain.feature_preserving_smoothing_multiscale(...)AnySee tool docs
fetch_analysisterraingeneralwbe.terrain.fetch_analysis(...)RasterRaster output
fft_random_fieldrastergeneralwbe.raster.fft_random_field(...)RasterRaster output
field_calculatorvectorattribute_analysiswbe.vector.attribute_analysis.field_calculator(...)VectorVector output
field_trafficability_and_operation_planningprecision_agriculturegeneralwbe.precision_agriculture.field_trafficability_and_operation_planning(...)AnySee tool docs
fill_burnhydrologydepressions_storagewbe.hydrology.depressions_storage.fill_burn(...)RasterRaster output
fill_depressionshydrologydepressions_storagewbe.hydrology.depressions_storage.fill_depressions(...)RasterRaster output
fill_depressions_planchon_and_darbouxhydrologydepressions_storagewbe.hydrology.depressions_storage.fill_depressions_planchon_and_darboux(...)RasterRaster output
fill_depressions_wang_and_liuhydrologydepressions_storagewbe.hydrology.depressions_storage.fill_depressions_wang_and_liu(...)RasterRaster output
fill_missing_dataterraingeneralwbe.terrain.fill_missing_data(...)RasterRaster output
fill_pitshydrologydepressions_storagewbe.hydrology.depressions_storage.fill_pits(...)RasterRaster output
filter_lidarlidarfiltering_classificationwbe.lidar.filtering_classification.filter_lidar(...)LidarLiDAR output
filter_lidar_by_percentilelidarfiltering_classificationwbe.lidar.filtering_classification.filter_lidar_by_percentile(...)LidarLiDAR output
filter_lidar_by_reference_surfacelidarfiltering_classificationwbe.lidar.filtering_classification.filter_lidar_by_reference_surface(...)LidarLiDAR output
filter_lidar_classeslidarfiltering_classificationwbe.lidar.filtering_classification.filter_lidar_classes(...)LidarLiDAR output
filter_lidar_noiselidarfiltering_classificationwbe.lidar.filtering_classification.filter_lidar_noise(...)LidarLiDAR output
filter_lidar_scan_angleslidarfiltering_classificationwbe.lidar.filtering_classification.filter_lidar_scan_angles(...)LidarLiDAR output
filter_raster_features_by_arearastergeneralwbe.raster.filter_raster_features_by_area(...)RasterRaster output
filter_vector_features_by_areavectorattribute_analysiswbe.vector.attribute_analysis.filter_vector_features_by_area(...)VectorVector output
find_flightline_edge_pointslidaranalysis_metricswbe.lidar.analysis_metrics.find_flightline_edge_points(...)LidarLiDAR output
find_lowest_or_highest_pointsvectorsampling_griddingwbe.vector.sampling_gridding.find_lowest_or_highest_points(...)VectorVector output
find_main_stemstreamslongitudinal_analysiswbe.streams.longitudinal_analysis.find_main_stem(...)RasterRaster output
find_noflow_cellshydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.find_noflow_cells(...)RasterRaster output
find_parallel_flowhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.find_parallel_flow(...)RasterRaster output
find_patch_edge_cellsrastergeneralwbe.raster.find_patch_edge_cells(...)RasterRaster output
find_ridgesterraingeneralwbe.terrain.find_ridges(...)RasterRaster output
fix_dangling_arcsconversiongeometry_topologywbe.conversion.geometry_topology.fix_dangling_arcs(...)VectorVector output
flatten_lakeshydrologydepressions_storagewbe.hydrology.depressions_storage.flatten_lakes(...)RasterRaster output
fleet_routing_and_dispatch_optimizervectornetwork_analysiswbe.vector.network_analysis.fleet_routing_and_dispatch_optimizer(...)AnySee tool docs
flightline_overlaplidarinterpolation_griddingwbe.lidar.interpolation_gridding.flightline_overlap(...)RasterRaster output
flip_imageremote_sensingfilterswbe.remote_sensing.filters.flip_image(...)RasterRaster output
flood_orderhydrologywatersheds_basinswbe.hydrology.watersheds_basins.flood_order(...)RasterRaster output
floorrastergeneralwbe.raster.floor(...)RasterRaster output
flow_accum_full_workflowhydrologyflow_routingwbe.hydrology.flow_routing.flow_accum_full_workflow(...)tuple[Raster, Raster, Raster]Multiple outputs (tuple)
flow_length_diffhydrologyflow_routingwbe.hydrology.flow_routing.flow_length_diff(...)RasterRaster output
forestry_structure_and_biomass_intelligenceterrainworkflow_productswbe.terrain.workflow_products.forestry_structure_and_biomass_intelligence(...)AnySee tool docs
frangi_filterremote_sensingfilterswbe.remote_sensing.filters.frangi_filter(...)RasterRaster output
freeman_durden_decompositionremote_sensingsarwbe.remote_sensing.sar.freeman_durden_decomposition(...)AnySee tool docs
frost_filterremote_sensingsarwbe.remote_sensing.sar.frost_filter(...)RasterRaster output
fuzzy_knn_classificationremote_sensingclassificationwbe.remote_sensing.classification.fuzzy_knn_classification(...)tuple[Raster, Raster]Multiple outputs (tuple)
gabor_filter_bankremote_sensingfilterswbe.remote_sensing.filters.gabor_filter_bank(...)RasterRaster output
gamma_correctionremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.gamma_correction(...)RasterRaster output
gamma_map_filterremote_sensingsarwbe.remote_sensing.sar.gamma_map_filter(...)RasterRaster output
gaussian_contrast_stretchremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.gaussian_contrast_stretch(...)RasterRaster output
gaussian_curvatureterrainderivativeswbe.terrain.derivatives.gaussian_curvature(...)RasterRaster output
gaussian_filterremote_sensingfilterswbe.remote_sensing.filters.gaussian_filter(...)RasterRaster output
generalize_classified_rasterremote_sensingclassificationwbe.remote_sensing.classification.generalize_classified_raster(...)RasterRaster output
generalize_with_similarityremote_sensingclassificationwbe.remote_sensing.classification.generalize_with_similarity(...)RasterRaster output
generate_network_nodesvectornetwork_analysiswbe.vector.network_analysis.generate_network_nodes(...)AnySee tool docs
generating_functionterrainderivativeswbe.terrain.derivatives.generating_function(...)RasterRaster output
geomorphonsterrainlandform_indiceswbe.terrain.landform_indices.geomorphons(...)RasterRaster output
georeference_raster_from_control_pointsprojection_georeferencinggeneralwbe.projection_georeferencing.georeference_raster_from_control_points(...)AnySee tool docs
glcm_textureremote_sensingfilterswbe.remote_sensing.filters.glcm_texture(...)RasterRaster output
greater_thanrastergeneralwbe.raster.greater_than(...)RasterRaster output
guided_filterremote_sensingfilterswbe.remote_sensing.filters.guided_filter(...)RasterRaster output
guided_uav_image_intake_workflowremote_sensingworkflow_productswbe.remote_sensing.workflow_products.guided_uav_image_intake_workflow(...)AnySee tool docs
h_alpha_wisart_classificationremote_sensingsarwbe.remote_sensing.sar.h_alpha_wisart_classification(...)RasterRaster output
hack_stream_orderstreamsordering_metricswbe.streams.ordering_metrics.hack_stream_order(...)RasterRaster output
heat_maprastergeneralwbe.raster.heat_map(...)RasterRaster output
height_above_groundlidarfiltering_classificationwbe.lidar.filtering_classification.height_above_ground(...)LidarLiDAR output
hexagonal_grid_from_raster_basevectorsampling_griddingwbe.vector.sampling_gridding.hexagonal_grid_from_raster_base(...)VectorVector output
hexagonal_grid_from_vector_basevectorsampling_griddingwbe.vector.sampling_gridding.hexagonal_grid_from_vector_base(...)VectorVector output
high_pass_bilateral_filterremote_sensingfilterswbe.remote_sensing.filters.high_pass_bilateral_filter(...)RasterRaster output
high_pass_filterremote_sensingfilterswbe.remote_sensing.filters.high_pass_filter(...)RasterRaster output
high_pass_median_filterremote_sensingfilterswbe.remote_sensing.filters.high_pass_median_filter(...)RasterRaster output
highest_positionrasteroverlay_mathwbe.raster.overlay_math.highest_position(...)RasterRaster output
hillshadeterraingeneralwbe.terrain.hillshade(...)RasterRaster output
hillslopeshydrologywatersheds_basinswbe.hydrology.watersheds_basins.hillslopes(...)RasterRaster output
histogram_equalizationremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.histogram_equalization(...)RasterRaster output
histogram_matchingremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.histogram_matching(...)RasterRaster output
histogram_matching_two_imagesremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.histogram_matching_two_images(...)RasterRaster output
hole_proportionvectorshape_metricswbe.vector.shape_metrics.hole_proportion(...)VectorVector output
horizon_angleterrainvisibilitywbe.terrain.visibility.horizon_angle(...)RasterRaster output
horizon_areaterrainvisibilitywbe.terrain.visibility.horizon_area(...)RasterRaster output
horizontal_excess_curvatureterrainderivativeswbe.terrain.derivatives.horizontal_excess_curvature(...)RasterRaster output
horton_ratiosstreamsordering_metricswbe.streams.ordering_metrics.horton_ratios(...)`tuple[float, float, float, float, strNone]`
horton_stream_orderstreamsordering_metricswbe.streams.ordering_metrics.horton_stream_order(...)RasterRaster output
hydrologic_connectivityhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.hydrologic_connectivity(...)tuple[Raster, Raster]Multiple outputs (tuple)
hypsometric_analysisterrainlandform_indiceswbe.terrain.landform_indices.hypsometric_analysis(...)strReport/path string output
hypsometrically_tinted_hillshadeterraingeneralwbe.terrain.hypsometrically_tinted_hillshade(...)RasterRaster output
identityvectoroverlay_analysiswbe.vector.overlay_analysis.identity(...)VectorVector output
idw_interpolationrastergeneralwbe.raster.idw_interpolation(...)RasterRaster output
ihs_to_rgbremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.ihs_to_rgb(...)tuple[Raster, Raster, Raster]Multiple outputs (tuple)
image_autocorrelationrastergeneralwbe.raster.image_autocorrelation(...)strReport/path string output
image_correlationrastergeneralwbe.raster.image_correlation(...)strReport/path string output
image_correlation_neighbourhood_analysisrasterlocal_neighborhoodwbe.raster.local_neighborhood.image_correlation_neighbourhood_analysis(...)tuple[Raster, Raster]Multiple outputs (tuple)
image_difference_change_detectionremote_sensingchange_detectionwbe.remote_sensing.change_detection.image_difference_change_detection(...)AnySee tool docs
image_regressionrastergeneralwbe.raster.image_regression(...)tuple[Raster, str]Multiple outputs (tuple)
image_segmentationremote_sensingobiawbe.remote_sensing.obia.image_segmentation(...)RasterRaster output
image_sliderremote_sensingobiawbe.remote_sensing.obia.image_slider(...)strReport/path string output
image_stack_profileremote_sensingobiawbe.remote_sensing.obia.image_stack_profile(...)AnySee tool docs
impoundment_size_indexhydrologydepressions_storagewbe.hydrology.depressions_storage.impoundment_size_index(...)`tuple[RasterNone, Raster
improved_ground_point_filterlidarfiltering_classificationwbe.lidar.filtering_classification.improved_ground_point_filter(...)LidarLiDAR output
in_season_crop_stress_intervention_planningprecision_agriculturegeneralwbe.precision_agriculture.in_season_crop_stress_intervention_planning(...)AnySee tool docs
incrementrastergeneralwbe.raster.increment(...)RasterRaster output
individual_tree_detectionlidaranalysis_metricswbe.lidar.analysis_metrics.individual_tree_detection(...)VectorVector output
individual_tree_segmentationlidarfiltering_classificationwbe.lidar.filtering_classification.individual_tree_segmentation(...)LidarLiDAR output
inplace_addrastergeneralwbe.raster.inplace_add(...)RasterRaster output
inplace_dividerastergeneralwbe.raster.inplace_divide(...)RasterRaster output
inplace_multiplyrastergeneralwbe.raster.inplace_multiply(...)RasterRaster output
inplace_subtractrastergeneralwbe.raster.inplace_subtract(...)RasterRaster output
insert_damshydrologydepressions_storagewbe.hydrology.depressions_storage.insert_dams(...)RasterRaster output
integer_divisionrastergeneralwbe.raster.integer_division(...)RasterRaster output
integral_image_transformremote_sensingfilterswbe.remote_sensing.filters.integral_image_transform(...)RasterRaster output
intersectvectoroverlay_analysiswbe.vector.overlay_analysis.intersect(...)VectorVector output
inverse_pcarastergeneralwbe.raster.inverse_pca(...)list[Raster]Raster output
is_nodatarastergeneralwbe.raster.is_nodata(...)RasterRaster output
isobasinshydrologywatersheds_basinswbe.hydrology.watersheds_basins.isobasins(...)RasterRaster output
jenson_snap_pour_pointshydrologywatersheds_basinswbe.hydrology.watersheds_basins.jenson_snap_pour_points(...)VectorVector output
join_tablesconversionvector_table_iowbe.conversion.vector_table_io.join_tables(...)VectorVector output
k_means_clusteringremote_sensingclassificationwbe.remote_sensing.classification.k_means_clustering(...)`tuple[Raster, int, strNone]`
k_nearest_mean_filterremote_sensingfilterswbe.remote_sensing.filters.k_nearest_mean_filter(...)RasterRaster output
k_shortest_paths_networkvectornetwork_analysiswbe.vector.network_analysis.k_shortest_paths_network(...)VectorVector output
kappa_indexrastergeneralwbe.raster.kappa_index(...)strReport/path string output
knn_classificationremote_sensingclassificationwbe.remote_sensing.classification.knn_classification(...)RasterRaster output
knn_regressionremote_sensingclassificationwbe.remote_sensing.classification.knn_regression(...)RasterRaster output
ks_normality_testrastergeneralwbe.raster.ks_normality_test(...)strReport/path string output
kuan_filterremote_sensingsarwbe.remote_sensing.sar.kuan_filter(...)RasterRaster output
kuwahara_filterremote_sensingfilterswbe.remote_sensing.filters.kuwahara_filter(...)RasterRaster output
land_surface_temperature_single_channelremote_sensingthermal_emissivitywbe.remote_sensing.thermal_emissivity.land_surface_temperature_single_channel(...)AnySee tool docs
land_surface_temperature_split_windowremote_sensingthermal_emissivitywbe.remote_sensing.thermal_emissivity.land_surface_temperature_split_window(...)AnySee tool docs
landslide_susceptibility_assessmentterrainworkflow_productswbe.terrain.workflow_products.landslide_susceptibility_assessment(...)AnySee tool docs
laplacian_filterremote_sensingedge_feature_detectionwbe.remote_sensing.edge_feature_detection.laplacian_filter(...)RasterRaster output
laplacian_of_gaussians_filterremote_sensingedge_feature_detectionwbe.remote_sensing.edge_feature_detection.laplacian_of_gaussians_filter(...)RasterRaster output
las_to_asciilidario_managementwbe.lidar.io_management.las_to_ascii(...)strReport/path string output
las_to_shapefilelidario_managementwbe.lidar.io_management.las_to_shapefile(...)VectorVector output
layer_footprint_rastervectorsampling_griddingwbe.vector.sampling_gridding.layer_footprint_raster(...)VectorVector output
layer_footprint_vectorvectorsampling_griddingwbe.vector.sampling_gridding.layer_footprint_vector(...)VectorVector output
lee_filterremote_sensingfilterswbe.remote_sensing.filters.lee_filter(...)RasterRaster output
length_of_upstream_channelsstreamslongitudinal_analysiswbe.streams.longitudinal_analysis.length_of_upstream_channels(...)RasterRaster output
less_thanrastergeneralwbe.raster.less_than(...)RasterRaster output
lidar_block_maximumlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_block_maximum(...)RasterRaster output
lidar_block_minimumlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_block_minimum(...)RasterRaster output
lidar_change_and_disturbance_analysislidarworkflow_productswbe.lidar.workflow_products.lidar_change_and_disturbance_analysis(...)AnySee tool docs
lidar_classify_subsetlidarfiltering_classificationwbe.lidar.filtering_classification.lidar_classify_subset(...)LidarLiDAR output
lidar_colourizelidario_managementwbe.lidar.io_management.lidar_colourize(...)LidarLiDAR output
lidar_construct_vector_tinlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_construct_vector_tin(...)VectorVector output
lidar_contourlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_contour(...)VectorVector output
lidar_digital_surface_modellidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_digital_surface_model(...)RasterRaster output
lidar_eigenvalue_featureslidaranalysis_metricswbe.lidar.analysis_metrics.lidar_eigenvalue_features(...)strReport/path string output
lidar_elevation_slicelidarfiltering_classificationwbe.lidar.filtering_classification.lidar_elevation_slice(...)LidarLiDAR output
lidar_ground_point_filterremote_sensingfilterswbe.remote_sensing.filters.lidar_ground_point_filter(...)LidarLiDAR output
lidar_hex_binlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_hex_bin(...)VectorVector output
lidar_hillshadelidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_hillshade(...)RasterRaster output
lidar_histogramlidaranalysis_metricswbe.lidar.analysis_metrics.lidar_histogram(...)strReport/path string output
lidar_idw_interpolationlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_idw_interpolation(...)RasterRaster output
lidar_infolidaranalysis_metricswbe.lidar.analysis_metrics.lidar_info(...)strReport/path string output
lidar_joinlidario_managementwbe.lidar.io_management.lidar_join(...)LidarLiDAR output
lidar_kappalidaranalysis_metricswbe.lidar.analysis_metrics.lidar_kappa(...)RasterRaster output
lidar_nearest_neighbour_griddinglidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_nearest_neighbour_gridding(...)RasterRaster output
lidar_point_densitylidaranalysis_metricswbe.lidar.analysis_metrics.lidar_point_density(...)RasterRaster output
lidar_point_return_analysislidaranalysis_metricswbe.lidar.analysis_metrics.lidar_point_return_analysis(...)strReport/path string output
lidar_point_statslidaranalysis_metricswbe.lidar.analysis_metrics.lidar_point_stats(...)strReport/path string output
lidar_qa_and_confidencelidarworkflow_productswbe.lidar.workflow_products.lidar_qa_and_confidence(...)AnySee tool docs
lidar_radial_basis_function_interpolationlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_radial_basis_function_interpolation(...)RasterRaster output
lidar_ransac_planeslidaranalysis_metricswbe.lidar.analysis_metrics.lidar_ransac_planes(...)LidarLiDAR output
lidar_remove_outlierslidarfiltering_classificationwbe.lidar.filtering_classification.lidar_remove_outliers(...)LidarLiDAR output
lidar_rooftop_analysislidaranalysis_metricswbe.lidar.analysis_metrics.lidar_rooftop_analysis(...)VectorVector output
lidar_segmentationlidarfiltering_classificationwbe.lidar.filtering_classification.lidar_segmentation(...)LidarLiDAR output
lidar_segmentation_based_filterlidarfiltering_classificationwbe.lidar.filtering_classification.lidar_segmentation_based_filter(...)LidarLiDAR output
lidar_shiftlidario_managementwbe.lidar.io_management.lidar_shift(...)LidarLiDAR output
lidar_sibson_interpolationlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_sibson_interpolation(...)RasterRaster output
lidar_terrain_product_suitelidarworkflow_productswbe.lidar.workflow_products.lidar_terrain_product_suite(...)AnySee tool docs
lidar_thinlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_thin(...)LidarLiDAR output
lidar_thin_high_densitylidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_thin_high_density(...)LidarLiDAR output
lidar_tilelidario_managementwbe.lidar.io_management.lidar_tile(...)LidarLiDAR output
lidar_tile_footprintlidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_tile_footprint(...)VectorVector output
lidar_tin_griddinglidarinterpolation_griddingwbe.lidar.interpolation_gridding.lidar_tin_gridding(...)RasterRaster output
lidar_tophat_transformlidario_managementwbe.lidar.io_management.lidar_tophat_transform(...)LidarLiDAR output
line_detection_filterremote_sensingfilterswbe.remote_sensing.filters.line_detection_filter(...)RasterRaster output
line_intersectionsvectoroverlay_analysiswbe.vector.overlay_analysis.line_intersections(...)VectorVector output
line_polygon_clipvectoroverlay_analysiswbe.vector.overlay_analysis.line_polygon_clip(...)VectorVector output
line_thinningremote_sensingfilterswbe.remote_sensing.filters.line_thinning(...)RasterRaster output
linear_spectral_unmixingremote_sensingspectral_analyticswbe.remote_sensing.spectral_analytics.linear_spectral_unmixing(...)AnySee tool docs
linearity_indexvectorshape_metricswbe.vector.shape_metrics.linearity_index(...)VectorVector output
lines_to_polygonsconversiongeometry_topologywbe.conversion.geometry_topology.lines_to_polygons(...)VectorVector output
list_unique_valuesvectorattribute_analysiswbe.vector.attribute_analysis.list_unique_values(...)strReport/path string output
list_unique_values_rasterrastergeneralwbe.raster.list_unique_values_raster(...)strReport/path string output
lnrastergeneralwbe.raster.ln(...)RasterRaster output
local_hypsometric_analysisterraingeneralwbe.terrain.local_hypsometric_analysis(...)tuple[Raster, Raster]Multiple outputs (tuple)
locate_points_along_routesvectorlinear_referencingwbe.vector.linear_referencing.locate_points_along_routes(...)VectorVector output
location_allocation_networkvectornetwork_analysiswbe.vector.network_analysis.location_allocation_network(...)VectorVector output
log10rastergeneralwbe.raster.log10(...)RasterRaster output
log2rastergeneralwbe.raster.log2(...)RasterRaster output
logistic_regressionremote_sensingclassificationwbe.remote_sensing.classification.logistic_regression(...)RasterRaster output
long_profilestreamslongitudinal_analysiswbe.streams.longitudinal_analysis.long_profile(...)`strNone`
long_profile_from_pointsstreamslongitudinal_analysiswbe.streams.longitudinal_analysis.long_profile_from_points(...)`strNone`
longest_flowpathhydrologywatersheds_basinswbe.hydrology.watersheds_basins.longest_flowpath(...)VectorVector output
low_points_on_headwater_dividesterraingeneralwbe.terrain.low_points_on_headwater_divides(...)VectorVector output
lowest_positionrasteroverlay_mathwbe.raster.overlay_math.lowest_position(...)RasterRaster output
majority_filterremote_sensingfilterswbe.remote_sensing.filters.majority_filter(...)RasterRaster output
map_featuresrastergeneralwbe.raster.map_features(...)RasterRaster output
map_matching_v1vectornetwork_analysiswbe.vector.network_analysis.map_matching_v1(...)VectorVector output
map_off_terrain_objectsterraingeneralwbe.terrain.map_off_terrain_objects(...)RasterRaster output
market_access_and_site_intelligence_workflowvectornetwork_analysiswbe.vector.network_analysis.market_access_and_site_intelligence_workflow(...)AnySee tool docs
maxrastergeneralwbe.raster.max(...)RasterRaster output
max_absolute_overlayrasteroverlay_mathwbe.raster.overlay_math.max_absolute_overlay(...)RasterRaster output
max_anisotropy_devterrainmultiscale_signatureswbe.terrain.multiscale_signatures.max_anisotropy_dev(...)tuple[Raster, Raster]Multiple outputs (tuple)
max_anisotropy_dev_signatureterrainmultiscale_signatureswbe.terrain.multiscale_signatures.max_anisotropy_dev_signature(...)strReport/path string output
max_branch_lengthhydrologywatersheds_basinswbe.hydrology.watersheds_basins.max_branch_length(...)RasterRaster output
max_difference_from_meanterrainmultiscale_signatureswbe.terrain.multiscale_signatures.max_difference_from_mean(...)tuple[Raster, Raster]Multiple outputs (tuple)
max_downslope_elev_changeterraingeneralwbe.terrain.max_downslope_elev_change(...)RasterRaster output
max_elev_dev_signatureterrainmultiscale_signatureswbe.terrain.multiscale_signatures.max_elev_dev_signature(...)strReport/path string output
max_elevation_deviationterrainmultiscale_signatureswbe.terrain.multiscale_signatures.max_elevation_deviation(...)tuple[Raster, Raster]Multiple outputs (tuple)
max_overlayrasteroverlay_mathwbe.raster.overlay_math.max_overlay(...)RasterRaster output
max_upslope_elev_changeterraingeneralwbe.terrain.max_upslope_elev_change(...)RasterRaster output
max_upslope_flowpath_lengthhydrologyflow_routingwbe.hydrology.flow_routing.max_upslope_flowpath_length(...)RasterRaster output
max_upslope_valuehydrologyflow_routingwbe.hydrology.flow_routing.max_upslope_value(...)RasterRaster output
maximal_curvatureterrainderivativeswbe.terrain.derivatives.maximal_curvature(...)RasterRaster output
maximum_filterremote_sensingfilterswbe.remote_sensing.filters.maximum_filter(...)RasterRaster output
mdinf_flow_accumhydrologyflow_routingwbe.hydrology.flow_routing.mdinf_flow_accum(...)RasterRaster output
mean_curvatureterrainderivativeswbe.terrain.derivatives.mean_curvature(...)RasterRaster output
mean_filterremote_sensingfilterswbe.remote_sensing.filters.mean_filter(...)RasterRaster output
median_filterremote_sensingfilterswbe.remote_sensing.filters.median_filter(...)RasterRaster output
medoidvectorsampling_griddingwbe.vector.sampling_gridding.medoid(...)VectorVector output
merge_line_segmentsvectorgeometry_processingwbe.vector.geometry_processing.merge_line_segments(...)VectorVector output
merge_table_with_csvconversionvector_table_iowbe.conversion.vector_table_io.merge_table_with_csv(...)VectorVector output
merge_vectorsconversionvector_table_iowbe.conversion.vector_table_io.merge_vectors(...)VectorVector output
minrastergeneralwbe.raster.min(...)RasterRaster output
min_absolute_overlayrasteroverlay_mathwbe.raster.overlay_math.min_absolute_overlay(...)RasterRaster output
min_dist_classificationremote_sensingclassificationwbe.remote_sensing.classification.min_dist_classification(...)RasterRaster output
min_downslope_elev_changeterraingeneralwbe.terrain.min_downslope_elev_change(...)RasterRaster output
min_max_contrast_stretchremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.min_max_contrast_stretch(...)RasterRaster output
min_overlayrasteroverlay_mathwbe.raster.overlay_math.min_overlay(...)RasterRaster output
mine_site_reclamation_compliance_trackerterrainworkflow_productswbe.terrain.workflow_products.mine_site_reclamation_compliance_tracker(...)AnySee tool docs
minimal_curvatureterrainderivativeswbe.terrain.derivatives.minimal_curvature(...)RasterRaster output
minimal_dispersion_flow_algorithmhydrologyflow_routingwbe.hydrology.flow_routing.minimal_dispersion_flow_algorithm(...)tuple[Raster, Raster]Multiple outputs (tuple)
minimum_bounding_boxvectorgeometry_processingwbe.vector.geometry_processing.minimum_bounding_box(...)VectorVector output
minimum_bounding_circlevectorgeometry_processingwbe.vector.geometry_processing.minimum_bounding_circle(...)VectorVector output
minimum_bounding_envelopevectorgeometry_processingwbe.vector.geometry_processing.minimum_bounding_envelope(...)VectorVector output
minimum_convex_hullvectorgeometry_processingwbe.vector.geometry_processing.minimum_convex_hull(...)VectorVector output
minimum_filterremote_sensingfilterswbe.remote_sensing.filters.minimum_filter(...)RasterRaster output
minimum_noise_fractionremote_sensingspectral_analyticswbe.remote_sensing.spectral_analytics.minimum_noise_fraction(...)AnySee tool docs
modified_k_means_clusteringremote_sensingclassificationwbe.remote_sensing.classification.modified_k_means_clustering(...)`tuple[Raster, int, strNone]`
modified_shepard_interpolationrastergeneralwbe.raster.modified_shepard_interpolation(...)RasterRaster output
modify_lidarlidarfiltering_classificationwbe.lidar.filtering_classification.modify_lidar(...)LidarLiDAR output
modify_nodata_valueconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.modify_nodata_value(...)RasterRaster output
modulorasteroverlay_mathwbe.raster.overlay_math.modulo(...)RasterRaster output
mosaicremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.mosaic(...)RasterRaster output
mosaic_with_featheringremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.mosaic_with_feathering(...)RasterRaster output
multi_sensor_fusion_monitoringremote_sensingworkflow_productswbe.remote_sensing.workflow_products.multi_sensor_fusion_monitoring(...)AnySee tool docs
multidirectional_hillshadeterraingeneralwbe.terrain.multidirectional_hillshade(...)RasterRaster output
multimodal_od_cost_matrixvectornetwork_analysiswbe.vector.network_analysis.multimodal_od_cost_matrix(...)AnySee tool docs
multimodal_routes_from_odvectornetwork_analysiswbe.vector.network_analysis.multimodal_routes_from_od(...)AnySee tool docs
multimodal_shortest_pathvectornetwork_analysiswbe.vector.network_analysis.multimodal_shortest_path(...)AnySee tool docs
multipart_to_singlepartconversiongeometry_topologywbe.conversion.geometry_topology.multipart_to_singlepart(...)VectorVector output
multiplyrasteroverlay_mathwbe.raster.overlay_math.multiply(...)RasterRaster output
multiply_overlayrasteroverlay_mathwbe.raster.overlay_math.multiply_overlay(...)RasterRaster output
multiscale_curvaturesterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_curvatures(...)RasterRaster output
multiscale_elevated_indexterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_elevated_index(...)tuple[Raster, Raster]Multiple outputs (tuple)
multiscale_elevation_percentileterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_elevation_percentile(...)tuple[Raster, Raster]Multiple outputs (tuple)
multiscale_low_lying_indexterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_low_lying_index(...)tuple[Raster, Raster]Multiple outputs (tuple)
multiscale_roughnessterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_roughness(...)tuple[Raster, Raster]Multiple outputs (tuple)
multiscale_roughness_signatureterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_roughness_signature(...)strReport/path string output
multiscale_std_dev_normalsterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_std_dev_normals(...)tuple[Raster, Raster]Multiple outputs (tuple)
multiscale_std_dev_normals_signatureterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_std_dev_normals_signature(...)strReport/path string output
multiscale_topographic_position_classterrainlandform_indiceswbe.terrain.landform_indices.multiscale_topographic_position_class(...)RasterRaster output
multiscale_topographic_position_imageterrainmultiscale_signatureswbe.terrain.multiscale_signatures.multiscale_topographic_position_image(...)RasterRaster output
narrowness_indexrastergeneralwbe.raster.narrowness_index(...)RasterRaster output
narrowness_index_vectorvectorshape_metricswbe.vector.shape_metrics.narrowness_index_vector(...)VectorVector output
natural_neighbour_interpolationrasterlocal_neighborhoodwbe.raster.local_neighborhood.natural_neighbour_interpolation(...)RasterRaster output
ndvi_based_emissivityremote_sensingthermal_emissivitywbe.remote_sensing.thermal_emissivity.ndvi_based_emissivity(...)AnySee tool docs
nearvectoroverlay_analysiswbe.vector.overlay_analysis.near(...)VectorVector output
nearest_neighbour_interpolationrasterlocal_neighborhoodwbe.raster.local_neighborhood.nearest_neighbour_interpolation(...)RasterRaster output
negaterastergeneralwbe.raster.negate(...)RasterRaster output
network_accessibility_metricsvectornetwork_analysiswbe.vector.network_analysis.network_accessibility_metrics(...)AnySee tool docs
network_centrality_metricsvectornetwork_analysiswbe.vector.network_analysis.network_centrality_metrics(...)AnySee tool docs
network_connected_componentsvectornetwork_analysiswbe.vector.network_analysis.network_connected_components(...)VectorVector output
network_node_degreevectornetwork_analysiswbe.vector.network_analysis.network_node_degree(...)VectorVector output
network_od_cost_matrixvectornetwork_analysiswbe.vector.network_analysis.network_od_cost_matrix(...)strReport/path string output
network_readiness_and_diagnostics_intelligencevectornetwork_analysiswbe.vector.network_analysis.network_readiness_and_diagnostics_intelligence(...)AnySee tool docs
network_routes_from_odvectornetwork_analysiswbe.vector.network_analysis.network_routes_from_od(...)VectorVector output
network_service_areavectornetwork_analysiswbe.vector.network_analysis.network_service_area(...)VectorVector output
network_topology_auditvectornetwork_analysiswbe.vector.network_analysis.network_topology_audit(...)VectorVector output
new_raster_from_base_rasterconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.new_raster_from_base_raster(...)RasterRaster output
new_raster_from_base_vectorconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.new_raster_from_base_vector(...)RasterRaster output
nibblerastergeneralwbe.raster.nibble(...)RasterRaster output
nnd_classificationremote_sensingclassificationwbe.remote_sensing.classification.nnd_classification(...)RasterRaster output
non_local_means_filterremote_sensingfilterswbe.remote_sensing.filters.non_local_means_filter(...)RasterRaster output
normal_vectorslidaranalysis_metricswbe.lidar.analysis_metrics.normal_vectors(...)LidarLiDAR output
normalize_lidarlidarfiltering_classificationwbe.lidar.filtering_classification.normalize_lidar(...)LidarLiDAR output
normalized_difference_indexremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.normalized_difference_index(...)RasterRaster output
not_equal_torastergeneralwbe.raster.not_equal_to(...)RasterRaster output
num_downslope_neighboursterraingeneralwbe.terrain.num_downslope_neighbours(...)RasterRaster output
num_inflowing_neighbourshydrologyflow_routingwbe.hydrology.flow_routing.num_inflowing_neighbours(...)RasterRaster output
num_upslope_neighboursterraingeneralwbe.terrain.num_upslope_neighbours(...)RasterRaster output
obia_audit_report_proremote_sensingobiawbe.remote_sensing.obia.obia_audit_report_pro(...)strReport/path string output
obia_batch_orchestrator_proremote_sensingobiawbe.remote_sensing.obia.obia_batch_orchestrator_pro(...)dict[str, Any]Report/path string output
obia_pipeline_basicremote_sensingobiawbe.remote_sensing.obia.obia_pipeline_basic(...)dict[str, Any]Report/path string output
object_class_probability_mapsremote_sensingobiawbe.remote_sensing.obia.object_class_probability_maps(...)strReport/path string output
object_features_context_neighborsremote_sensingobiawbe.remote_sensing.obia.object_features_context_neighbors(...)strReport/path string output
object_features_shape_basicremote_sensingobiawbe.remote_sensing.obia.object_features_shape_basic(...)strReport/path string output
object_features_spectral_basicremote_sensingobiawbe.remote_sensing.obia.object_features_spectral_basic(...)strReport/path string output
object_features_texture_glcm_basicremote_sensingobiawbe.remote_sensing.obia.object_features_texture_glcm_basic(...)strReport/path string output
object_features_topology_relationsremote_sensingobiawbe.remote_sensing.obia.object_features_topology_relations(...)strReport/path string output
object_uncertainty_diagnostics_proremote_sensingobiawbe.remote_sensing.obia.object_uncertainty_diagnostics_pro(...)strReport/path string output
objects_boundary_refinement_proremote_sensingobiawbe.remote_sensing.obia.objects_boundary_refinement_pro(...)RasterRaster output
objects_enforce_min_mapping_unitremote_sensingobiawbe.remote_sensing.obia.objects_enforce_min_mapping_unit(...)RasterRaster output
od_sensitivity_analysisvectornetwork_analysiswbe.vector.network_analysis.od_sensitivity_analysis(...)AnySee tool docs
olympic_filterremote_sensingfilterswbe.remote_sensing.filters.olympic_filter(...)RasterRaster output
openingremote_sensingfilterswbe.remote_sensing.filters.opening(...)RasterRaster output
opennessterrainvisibilitywbe.terrain.visibility.openness(...)tuple[Raster, Raster]Multiple outputs (tuple)
orthorectificationprojection_georeferencinggeneralwbe.projection_georeferencing.orthorectification(...)AnySee tool docs
otsu_thresholdingremote_sensingclassificationwbe.remote_sensing.classification.otsu_thresholding(...)RasterRaster output
paired_sample_t_testrastergeneralwbe.raster.paired_sample_t_test(...)strReport/path string output
panchromatic_sharpeningremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.panchromatic_sharpening(...)RasterRaster output
parallelepiped_classificationremote_sensingclassificationwbe.remote_sensing.classification.parallelepiped_classification(...)RasterRaster output
parcel_and_land_fabric_topology_compliance_workflowvectorworkflow_productswbe.vector.workflow_products.parcel_and_land_fabric_topology_compliance_workflow(...)AnySee tool docs
patch_orientationvectorshape_metricswbe.vector.shape_metrics.patch_orientation(...)VectorVector output
pca_based_change_detectionremote_sensingchange_detectionwbe.remote_sensing.change_detection.pca_based_change_detection(...)AnySee tool docs
pennock_landform_classificationterrainlandform_indiceswbe.terrain.landform_indices.pennock_landform_classification(...)tuple[Raster, str]Multiple outputs (tuple)
percent_elev_rangeterrainlandform_indiceswbe.terrain.landform_indices.percent_elev_range(...)RasterRaster output
percent_equal_torasteroverlay_mathwbe.raster.overlay_math.percent_equal_to(...)RasterRaster output
percent_greater_thanrasteroverlay_mathwbe.raster.overlay_math.percent_greater_than(...)RasterRaster output
percent_less_thanrasteroverlay_mathwbe.raster.overlay_math.percent_less_than(...)RasterRaster output
percentage_contrast_stretchremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.percentage_contrast_stretch(...)RasterRaster output
percentile_filterremote_sensingfilterswbe.remote_sensing.filters.percentile_filter(...)RasterRaster output
perimeter_area_ratiovectorshape_metricswbe.vector.shape_metrics.perimeter_area_ratio(...)VectorVector output
phi_coefficientrastergeneralwbe.raster.phi_coefficient(...)strReport/path string output
pick_from_listrasteroverlay_mathwbe.raster.overlay_math.pick_from_list(...)RasterRaster output
piecewise_contrast_stretchremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.piecewise_contrast_stretch(...)RasterRaster output
plan_curvatureterrainderivativeswbe.terrain.derivatives.plan_curvature(...)RasterRaster output
points_along_linesvectorlinear_referencingwbe.vector.linear_referencing.points_along_lines(...)VectorVector output
polygon_areavectorshape_metricswbe.vector.shape_metrics.polygon_area(...)VectorVector output
polygon_long_axisvectorshape_metricswbe.vector.shape_metrics.polygon_long_axis(...)VectorVector output
polygon_perimetervectorshape_metricswbe.vector.shape_metrics.polygon_perimeter(...)VectorVector output
polygon_short_axisvectorshape_metricswbe.vector.shape_metrics.polygon_short_axis(...)VectorVector output
polygonizevectorgeometry_processingwbe.vector.geometry_processing.polygonize(...)VectorVector output
polygons_to_linesconversiongeometry_topologywbe.conversion.geometry_topology.polygons_to_lines(...)VectorVector output
polygons_to_segmentsremote_sensingobiawbe.remote_sensing.obia.polygons_to_segments(...)RasterRaster output
post_classification_changeremote_sensingchange_detectionwbe.remote_sensing.change_detection.post_classification_change(...)AnySee tool docs
powerrasteroverlay_mathwbe.raster.overlay_math.power(...)RasterRaster output
precision_ag_yield_zone_intelligenceprecision_agriculturegeneralwbe.precision_agriculture.precision_ag_yield_zone_intelligence(...)AnySee tool docs
precision_irrigation_optimizationprecision_agriculturegeneralwbe.precision_agriculture.precision_irrigation_optimization(...)AnySee tool docs
prewitt_filterremote_sensingedge_feature_detectionwbe.remote_sensing.edge_feature_detection.prewitt_filter(...)RasterRaster output
principal_component_analysisrastergeneralwbe.raster.principal_component_analysis(...)list[Raster]Raster output
principal_curvature_directionterrainderivativeswbe.terrain.derivatives.principal_curvature_direction(...)RasterRaster output
print_geotiff_tagsrastergeneralwbe.raster.print_geotiff_tags(...)strReport/path string output
profileterraingeneralwbe.terrain.profile(...)strReport/path string output
profile_curvatureterrainderivativeswbe.terrain.derivatives.profile_curvature(...)RasterRaster output
propagate_labels_across_hierarchyremote_sensingobiawbe.remote_sensing.obia.propagate_labels_across_hierarchy(...)strReport/path string output
prune_vector_streamsstreamsnetwork_extractionwbe.streams.network_extraction.prune_vector_streams(...)VectorVector output
qin_flow_accumulationhydrologyflow_routingwbe.hydrology.flow_routing.qin_flow_accumulation(...)RasterRaster output
quantilesrastergeneralwbe.raster.quantiles(...)RasterRaster output
quinn_flow_accumulationhydrologyflow_routingwbe.hydrology.flow_routing.quinn_flow_accumulation(...)RasterRaster output
radial_basis_function_interpolationrastergeneralwbe.raster.radial_basis_function_interpolation(...)RasterRaster output
radius_of_gyrationrastergeneralwbe.raster.radius_of_gyration(...)RasterRaster output
raise_wallshydrologydepressions_storagewbe.hydrology.depressions_storage.raise_walls(...)RasterRaster output
random_fieldrastergeneralwbe.raster.random_field(...)RasterRaster output
random_forest_classificationremote_sensingclassificationwbe.remote_sensing.classification.random_forest_classification(...)RasterRaster output
random_forest_classification_fitrastergeneralwbe.raster.random_forest_classification_fit(...)list[int]See tool docs
random_forest_classification_predictrastergeneralwbe.raster.random_forest_classification_predict(...)RasterRaster output
random_forest_regressionremote_sensingclassificationwbe.remote_sensing.classification.random_forest_regression(...)RasterRaster output
random_forest_regression_fitrastergeneralwbe.raster.random_forest_regression_fit(...)list[int]See tool docs
random_forest_regression_predictrastergeneralwbe.raster.random_forest_regression_predict(...)RasterRaster output
random_points_in_polygonvectorsampling_griddingwbe.vector.sampling_gridding.random_points_in_polygon(...)VectorVector output
random_samplerastergeneralwbe.raster.random_sample(...)RasterRaster output
range_filterremote_sensingfilterswbe.remote_sensing.filters.range_filter(...)RasterRaster output
raster_arearastergeneralwbe.raster.raster_area(...)RasterRaster output
raster_calculatorrastergeneralwbe.raster.raster_calculator(...)RasterRaster output
raster_cell_assignmentrastergeneralwbe.raster.raster_cell_assignment(...)RasterRaster output
raster_histogramrastergeneralwbe.raster.raster_histogram(...)strReport/path string output
raster_perimeterrastergeneralwbe.raster.raster_perimeter(...)RasterRaster output
raster_streams_to_vectorstreamsnetwork_extractionwbe.streams.network_extraction.raster_streams_to_vector(...)VectorVector output
raster_summary_statsrastergeneralwbe.raster.raster_summary_stats(...)strReport/path string output
raster_to_vector_linesconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.raster_to_vector_lines(...)VectorVector output
raster_to_vector_pointsconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.raster_to_vector_points(...)VectorVector output
raster_to_vector_polygonsconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.raster_to_vector_polygons(...)VectorVector output
rasterize_streamsstreamsnetwork_extractionwbe.streams.network_extraction.rasterize_streams(...)RasterRaster output
reciprocalrastergeneralwbe.raster.reciprocal(...)RasterRaster output
reclassrasterreclass_maskwbe.raster.reclass_mask.reclass(...)RasterRaster output
reclass_equal_intervalrasterreclass_maskwbe.raster.reclass_mask.reclass_equal_interval(...)RasterRaster output
recover_flightline_infolidario_managementwbe.lidar.io_management.recover_flightline_info(...)LidarLiDAR output
rectangular_grid_from_raster_basevectorsampling_griddingwbe.vector.sampling_gridding.rectangular_grid_from_raster_base(...)VectorVector output
rectangular_grid_from_vector_basevectorsampling_griddingwbe.vector.sampling_gridding.rectangular_grid_from_vector_base(...)VectorVector output
refined_lee_filterremote_sensingsarwbe.remote_sensing.sar.refined_lee_filter(...)RasterRaster output
registration_oriented_feature_workflowremote_sensingworkflow_productswbe.remote_sensing.workflow_products.registration_oriented_feature_workflow(...)AnySee tool docs
reinitialize_attribute_tableconversionvector_table_iowbe.conversion.vector_table_io.reinitialize_attribute_table(...)VectorVector output
related_circumscribing_circlevectorshape_metricswbe.vector.shape_metrics.related_circumscribing_circle(...)VectorVector output
relative_aspectterrainderivativeswbe.terrain.derivatives.relative_aspect(...)RasterRaster output
relative_stream_power_indexhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.relative_stream_power_index(...)RasterRaster output
relative_topographic_positionterrainlandform_indiceswbe.terrain.landform_indices.relative_topographic_position(...)RasterRaster output
remote_sensing_change_detectionremote_sensingchange_detectionwbe.remote_sensing.change_detection.remote_sensing_change_detection(...)tuple[Raster, Raster, str]Multiple outputs (tuple)
remove_duplicateslidarfiltering_classificationwbe.lidar.filtering_classification.remove_duplicates(...)LidarLiDAR output
remove_off_terrain_objectsterraingeneralwbe.terrain.remove_off_terrain_objects(...)RasterRaster output
remove_polygon_holesconversiongeometry_topologywbe.conversion.geometry_topology.remove_polygon_holes(...)VectorVector output
remove_raster_polygon_holesconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.remove_raster_polygon_holes(...)RasterRaster output
remove_short_streamsstreamsnetwork_extractionwbe.streams.network_extraction.remove_short_streams(...)RasterRaster output
remove_spursremote_sensingfilterswbe.remote_sensing.filters.remove_spurs(...)RasterRaster output
rename_fieldvectorattribute_analysiswbe.vector.attribute_analysis.rename_field(...)VectorVector output
repair_stream_vector_topologystreamsnetwork_extractionwbe.streams.network_extraction.repair_stream_vector_topology(...)VectorVector output
representative_point_vectorvectorgeometry_processingwbe.vector.geometry_processing.representative_point_vector(...)AnySee tool docs
reproject_lidarprojection_georeferencinggeneralwbe.projection_georeferencing.reproject_lidar(...)AnySee tool docs
reproject_rasterprojection_georeferencinggeneralwbe.projection_georeferencing.reproject_raster(...)AnySee tool docs
reproject_vectorprojection_georeferencinggeneralwbe.projection_georeferencing.reproject_vector(...)AnySee tool docs
resampleremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.resample(...)RasterRaster output
rescale_value_rangerastergeneralwbe.raster.rescale_value_range(...)RasterRaster output
rgb_to_ihsremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.rgb_to_ihs(...)tuple[Raster, Raster, Raster]Multiple outputs (tuple)
rho8_flow_accumhydrologyflow_routingwbe.hydrology.flow_routing.rho8_flow_accum(...)RasterRaster output
rho8_pointerhydrologyflow_routingwbe.hydrology.flow_routing.rho8_pointer(...)RasterRaster output
ridge_and_valley_vectorsterraingeneralwbe.terrain.ridge_and_valley_vectors(...)tuple[Vector, Vector]Multiple outputs (tuple)
ring_curvatureterrainderivativeswbe.terrain.derivatives.ring_curvature(...)RasterRaster output
river_centerlinesstreamsnetwork_extractionwbe.streams.network_extraction.river_centerlines(...)VectorVector output
river_corridor_health_assessmentterrainworkflow_productswbe.terrain.workflow_products.river_corridor_health_assessment(...)AnySee tool docs
roberts_cross_filterremote_sensingedge_feature_detectionwbe.remote_sensing.edge_feature_detection.roberts_cross_filter(...)RasterRaster output
root_mean_square_errorrastergeneralwbe.raster.root_mean_square_error(...)strReport/path string output
rotorterrainderivativeswbe.terrain.derivatives.rotor(...)RasterRaster output
roundrastergeneralwbe.raster.round(...)RasterRaster output
route_calibratevectorlinear_referencingwbe.vector.linear_referencing.route_calibrate(...)AnySee tool docs
route_event_governance_for_linear_assetsvectorlinear_referencingwbe.vector.linear_referencing.route_event_governance_for_linear_assets(...)AnySee tool docs
route_event_lines_from_layervectorlinear_referencingwbe.vector.linear_referencing.route_event_lines_from_layer(...)VectorVector output
route_event_lines_from_tablevectorlinear_referencingwbe.vector.linear_referencing.route_event_lines_from_table(...)VectorVector output
route_event_mergevectorlinear_referencingwbe.vector.linear_referencing.route_event_merge(...)AnySee tool docs
route_event_overlayvectorlinear_referencingwbe.vector.linear_referencing.route_event_overlay(...)AnySee tool docs
route_event_points_from_layervectorlinear_referencingwbe.vector.linear_referencing.route_event_points_from_layer(...)VectorVector output
route_event_points_from_tablevectorlinear_referencingwbe.vector.linear_referencing.route_event_points_from_table(...)VectorVector output
route_event_splitvectorlinear_referencingwbe.vector.linear_referencing.route_event_split(...)AnySee tool docs
route_measure_qavectorlinear_referencingwbe.vector.linear_referencing.route_measure_qa(...)AnySee tool docs
route_recalibratevectorlinear_referencingwbe.vector.linear_referencing.route_recalibrate(...)AnySee tool docs
ruggedness_indexterrainroughness_texturewbe.terrain.roughness_texture.ruggedness_index(...)RasterRaster output
sar_analysis_readinessremote_sensingsarwbe.remote_sensing.sar.sar_analysis_readiness(...)AnySee tool docs
sar_coregistrationremote_sensingsarwbe.remote_sensing.sar.sar_coregistration(...)AnySee tool docs
sar_interferogram_coherenceremote_sensingsarwbe.remote_sensing.sar.sar_interferogram_coherence(...)AnySee tool docs
savitzky_golay_2d_filterremote_sensingfilterswbe.remote_sensing.filters.savitzky_golay_2d_filter(...)RasterRaster output
scharr_filterremote_sensingfilterswbe.remote_sensing.filters.scharr_filter(...)RasterRaster output
sediment_transport_indexhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.sediment_transport_index(...)RasterRaster output
segment_graph_felzenszwalbremote_sensingobiawbe.remote_sensing.obia.segment_graph_felzenszwalb(...)RasterRaster output
segment_multiresolution_hierarchicalremote_sensingobiawbe.remote_sensing.obia.segment_multiresolution_hierarchical(...)tuple[Raster, Raster, str]Multiple outputs (tuple)
segment_scale_parameter_optimizerremote_sensingobiawbe.remote_sensing.obia.segment_scale_parameter_optimizer(...)strReport/path string output
segment_slic_superpixelsremote_sensingobiawbe.remote_sensing.obia.segment_slic_superpixels(...)RasterRaster output
segment_watershed_markersremote_sensingobiawbe.remote_sensing.obia.segment_watershed_markers(...)RasterRaster output
segments_merge_small_regionsremote_sensingobiawbe.remote_sensing.obia.segments_merge_small_regions(...)RasterRaster output
segments_split_low_cohesionremote_sensingobiawbe.remote_sensing.obia.segments_split_low_cohesion(...)RasterRaster output
segments_to_polygonsremote_sensingobiawbe.remote_sensing.obia.segments_to_polygons(...)strReport/path string output
select_by_locationvectoroverlay_analysiswbe.vector.overlay_analysis.select_by_location(...)VectorVector output
select_tiles_by_polygonlidario_managementwbe.lidar.io_management.select_tiles_by_polygon(...)strReport/path string output
service_area_planning_and_coverage_optimizationvectornetwork_analysiswbe.vector.network_analysis.service_area_planning_and_coverage_optimization(...)AnySee tool docs
set_nodata_valueconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.set_nodata_value(...)RasterRaster output
shadow_animationterrainvisibilitywbe.terrain.visibility.shadow_animation(...)tuple[str, str]Multiple outputs (tuple)
shadow_imageterrainvisibilitywbe.terrain.visibility.shadow_image(...)RasterRaster output
shape_complexity_index_rasterrastergeneralwbe.raster.shape_complexity_index_raster(...)RasterRaster output
shape_complexity_index_vectorvectorshape_metricswbe.vector.shape_metrics.shape_complexity_index_vector(...)VectorVector output
shape_indexterrainderivativeswbe.terrain.derivatives.shape_index(...)RasterRaster output
shortest_path_networkvectornetwork_analysiswbe.vector.network_analysis.shortest_path_network(...)VectorVector output
shreve_stream_magnitudestreamsordering_metricswbe.streams.ordering_metrics.shreve_stream_magnitude(...)RasterRaster output
sidewalk_vegetation_accessibility_monitoringlidarworkflow_productswbe.lidar.workflow_products.sidewalk_vegetation_accessibility_monitoring(...)AnySee tool docs
sieverastergeneralwbe.raster.sieve(...)RasterRaster output
sigmoidal_contrast_stretchremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.sigmoidal_contrast_stretch(...)RasterRaster output
simplify_featuresvectorgeometry_processingwbe.vector.geometry_processing.simplify_features(...)VectorVector output
sinrastergeneralwbe.raster.sin(...)RasterRaster output
singlepart_to_multipartconversiongeometry_topologywbe.conversion.geometry_topology.singlepart_to_multipart(...)VectorVector output
sinhrastergeneralwbe.raster.sinh(...)RasterRaster output
sinkhydrologydepressions_storagewbe.hydrology.depressions_storage.sink(...)RasterRaster output
sky_view_factorterrainvisibilitywbe.terrain.visibility.sky_view_factor(...)RasterRaster output
skyline_analysisterrainvisibilitywbe.terrain.visibility.skyline_analysis(...)tuple[Vector, str]Multiple outputs (tuple)
slopeterrainderivativeswbe.terrain.derivatives.slope(...)RasterRaster output
slope_vs_aspect_plotterraingeneralwbe.terrain.slope_vs_aspect_plot(...)strReport/path string output
slope_vs_elev_plotterraingeneralwbe.terrain.slope_vs_elev_plot(...)strReport/path string output
smooth_vectorsvectorgeometry_processingwbe.vector.geometry_processing.smooth_vectors(...)VectorVector output
smooth_vegetation_residualterraingeneralwbe.terrain.smooth_vegetation_residual(...)RasterRaster output
snap_endnodesvectorgeometry_processingwbe.vector.geometry_processing.snap_endnodes(...)VectorVector output
snap_events_to_routesvectorlinear_referencingwbe.vector.linear_referencing.snap_events_to_routes(...)AnySee tool docs
snap_points_to_networkvectornetwork_analysiswbe.vector.network_analysis.snap_points_to_network(...)AnySee tool docs
snap_pour_pointshydrologywatersheds_basinswbe.hydrology.watersheds_basins.snap_pour_points(...)VectorVector output
sobel_filterremote_sensingedge_feature_detectionwbe.remote_sensing.edge_feature_detection.sobel_filter(...)RasterRaster output
soil_landscape_classificationprecision_agriculturegeneralwbe.precision_agriculture.soil_landscape_classification(...)tuple[Raster, Raster, Vector, str]Multiple outputs (tuple)
solar_site_suitability_analysisterrainworkflow_productswbe.terrain.workflow_products.solar_site_suitability_analysis(...)AnySee tool docs
sort_lidarlidario_managementwbe.lidar.io_management.sort_lidar(...)LidarLiDAR output
spatial_joinvectoroverlay_analysiswbe.vector.overlay_analysis.spatial_join(...)VectorVector output
spectral_angle_mapperremote_sensingspectral_analyticswbe.remote_sensing.spectral_analytics.spectral_angle_mapper(...)AnySee tool docs
spectral_library_matchingremote_sensingspectral_analyticswbe.remote_sensing.spectral_analytics.spectral_library_matching(...)AnySee tool docs
spherical_std_dev_of_normalsterrainroughness_texturewbe.terrain.roughness_texture.spherical_std_dev_of_normals(...)RasterRaster output
split_colour_compositeremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.split_colour_composite(...)tuple[Raster, Raster, Raster]Multiple outputs (tuple)
split_lidarlidario_managementwbe.lidar.io_management.split_lidar(...)LidarLiDAR output
split_lines_at_intersectionsvectornetwork_analysiswbe.vector.network_analysis.split_lines_at_intersections(...)AnySee tool docs
split_vector_linesvectorgeometry_processingwbe.vector.geometry_processing.split_vector_lines(...)VectorVector output
split_with_linesvectorgeometry_processingwbe.vector.geometry_processing.split_with_lines(...)VectorVector output
sqrtrastergeneralwbe.raster.sqrt(...)RasterRaster output
squarerastergeneralwbe.raster.square(...)RasterRaster output
standard_deviation_contrast_stretchremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.standard_deviation_contrast_stretch(...)RasterRaster output
standard_deviation_filterremote_sensingfilterswbe.remote_sensing.filters.standard_deviation_filter(...)RasterRaster output
standard_deviation_of_slopeterrainroughness_texturewbe.terrain.roughness_texture.standard_deviation_of_slope(...)RasterRaster output
standard_deviation_overlayrasteroverlay_mathwbe.raster.overlay_math.standard_deviation_overlay(...)RasterRaster output
stochastic_depression_analysishydrologydepressions_storagewbe.hydrology.depressions_storage.stochastic_depression_analysis(...)RasterRaster output
strahler_order_basinsstreamsordering_metricswbe.streams.ordering_metrics.strahler_order_basins(...)RasterRaster output
strahler_stream_orderstreamsordering_metricswbe.streams.ordering_metrics.strahler_stream_order(...)RasterRaster output
stream_link_classstreamsordering_metricswbe.streams.ordering_metrics.stream_link_class(...)RasterRaster output
stream_link_identifierstreamsordering_metricswbe.streams.ordering_metrics.stream_link_identifier(...)RasterRaster output
stream_link_lengthstreamsordering_metricswbe.streams.ordering_metrics.stream_link_length(...)RasterRaster output
stream_link_slopestreamsordering_metricswbe.streams.ordering_metrics.stream_link_slope(...)RasterRaster output
stream_slope_continuousstreamsordering_metricswbe.streams.ordering_metrics.stream_slope_continuous(...)RasterRaster output
subbasinshydrologywatersheds_basinswbe.hydrology.watersheds_basins.subbasins(...)RasterRaster output
subtractrasteroverlay_mathwbe.raster.overlay_math.subtract(...)RasterRaster output
sum_overlayrasteroverlay_mathwbe.raster.overlay_math.sum_overlay(...)RasterRaster output
surface_area_ratioterraingeneralwbe.terrain.surface_area_ratio(...)RasterRaster output
svm_classificationremote_sensingclassificationwbe.remote_sensing.classification.svm_classification(...)RasterRaster output
svm_regressionremote_sensingclassificationwbe.remote_sensing.classification.svm_regression(...)RasterRaster output
symmetrical_differencevectoroverlay_analysiswbe.vector.overlay_analysis.symmetrical_difference(...)VectorVector output
tanrastergeneralwbe.raster.tan(...)RasterRaster output
tangential_curvatureterrainderivativeswbe.terrain.derivatives.tangential_curvature(...)RasterRaster output
tanhrastergeneralwbe.raster.tanh(...)RasterRaster output
terrain_constraint_and_conflict_analysisterrainworkflow_productswbe.terrain.workflow_products.terrain_constraint_and_conflict_analysis(...)AnySee tool docs
terrain_constructability_and_cost_analysisterrainworkflow_productswbe.terrain.workflow_products.terrain_constructability_and_cost_analysis(...)AnySee tool docs
terrain_corrected_optical_analyticsremote_sensingradiometric_correctionwbe.remote_sensing.radiometric_correction.terrain_corrected_optical_analytics(...)AnySee tool docs
thicken_raster_lineremote_sensingfilterswbe.remote_sensing.filters.thicken_raster_line(...)RasterRaster output
time_in_daylightterrainvisibilitywbe.terrain.visibility.time_in_daylight(...)RasterRaster output
time_series_change_intelligenceremote_sensingchange_detectionwbe.remote_sensing.change_detection.time_series_change_intelligence(...)tuple[Raster, Raster, Raster, Raster, str]Multiple outputs (tuple)
tin_interpolationrastergeneralwbe.raster.tin_interpolation(...)RasterRaster output
to_degreesrastergeneralwbe.raster.to_degrees(...)RasterRaster output
to_radiansrastergeneralwbe.raster.to_radians(...)RasterRaster output
tophat_transformremote_sensingfilterswbe.remote_sensing.filters.tophat_transform(...)RasterRaster output
topo_renderterrainworkflow_productswbe.terrain.workflow_products.topo_render(...)RasterRaster output
topographic_hachuresterraingeneralwbe.terrain.topographic_hachures(...)VectorVector output
topographic_position_animationterrainmultiscale_signatureswbe.terrain.multiscale_signatures.topographic_position_animation(...)tuple[str, str]Multiple outputs (tuple)
topological_breach_burnhydrologydepressions_storagewbe.hydrology.depressions_storage.topological_breach_burn(...)tuple[Raster, Raster, Raster, Raster]Multiple outputs (tuple)
topological_stream_orderstreamsordering_metricswbe.streams.ordering_metrics.topological_stream_order(...)RasterRaster output
topology_rule_autofixconversiongeometry_topologywbe.conversion.geometry_topology.topology_rule_autofix(...)AnySee tool docs
topology_rule_validateconversiongeometry_topologywbe.conversion.geometry_topology.topology_rule_validate(...)AnySee tool docs
topology_validation_reportconversiongeometry_topologywbe.conversion.geometry_topology.topology_validation_report(...)strReport/path string output
total_curvatureterrainderivativeswbe.terrain.derivatives.total_curvature(...)RasterRaster output
total_filterremote_sensingfilterswbe.remote_sensing.filters.total_filter(...)RasterRaster output
trace_downslope_flowpathshydrologyflow_routingwbe.hydrology.flow_routing.trace_downslope_flowpaths(...)RasterRaster output
transfer_attributesvectornetwork_analysiswbe.vector.network_analysis.transfer_attributes(...)AnySee tool docs
travelling_salesman_problemvectornetwork_analysiswbe.vector.network_analysis.travelling_salesman_problem(...)VectorVector output
trend_surfacerastergeneralwbe.raster.trend_surface(...)RasterRaster output
trend_surface_vector_pointsrastergeneralwbe.raster.trend_surface_vector_points(...)RasterRaster output
tributary_identifierstreamsordering_metricswbe.streams.ordering_metrics.tributary_identifier(...)RasterRaster output
true_colour_compositeremote_sensingenhancement_contrastwbe.remote_sensing.enhancement_contrast.true_colour_composite(...)AnySee tool docs
truncaterastergeneralwbe.raster.truncate(...)RasterRaster output
turning_bands_simulationrastergeneralwbe.raster.turning_bands_simulation(...)RasterRaster output
two_sample_ks_testrastergeneralwbe.raster.two_sample_ks_test(...)strReport/path string output
unionvectoroverlay_analysiswbe.vector.overlay_analysis.union(...)VectorVector output
unnest_basinshydrologywatersheds_basinswbe.hydrology.watersheds_basins.unnest_basins(...)list[Raster]Raster output
unsharp_maskingremote_sensingfilterswbe.remote_sensing.filters.unsharp_masking(...)RasterRaster output
unsphericityterrainderivativeswbe.terrain.derivatives.unsphericity(...)RasterRaster output
updatevectoroverlay_analysiswbe.vector.overlay_analysis.update(...)VectorVector output
update_nodata_cellsrasteroverlay_mathwbe.raster.overlay_math.update_nodata_cells(...)RasterRaster output
upslope_depression_storagehydrologydepressions_storagewbe.hydrology.depressions_storage.upslope_depression_storage(...)RasterRaster output
urban_expansion_impact_assessmentterrainworkflow_productswbe.terrain.workflow_products.urban_expansion_impact_assessment(...)AnySee tool docs
user_defined_weights_filterremote_sensingfilterswbe.remote_sensing.filters.user_defined_weights_filter(...)RasterRaster output
utility_corridor_encroachment_and_access_planningvectorworkflow_productswbe.vector.workflow_products.utility_corridor_encroachment_and_access_planning(...)AnySee tool docs
utility_corridor_encroachment_intelligenceterrainworkflow_productswbe.terrain.workflow_products.utility_corridor_encroachment_intelligence(...)AnySee tool docs
vector_hex_binningvectorsampling_griddingwbe.vector.sampling_gridding.vector_hex_binning(...)VectorVector output
vector_lines_to_rasterconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.vector_lines_to_raster(...)RasterRaster output
vector_points_to_rasterconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.vector_points_to_raster(...)RasterRaster output
vector_polygons_to_rasterconversionraster_vector_conversionwbe.conversion.raster_vector_conversion.vector_polygons_to_raster(...)RasterRaster output
vector_stream_network_analysisstreamsordering_metricswbe.streams.ordering_metrics.vector_stream_network_analysis(...)VectorVector output
vector_summary_statisticsconversionvector_table_iowbe.conversion.vector_table_io.vector_summary_statistics(...)strReport/path string output
vehicle_routing_cvrpvectornetwork_analysiswbe.vector.network_analysis.vehicle_routing_cvrp(...)AnySee tool docs
vehicle_routing_pickup_deliveryvectornetwork_analysiswbe.vector.network_analysis.vehicle_routing_pickup_delivery(...)AnySee tool docs
vehicle_routing_vrptwvectornetwork_analysiswbe.vector.network_analysis.vehicle_routing_vrptw(...)AnySee tool docs
vertical_excess_curvatureterrainderivativeswbe.terrain.derivatives.vertical_excess_curvature(...)RasterRaster output
viewshedterrainvisibilitywbe.terrain.visibility.viewshed(...)RasterRaster output
visibility_indexterrainvisibilitywbe.terrain.visibility.visibility_index(...)RasterRaster output
voronoi_diagramvectorsampling_griddingwbe.vector.sampling_gridding.voronoi_diagram(...)VectorVector output
watershedhydrologywatersheds_basinswbe.hydrology.watersheds_basins.watershed(...)RasterRaster output
watershed_from_raster_pour_pointshydrologywatersheds_basinswbe.hydrology.watersheds_basins.watershed_from_raster_pour_points(...)RasterRaster output
weighted_overlayrasteroverlay_mathwbe.raster.overlay_math.weighted_overlay(...)RasterRaster output
weighted_sumrasteroverlay_mathwbe.raster.overlay_math.weighted_sum(...)RasterRaster output
wetland_hydrogeomorphic_classificationterrainworkflow_productswbe.terrain.workflow_products.wetland_hydrogeomorphic_classification(...)AnySee tool docs
wetness_indexhydrologyhydrologic_indiceswbe.hydrology.hydrologic_indices.wetness_index(...)RasterRaster output
wiener_filterremote_sensingfilterswbe.remote_sensing.filters.wiener_filter(...)RasterRaster output
wilcoxon_signed_rank_testrastergeneralwbe.raster.wilcoxon_signed_rank_test(...)strReport/path string output
wildfire_fuel_loading_and_risk_matrixterrainworkflow_productswbe.terrain.workflow_products.wildfire_fuel_loading_and_risk_matrix(...)AnySee tool docs
wind_turbine_sitingterrainworkflow_productswbe.terrain.workflow_products.wind_turbine_siting(...)AnySee tool docs
wisart_iterative_clusteringremote_sensingsarwbe.remote_sensing.sar.wisart_iterative_clustering(...)RasterRaster output
write_function_memory_insertionremote_sensingchange_detectionwbe.remote_sensing.change_detection.write_function_memory_insertion(...)RasterRaster output
yamaguchi_4component_decompositionremote_sensingsarwbe.remote_sensing.sar.yamaguchi_4component_decomposition(...)AnySee tool docs
yield_data_conditioning_and_qaprecision_agriculturegeneralwbe.precision_agriculture.yield_data_conditioning_and_qa(...)AnySee tool docs
z_scoresrastergeneralwbe.raster.z_scores(...)RasterRaster output
zonal_statisticsrastergeneralwbe.raster.zonal_statistics(...)RasterRaster output

Script Index

Use this index to map manual chapters to runnable examples.

Use this chapter as a bridge from concept to execution. When adapting examples, start from the script closest to your data type and operational goal, then copy its structure before changing parameters. This tends to produce safer edits than assembling a workflow from isolated snippets.

Quick Start and Core API

  • crates/wbw_python/examples/quickstart_harmonized_api.py - minimal end-to-end startup and first tool run
  • crates/wbw_python/examples/wbenvironment_example.py - environment configuration and discovery baseline
  • crates/wbw_python/examples/current_api_data_handling_demo.py - data object handling patterns across core types

Raster Workflows

  • crates/wbw_python/examples/raster_numpy_roundtrip.py - single-band array conversion and writeback
  • crates/wbw_python/examples/raster_numpy_multiband_roundtrip.py - multiband array access and persistence
  • crates/wbw_python/examples/unary_raster_tools_example.py - tool-driven raster transform chain

Vector Workflows

  • crates/wbw_python/examples/vector_attributes_harmonized_api.py - schema inspection and attribute updates
  • crates/wbw_python/examples/vector_multifile_write_demo.py - format-aware vector export behavior
  • crates/wbw_python/examples/vector_topojson_roundtrip.py - TopoJSON read/write roundtrip workflow
  • crates/wbw_python/examples/osm_download_vector.py - OpenStreetMap download workflow via Overpass API

Lidar Workflows

  • crates/wbw_python/examples/lidar_write_options.py - LAZ and COPC output option tuning
  • crates/wbw_python/examples/lidar_numpy_roundtrip_smoke_test.py - point-field numpy roundtrip validation
  • crates/wbw_python/examples/lidar_chunked_pipeline.py - chunked processing pattern for large clouds

Sensor Bundle Workflows

  • crates/wbw_python/examples/sensor_bundle_overview.py - cross-family inspection and key discovery

Interoperability and Validation

  • crates/wbw_python/examples/interop_roundtrip_smoke_test.py - cross-library roundtrip sanity checks

Licensing

  • crates/wbw_python/examples/licensing_offline_example.py - local entitlement startup pattern
  • crates/wbw_python/examples/licensing_floating_online_example.py - floating-license provider bootstrap pattern

Dynamic Output Smoke Tests

  • crates/wbw_python/examples/dynamic_single_output_smoke_test.py - runtime single-output behavior checks
  • crates/wbw_python/examples/dynamic_multi_output_smoke_test.py - runtime multi-output behavior checks