Skip to main content

hextraj

PyPI License:MIT Docs DOI

Hex labelling of trajectory data.

Hex region OD connectivity
Hex region example OD connectivity example
hex_aggregation.ipynb hex_conn_dask.ipynb

Maps lon/lat positions to a projected hexagonal grid and provides tools for aggregation and connectivity analysis.

  • hex_counts — heat maps and density aggregation
  • hex_connectivity — origin-destination matrices
  • hex_connectivity_power — multi-generation transport probabilities
  • hex_connectivity_dask — lazy dask-native connectivity for large datasets
  • Full dask support throughout

Getting started

Explore the notebooks:

Installation

pip install hextraj

With dask, scipy, and cartopy:

pip install hextraj[full]

Or from source:

pip install git+https://github.com/willirath/hextraj.git@main

Quick example

from hextraj import HexProj

hp = HexProj(lon_origin=-3.0, lat_origin=54.0, hex_size_meters=50_000)

# Label positions → int64 hex IDs
hex_ids = hp.label(lon, lat)

# Build a GeoDataFrame with Polygon geometries
gdf = hp.to_geodataframe(hp.region_of_hexes(region_polygon))
gdf["count"] = counts.reindex(gdf.index).fillna(0)
gdf.plot(column="count", cmap="YlOrRd")

Citing

Cite hextraj through its DOI. 10.5281/zenodo.22040740 is the concept DOI, and it resolves to the most recent release. Zenodo mints a separate DOI for each release, so use that one to pin an exact version.

CITATION.cff holds the same metadata. GitHub renders it as BibTeX or APA under "Cite this repository".

Download files

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

Source Distribution

hextraj-2026.8.21.3.tar.gz (5.0 MB view details)

Uploaded Source

Built Distribution

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

hextraj-2026.8.21.3-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file hextraj-2026.8.21.3.tar.gz.

File metadata

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

File hashes

Hashes for hextraj-2026.8.21.3.tar.gz
Algorithm Hash digest
SHA256 0404c1db3389c23ba2e17610a78e2ee7522b49b3fbcc172dffc1e6740e5de618
MD5 7961fa747cbf652a46aae0a3d92a8848
BLAKE2b-256 3c0704f6f01b8196508d8ec0350d19a843239a4cea01a78e8b6d6a9253d07663

See more details on using hashes here.

Provenance

The following attestation bundles were made for hextraj-2026.8.21.3.tar.gz:

Publisher: release.yml on willirath/hextraj

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

File details

Details for the file hextraj-2026.8.21.3-py3-none-any.whl.

File metadata

  • Download URL: hextraj-2026.8.21.3-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hextraj-2026.8.21.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b1553894b0d3b96e0ed589ec6b711aceedbea2aea81d2c58c02b76f1d124268a
MD5 4cd177d703127aa26f2209ab315e0256
BLAKE2b-256 512f1ae84438fa69257ff7c4b01adf87e11383fd817e82a50d3c27a559b24e09

See more details on using hashes here.

Provenance

The following attestation bundles were made for hextraj-2026.8.21.3-py3-none-any.whl:

Publisher: release.yml on willirath/hextraj

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

Release history Release notifications | RSS feed

2026.8.21.5

2 files

2026.8.21.4

2 files

This release

2026.8.21.3 This release

2 files

2026.8.21.2

2 files

2026.8.21.1

2 files

2026.4.23.3

2 files

2026.4.23.2

2 files

2026.4.22.2

2 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