Skip to main content

topobathykit

Python 3.12+ License

Fused topobathymetry of the Race, at the eastern end of Long Island Sound, in the topobathykit 3D DEM viewer (click to play the video)

A 37 s flight along the North Fork of Long Island and out over the Race in the 3D DEM viewer (click the image to play). The readout names the source survey under the cursor, from per-pixel provenance.

Policy-driven topobathymetric fusion runtime for data-first digital worlds.

topobathykit fuses heterogeneous elevation sources (global bathymetry, global land DEMs, and optional high‑resolution regional datasets) into seamless, analysis- and simulation-ready grids. It produces data-first outputs (xarray.Dataset) with per-pixel provenance (source masks), and optionally serves the same products over HTTP for real-time clients.

  • Primary output: arrays + provenance, not pretty pictures
  • PNG tiles and the viewer are debug/QA tools (seams, datum issues, coverage), not the product
  • Fusion behavior is defined by YAML policy presets you can edit and share

topobathykit was named topobathysim until 2026-10-05 ("-sim" is reserved for code that runs simulations); GitHub redirects the old repository URLs. The package is topobathykit; import topobathysim still works for one release, with a DeprecationWarning. Environment variables use the TOPOBATHYKIT_ prefix (the TOPOBATHYSIM_ names are still read, with a warning), the default cache is ~/.cache/topobathykit, and the conda environment is topobathykit.

What you can do

  • Generate a fused DEM anywhere from a global basemap policy (coarse but robust) with clear provenance.
  • Overlay regional high-resolution datasets (e.g., GBR100) on top of the basemap and blend edges smoothly.
  • In data-rich coastal regions, prioritize “survey truth” (e.g., BAG / topobathy lidar) over compiled products, while retaining global fallbacks.
  • Run a local tile/data service for Unity/Unreal/Omniverse workflows:
    • request fused elevation grids for simulation
    • visualize seams and provenance in the viewer for QA

Core concepts

1) Providers

A provider fetches a dataset layer (elevation or covariate), normalizes CRS/metadata, caches locally, and returns an xarray.DataArray.

Providers can be global (e.g., GEBCO + global land DEMs), regional compiled products (e.g., BlueTopo), or local high-resolution surveys (e.g., BAG, topobathy lidar). Adding a provider is the main contribution pathway.

2) Policies (YAML)

A policy is a YAML file that defines per-variable fusion strategies:

  • which providers participate
  • how to overwrite in trusted zones
  • how to blend in transition zones
  • fallback order for gap filling
  • required outputs (e.g., source masks)

Policies are selected by filename, so you can keep policy presets in the repo (or your own project) and share them easily.

3) Operators

An operator is a pure, testable transformation used by policies (e.g., seamline feathering in meters for smooth edges).

4) Provenance (first-class)

Every fused variable includes a source mask (e.g., source_elevation) identifying the contributing provider for each pixel. Provenance is how you debug seams and validate that “truth” data really won.

Data sources and built-in providers

topobathykit includes a growing catalog of dataset providers. The current set reflects our initial focus on the Northeast US (where we have dense public coastal survey coverage). We warmly welcome contributors adding providers and policy presets for the EU, Asia-Pacific, and other regions.

Global basemap (worldwide)

  • GEBCO 2025 (global topo+bathy baseline)
  • Global land DEMs via STAC (e.g., Copernicus DEM / NASADEM where available)

Regional compiled bathymetry (mostly US coastal)

  • NOAA BlueTopo™ (compiled best-available bathymetry for US waters)
  • NOAA CUDEM (Ninth Arc-Second Topobathy) (regional integrated tiles; useful as a coastal gap-filler)

Local high-resolution “truth” layers (survey / lidar)

These layers are typically prioritized where they exist and may overwrite compiled products.

  • NOAA NCEI BAG (Bathymetric Attributed Grids) High-resolution multibeam/sonar survey grids. When present, these are treated as “survey truth” for bathymetry.

  • NOAA Topobathymetric Lidar (green lidar) Nearshore shallow-water bottom mapping (intertidal/subtidal) that complements airborne topographic lidar.

  • USGS 3DEP / coastal lidar (topography) High-resolution land elevation, often used to mask water noise and sharpen the land–water interface.

See docs/source/data_sources.rst for citations and acknowledgements.

Docker

The service can be built and run in Docker. The Dockerfile defaults to nvidia/cuda:12.6.3-devel-ubuntu24.04 (x86_64). Override BASE_IMAGE for other targets:

# x86_64 / WSL2 with NVIDIA GPU (default)
docker build -t topobathykit .
docker run --rm --gpus all -p 9595:9595 topobathykit

# NVIDIA Jetson AGX Orin (JetPack 6.x)
docker build --build-arg BASE_IMAGE=nvcr.io/nvidia/l4t-jetpack:r36.2.0 -t topobathykit .
docker run --rm --gpus all -p 9595:9595 topobathykit

# macOS (Apple Silicon or Intel) via OrbStack / Docker Desktop — no GPU
docker build --build-arg BASE_IMAGE=ubuntu:24.04 -t topobathykit .
docker run --rm -p 9595:9595 topobathykit

Validated platforms: x86_64 (RTX 5080, CUDA 12.6, Ubuntu 24.04), NVIDIA Jetson AGX Orin (JetPack 6.1 / L4T r36.2), and macOS Apple Silicon (OrbStack).

Quick start (library)

Install (editable is recommended for development):

git clone https://github.com/lhzn-io/topobathykit.git
cd topobathykit
pip install -e .

Fuse elevation for a bounding box using a policy preset:

from topobathykit.runtime import run

# bbox = (west, south, east, north)
ds = run(
    "policies/examples/wlis.yaml",
    bbox=(-74.05, 40.65, -73.70, 40.95),
    resolution=30.0,
)

print(ds)
# ds["elevation"] -> float grid
# ds["source_elevation"] -> per-pixel provider id

Write a GeoTIFF (elevation only):

import rioxarray  # noqa: F401  (ensures .rio accessor)

ds["elevation"].rio.to_raster("fused_elevation.tif")

Quick start (service)

Run the server:

python service/run_server.py --host 0.0.0.0 --port 9595 --workers 4

Open the viewer:

Use the viewer to:

  • inspect seams and coverage
  • switch to provenance/source view
  • verify that the policy is doing what you expect

For cache sizing and practical runtime expectations, see the documentation page: docs/source/performance.rst.

Example policies live in policies/examples/:

  • policies/examples/wlis.yaml US coastal topobathy fusion in EPSG:3857: GEBCO as the global base, then USGS 3DEP and lidar on land, NCEI CUDEM, BlueTopo, NOAA topobathy lidar and NCEI BAG surveys where available, each overwriting the layers below.

  • policies/examples/gbr_overlay.yaml Overlays a high-resolution regional dataset (GBR100, about 100 m) on the global GEBCO basemap with a 500 m metric feather, in EPSG:4326.

Output contract (data-first)

topobathykit’s canonical output is an xarray.Dataset:

  • elevation (y, x) — fused elevation/depth in meters
  • source_elevation (y, x) — integer source mask (provider ID per pixel)

Metadata is attached at the dataset and variable level, including:

  • policy_hash (stable hash of the YAML policy)
  • provider legend (mapping source IDs to provider names)
  • CRS and vertical reference assumptions

International-friendly by design

topobathykit is global-first: you can run it anywhere with the global basemap policy.

Some datasets and datum transformations are region-specific. When vertical datum or reference is ambiguous, topobathykit surfaces this explicitly in metadata and provenance rather than hiding assumptions.

Contributing

Add a provider (best first contribution)

  • Implement the Provider interface (fetch → normalize → cache → return DataArray + metadata).
  • Add a policy preset that uses your provider.
  • Add/update docs and citations.

If you’re outside the US: we would especially value providers and policy presets for:

  • national hydrographic office products
  • EMODnet / Copernicus Marine / regional lidar catalogs
  • local survey archives and higher-update-frequency coastal products

Add a policy preset

If you have domain expertise for a region, you can encode it as a policy preset:

  • overwrite in trusted zones
  • blend at edges
  • fill gaps in a sensible order
  • publish provenance expectations

Documentation

  • docs/source/ — API, methodology, CLI tools
  • docs/planning/roadmap.md — roadmap (including time-varying covariates and Sentinel plans)
  • policies/examples/: example policies

Built with agentic engineering

topobathykit is developed using agentic engineering practices — professional software development amplified by AI coding agents. The tools we use include Antigravity and Claude Code.

Domain expertise, architectural decisions, and quality judgment remain human responsibilities. The agents accelerate implementation, catch bugs, and handle boilerplate — but every provider, policy, and fusion strategy reflects deliberate engineering choices informed by geospatial domain knowledge.

License

MIT License (code). Datasets are provided by third parties under their respective terms; see docs/source/data_sources.rst and provider metadata for citations and licensing notes.

Metadata

Release files for topobathykit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for topobathykit 0.2.0
File Size Uploaded Provenance Actions
topobathykit-0.2.0.tar.gz 17.8 MB With provenance Details for topobathykit-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for topobathykit 0.2.0
File Interpreter ABI Platform Actions
topobathykit-0.2.0-py3-none-any.whl Python 3 none any Details for topobathykit-0.2.0-py3-none-any.whl

Total release size: 18.0 MB

Release files / topobathykit-0.2.0.tar.gz

Download URL topobathykit-0.2.0.tar.gz
Size 17.8 MB
Tags Source
SHA-256 checksum
How to use checksums
7ebfcf0f9fa0e91c9ac3a7f967ed02c570f082dc7cf99a778fdec880fddb9969
BLAKE2b-256 checksum
How to use checksums
7107ccabdc250b3f14990a998bc30bfcc8843c9b6b49ea81bb999719ebec1155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / topobathykit-0.2.0-py3-none-any.whl

Download URL topobathykit-0.2.0-py3-none-any.whl
Size 194.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9addd28292f86108b603ca7988f2b52611a256bb4f3d7904f85990b70f022c73
BLAKE2b-256 checksum
How to use checksums
e6db0a8e97f759a0f3f7e2b1a6c97a52903322b9db2c6194ed02456084262ba7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for topobathykit 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for topobathykit-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page