Skip to main content

burin-core

A deterministic, equal-area fingerprint of a geographic region. Give it a polygon and a resolution; it returns a 32-byte root that anyone, in any language, recomputes from the same polygon and the same profile, down to the last bit. Two encodings of the same footprint (a COG, a Zarr, a different tiling) produce one root. Two roots can be unioned, intersected, differenced and compared without exchanging the geometry, and a cell can be proven inside or outside a root with a short opening.

The ground is cut into the rHEALPix discrete global grid (the OGC API-DGGS Annex B registered grid, lon_0 = 50, WGS84), which is exactly equal-area and exactly hierarchical: nine children tile their parent, so a region held as one cell and the same region spelled out to the leaves hash identically (the roll-up). Hashing is SHA-256 with domain-tagged nodes. The hash, the grid parameters, and the time convention are bound into a profile whose identity is derived from its integers, never transmitted.

Apache-2.0. Rust core with a Python wheel (not yet on PyPI: build it with maturin build --release, or point uv at this checkout with burin-core = { path = "../burin-core" } under [tool.uv.sources]); a JavaScript build is planned. The vocabulary of OGC API - DGGS (zone, refinement level, compact zone list, DGGRS) maps onto the spec one to one; see SPEC.md §7. The projection is a port of the reference implementation rhealpixdggs-py (MIT), kept in bit-level parity by the fixtures under crates/burin-core/tests/fixtures.

Python

import burin as bc

aoi = {"type": "Polygon", "coordinates": [[[-0.13, 51.50], [-0.10, 51.50], [-0.10, 51.52], [-0.13, 51.52], [-0.13, 51.50]]]}

bc.fingerprint_polygon(aoi, resolution=10)          # '…' 64 hex chars; same polygon → same bytes, anywhere
bc.OGC_RHEALPIX.id_hex()                            # the profile identity the root is read against

t = bc.Tree.from_geojson(aoi, 10)                   # the canonical coverage
t.cells()                                           # coarsest covered cell ids; t.leaves() expands them
u = t.union(bc.Tree.from_geojson(other, 10))        # set algebra over coverages
proof = t.prove(u, "union"); bc.verify_setop(proof) # a transcript a verifier replays with no geometry
op = t.open(bc.suid_to_cid("Q453")); bc.verify_opening(op)   # membership / non-membership
bc.subzones(bc.suid_to_cid("Q4"), 2)              # sub-zones in the OGC scanline order (SPEC §8)
bc.neighbours(bc.suid_to_cid("Q453"))             # {'up': …, 'right': …, 'down': …, 'left': …}
bc.Tree.from_geojson(aoi, 6).raster()              # uint8 bytes, shape (6, 3**6, 3**6); halo_index(6) pads it
t.to_dggs_json(bc.suid_to_cid("Q"))                 # OGC DGGS-JSON zone data; bc.Tree.from_dggs_json reads it back

Arrays in, arrays out, spread over threads (nthreads=0 uses them all):

import numpy as np

cells = bc.cells_from_lonlat(lon, lat, level=9)     # uint64, the shape of lon/lat (SPEC §8 "Points")
lon_c, lat_c = bc.cells_to_lonlat(cells)            # each cell's nucleus
coords, offsets = bc.cell_boundaries(cells)         # ragged rings: cell i is coords[offsets[i]:offsets[i+1]]
bc.cell_neighbours(cells)                           # (..., 4): up, right, down, left
bc.zoom_to(cells, 9, 7)                             # ancestors; to a finer level, (..., 9**k) descendants
bc.full_domain(3)                                   # every cell at a level: cids fill [9**(r+1), 15*9**r)
bc.Tree.from_cells(cells, 9).root_hex               # the fingerprint of any set of cells

Rust

use burin_core::{fingerprint_geojson, Profile};
let root = fingerprint_geojson(&geojson, 10, &Profile::ogc())?;

The rule, in one paragraph

A polygon's cells at resolution R are the depth-R rHEALPix cells whose nucleus (the inverse projection of the planar cell centre) the polygon contains, boundary excluded. The set is held in its coarsest form and hashed bottom-up: leaf_empty = H(0x00), leaf_full = H(0x01), node = H(0x02 ‖ c₀‖…‖c₈), root = H(0x03 ‖ b₀‖…‖b₅); a constant subtree hashes to its ladder value, so tiling does not matter. The profile identity is SHA-256("BURIN-PROFILE-1" ‖ hash id ‖ A ‖ B ‖ lon_0 in µdeg ‖ polar squares ‖ a in µm ‖ 1/f in nano ‖ tick ‖ epoch). N^-r is the reciprocal of the exact integer N^r. See SPEC.md.

Development

cargo test -p burin-core                      # parity fixtures + structural properties
uv run --no-project --with rhealpixdggs==0.8.6 --with shapely python tools/gen_fixtures.py   # regenerate set 1
cargo run -p burin-core --example freeze     # regenerate set 2 (golden roots; a wire-format bump)
uv venv && uv pip install maturin pytest && uv run maturin develop && uv run pytest
cd fuzz && cargo +nightly fuzz run opening_record corpus/opening_record seeds/opening_record   # any target in fuzz/

Which outputs are frozen and how versions move are in STABILITY.md; what changed is in CHANGELOG.md.

Release files for burin-core 0.2.0

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

Built distributions (wheels)

Table of built distributions (wheels) for burin-core 0.2.0
File
burin_core-0.2.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
burin_core-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
burin_core-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
burin_core-0.2.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
burin_core-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 3.2 MB

Release files / burin_core-0.2.0-cp39-abi3-win_amd64.whl

Download URL burin_core-0.2.0-cp39-abi3-win_amd64.whl
Size 562.5 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3ad2eae63fce60f9e6f146cec5654178fc448147058bb1ddf168851a8a7ef8bb
BLAKE2b-256 checksum
How to use checksums
eed8197825b8c4d339146310cf03cf4ba138db74fbf3d8a1c1babd17429bd1a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / burin_core-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL burin_core-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 705.4 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3e7da4f3adea3f46226d25a80f60e36e605810b57d141415c43000ef4878c508
BLAKE2b-256 checksum
How to use checksums
7e2569f68eee2186a0e53a0308bc11d14e6eb0a1f85010acbe30129d86a61b0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / burin_core-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL burin_core-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 670.6 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
5a17b7a56b03b23951e18b63abd18a2af384fd6d18aef530aaa61f7c7c3fd3c2
BLAKE2b-256 checksum
How to use checksums
08e289b096685e9bf386d80e525f35efe521ce552a8849d5e1261b67b87baeac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / burin_core-0.2.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL burin_core-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Size 615.0 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
564cd0af3839f64c474d603c5ca6d710c734c647d86b9456f528906dab2f3b05
BLAKE2b-256 checksum
How to use checksums
6b5543e3c996d8145570c53eaf37f5b64bf156e25ed65d644026919ecda71c90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / burin_core-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL burin_core-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 653.3 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e37b2fe637d4870c653ddb28f2239e3412fe1d02d3e267fdfb12749da5f1c760
BLAKE2b-256 checksum
How to use checksums
d0a5442be48621c2819adecf6c120a5f63f6073f673fc8e9eebed8e1d8feda85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

5 release files

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