Skip to main content

isobands

An easy way to make filled contour maps with Python.

isobands converts a regular two-dimensional xarray raster into filled contour polygons backed by a GeoPandas GeoDataFrame.

Install

isobands needs an installed, matching osgeo.gdal Python binding. If your Conda or system-managed environment already provides one of the tested baselines, install the package directly:

pip install isobands

For a pip-managed binding, install matching native GDAL 3.13.2 development files, then use the recommended newest tested and installable extra:

pip install "isobands[gdal313]"

GDAL 3.10.2, 3.11.5, and 3.12.2 remain tested compatibility choices through the matching gdal310, gdal311, and gdal312 extras. See the installation guide for exact versions and platform instructions.

Quick start

import numpy as np
import xarray as xr

import isobands

data = xr.DataArray(
    np.array([[0.0, 1.0, 2.0], [1.0, 2.0, 3.0], [2.0, 3.0, 4.0]]),
    dims=("y", "x"),
    coords={"x": [0.0, 1.0, 2.0], "y": [2.0, 1.0, 0.0]},
)
bands = isobands.from_raster(data, levels=[1.5, 2.5], crs="EPSG:4326")
print(bands[["min_value", "max_value", "geometry"]])

The result always has the stable min_value, max_value, and geometry columns and a GeoPandas CRS. Exactly one of levels or interval is required. Use levels for strictly increasing interior thresholds, or interval for integral thresholds. Values equal to a threshold belong to the upper band.

Regular one-dimensional rectilinear coordinates are required, and coordinate names do not imply a CRS. Pass crs= explicitly when metadata is absent or ambiguous. Explicit finite nodata takes precedence over _FillValue and missing_value; otherwise nonfinite cells are excluded. Dask-backed arrays are materialized eagerly for GDAL's in-memory dataset. See the guide for usage examples and the API reference.

Real-world example

The runnable NOAA/NCEP example uses the pinned fixture in examples/data/, calls from_raster() with Kelvin levels and EPSG:4326, checks the schema, CRS, and geometry validity, and dissolves components with GeoPandas:

python examples/air_temperature.py

The ERA5 MapLibre example downloads the global daily high temperature for August 16, 2020, creates five-degree Celsius isobands, and writes GeoJSON for the accompanying era5_maplibre.html page. It requires a Copernicus Climate Data Store API key and the optional cdsapi, h5netcdf, and h5py packages.

Documentation

The hosted documentation is intended for palewi.re/docs/isobands/. The source is in docs/, with a single-page guide covering installation, quick start, the API reference, and the MapLibre example. Benchmarks and their reference data remain in benchmarks/.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isobands-0.2.0.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

isobands-0.2.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file isobands-0.2.0.tar.gz.

File metadata

  • Download URL: isobands-0.2.0.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for isobands-0.2.0.tar.gz
Algorithm Hash digest
SHA256 548952ddfa6721ed161cde0bb38f1aca6973ac1f7554026a2cbabb1bf4736efa
MD5 f63b39b80398299ec1a3828957fb692e
BLAKE2b-256 5029fa851663d6dd78b9f7ddbf091a74348496681723b5d0263977f99de190a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for isobands-0.2.0.tar.gz:

Publisher: continuous-deployment.yaml on palewire/isobands

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file isobands-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: isobands-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for isobands-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35c8b5fd3abd09fe152a0bb61f90e74cc9c9414689924d4ae62da0177e683611
MD5 5c7f06cbdfaa60fe36ba266b1c223460
BLAKE2b-256 a23d931de0cf2f297114a8dc8c96b9ca42925c76c1730c9a33c3d68d833b9047

See more details on using hashes here.

Provenance

The following attestation bundles were made for isobands-0.2.0-py3-none-any.whl:

Publisher: continuous-deployment.yaml on palewire/isobands

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page