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

Publish a fingerprint; answer questions against it with a proof:

import burin

park = burin.Tree.from_geojson(outline, 11)         # a place, as equal-area cells about 50 m across
print(park.fingerprint)                             # burin:ogc-rhealpix:space:11:f0a5… — publish this line

proof = park.prove_point(lon, lat)                  # made by whoever holds the set
fp = burin.Fingerprint.parse(published_line)        # held by whoever checks
fp.check_point(proof, lon, lat)                     # True / False, or raises burin.InvalidProof

examples/central_park.py does this for a place and its opening hours together. What a check establishes, and what it does not, is in THREAT_MODEL.md.

The rest of the interface:

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

Time has the same program (SPEC §9–§12): instants in, integer ticks and time cells out, exactly.

from burin import time as bt

bt.ticks(times)                                     # datetime64 of any unit → uint64 ticks (1 µs by default)
bt.cells_from_times(times, level=40)                # the time cell containing each instant
start, end = bt.times_of_cells(cells_t)             # each cell's [start, end) as datetime64[us]
day = bt.tree([("2013-07-15", "2013-07-16")])       # a time set; day.root_hex is its fingerprint
bt.allen(bt.interval("2013-07-01", "2013-08-01"), bt.interval("2013-07-15", "2013-07-16"))   # 'contains'
t.holds(u, "within"); bc.verify_relation("within", t.root_hex, u.root_hex, t.relation_evidence(u, "within"))

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. Space-time is drafted in SPEC-time.md (not yet implemented).

examples/central_park.py puts space and time together end to end: a publisher fingerprints a park and its opening hours, and a verifier holding only those 64 bytes checks whether a photo was taken in the park while it was open.

Metadata

Release files for burin-core 0.3.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 burin-core 0.3.0
File Size Uploaded
burin_core-0.3.0.tar.gz 1.2 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for burin-core 0.3.0
File
burin_core-0.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
burin_core-0.3.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.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
burin_core-0.3.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
burin_core-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 4.6 MB

Release files / burin_core-0.3.0.tar.gz

Download URL burin_core-0.3.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
96d2bec8bc50f161e926b1ebbf7b408376b2a018f4fd1ef5de621de6ec1bd02e
BLAKE2b-256 checksum
How to use checksums
11c9be36b57ce4c034139c3746c3c56db239ac998ab3f04a50ac8c6c18845b01
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 26, 2026.

Transparency log

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

Download URL burin_core-0.3.0-cp39-abi3-win_amd64.whl
Size 620.4 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
30545111a8c6956aaf652565328aa834d5a79cae8a8c0d80b6f2be7628c3ff28
BLAKE2b-256 checksum
How to use checksums
bfb2c38b2345911fa0979c08546b9045bcb60bf4cde898fc484b980940516625
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 26, 2026.

Transparency log

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

Download URL burin_core-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 761.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
abcc8a09947d4b9b19fd11fb27f6a189031051aad6914e75fcf465c1631ac5ac
BLAKE2b-256 checksum
How to use checksums
fb63f33347bef8909b0e5fbdb89631ea10b0d5b8dc4deba8b38093a2d99e1703
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 26, 2026.

Transparency log

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

Download URL burin_core-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 727.0 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a13cd8fabeb8c947c9f0fac6752b302f9f26ff8f3fbcfe4e0767b5398afd2890
BLAKE2b-256 checksum
How to use checksums
945110b7bd8156d230b72cdb4552f8c44e9ae2e04cb99adf8b989bd37ff5ebc6
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 26, 2026.

Transparency log

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

Download URL burin_core-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
Size 670.3 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a5f0237a0c4a2270a5e063b3cb6226f39827f94ba4f32f9b7b18c5f748075932
BLAKE2b-256 checksum
How to use checksums
c4c812321f9e81e7ec21059ea762d88c9bc27f346fb149c491225bc480e25e26
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 26, 2026.

Transparency log

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

Download URL burin_core-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 708.5 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d5408cdf3948109d3b111f7df730c00561e919d7d84fcf23f042d261e1ba49c7
BLAKE2b-256 checksum
How to use checksums
eba78594bdedbb77b338d90f69ac099ecf650533ee298ff3071c0e66074b4eec
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 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

6 release files

0.2.0

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