This release is a pre-release and may not be stable for production use.
isobands
In seconds, isobands turns a two-dimensional
xarray raster into filled contour polygons, using GDAL's
in-memory raster and vector datasets.
It is useful when a few lines of Python should turn gridded values into
analysis-ready GeoPandas geometry—without writing
intermediate files.
Alpha: the public API is small and may change before a stable release.
Install
isobands requires GDAL 3.12.2, including the matching system development
headers. PyPI's GDAL distribution is source-only: it compiles against the
system library, so pip alone cannot install the system GDAL prerequisite.
Install GDAL 3.12.2 with your Unix or macOS package manager (or build that version), then verify the development installation:
gdal-config --version # must print 3.12.2
On Windows, conda-forge is recommended:
conda install -c conda-forge gdal=3.12.2
After the matching GDAL installation is available:
pip install isobands
Contributors can install all locked development and documentation dependencies
with make install; this also checks gdal-config.
Quick start
This complete example uses only an in-memory array:
import geopandas as gpd
import numpy as np
import xarray as xr
from isobands 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: gpd.GeoDataFrame = isobands(data, levels=[1.5, 2.5], crs="EPSG:4326")
print(bands[["min_value", "max_value", "geometry"]])
The result has min_value, max_value, and geometry columns. Use
levels=[...] for explicit interior thresholds or interval=... for
thresholds at integral multiples of an interval. Exactly one is required;
interval mode is limited to 100,000 interior thresholds.
Disconnected or nodata-separated regions can produce multiple rows with the same value bounds. Use ordinary GeoPandas operations if a dissolved band is needed.
Behavior and limits
- Input is a numeric
xarray.DataArraywith exactly two nonsingleton dimensions; singleton dimensions may be squeezed. - Spatial coordinates must be regular, one-dimensional rectilinear axes. CF metadata is preferred when discovering x/y axes. Ascending and descending axes work; curvilinear, irregular, ambiguous, and missing axes fail clearly.
- Explicit
crswins over registered rioxarray metadata, then recognized CF/grid-mapping/spatial-reference metadata. Coordinate names never imply a CRS. - Explicit finite
nodatawins over_FillValue/missing_value; otherwise nonfinite floating cells are nodata. An all-nodata raster is invalid. - Explicit levels outside the data range are ignored and outer bands use the finite valid extrema. Values equal to a threshold belong to the upper band. Constant rasters produce one full-coverage band with equal labels.
- Holes, multipart geometry, CRS, and Dask-backed input (materialized eagerly) are preserved.
See the Sphinx documentation source for installation details, full API semantics, and limitations. Contributor instructions are in CONTRIBUTING.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file isobands-0.1.0a1.tar.gz.
File metadata
- Download URL: isobands-0.1.0a1.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a76351a88deca9fe5d605425eea113a1ba2e193ff5b7e05008fff785a8cc827c
|
|
| MD5 |
565d28eaadd8910d51c61135bc12c275
|
|
| BLAKE2b-256 |
8664fbb5a6ad39de4aab901dfb84a57d8ba92d002a5002e74cee3278b250da05
|
Provenance
The following attestation bundles were made for isobands-0.1.0a1.tar.gz:
Publisher:
continuous-deployment.yaml on palewire/isobands
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
isobands-0.1.0a1.tar.gz -
Subject digest:
a76351a88deca9fe5d605425eea113a1ba2e193ff5b7e05008fff785a8cc827c - Sigstore transparency entry: 2502408335
- Sigstore integration time:
-
Permalink:
palewire/isobands@ebf42aa6c13a97fc5550f74b361df641de9ebdde -
Branch / Tag:
refs/tags/0.1.0a1 - Owner: https://github.com/palewire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
continuous-deployment.yaml@ebf42aa6c13a97fc5550f74b361df641de9ebdde -
Trigger Event:
push
-
Statement type:
File details
Details for the file isobands-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: isobands-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42b9a60382e46dce917e2f7eba1ac8ffd4e852854ab5acc5f3bb9e7089bfe639
|
|
| MD5 |
cb556376f2d20146017ef2c9df6c9894
|
|
| BLAKE2b-256 |
cc45eceefe35e85b1ace55289d2aad6469c3d75e8ee4036bdb4fb0b4d81f90ad
|
Provenance
The following attestation bundles were made for isobands-0.1.0a1-py3-none-any.whl:
Publisher:
continuous-deployment.yaml on palewire/isobands
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
isobands-0.1.0a1-py3-none-any.whl -
Subject digest:
42b9a60382e46dce917e2f7eba1ac8ffd4e852854ab5acc5f3bb9e7089bfe639 - Sigstore transparency entry: 2502408877
- Sigstore integration time:
-
Permalink:
palewire/isobands@ebf42aa6c13a97fc5550f74b361df641de9ebdde -
Branch / Tag:
refs/tags/0.1.0a1 - Owner: https://github.com/palewire
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
continuous-deployment.yaml@ebf42aa6c13a97fc5550f74b361df641de9ebdde -
Trigger Event:
push
-
Statement type: