Skip to main content

Hex labelling of trajectory data

Project description

hextraj

PyPI License:MIT Docs

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")

Project details


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.4.22.2.tar.gz (1.4 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.4.22.2-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hextraj-2026.4.22.2.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hextraj-2026.4.22.2.tar.gz
Algorithm Hash digest
SHA256 2aeb9206180296d831859086c7eccfa78ac76da6eb110026eda88ab4e907d61d
MD5 d61906f0a0224140ebba3cf313f0af1a
BLAKE2b-256 acaec9fcfa72ddc4c93d3d41d3eb1aeb477a6c83e49b2570844abe3b310dadc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for hextraj-2026.4.22.2.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.4.22.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for hextraj-2026.4.22.2-py3-none-any.whl
Algorithm Hash digest
SHA256 958664a70cf827437708a406e2073b38afc3fda20e6759b51320ce7ef7e1bfc3
MD5 e6e28f7f5ea06a8bd1853da9a1a626c5
BLAKE2b-256 4183957b8a27f9c1aa6dd43866c7bf58e34d0f18828bce0ac69ed424e4340bb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for hextraj-2026.4.22.2-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.

Supported by

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