Skip to main content

Module h3

Module h3 

Source
Expand description

H3 hexagonal hierarchical spatial index.

Uber’s H3 system maps the globe into hexagonal cells at 16 resolutions (0 = ~4.3M km² to 15 = ~0.9 m²). Advantages over geohash:

  • Uniform cell area (no pole distortion)
  • Hexagonal tessellation (6 equidistant neighbors vs 8 unequal for geohash)
  • Better for analytics: equal-area binning for heatmaps

Uses the h3o crate (pure Rust H3 implementation).

Functions§

h3_encode
Encode a (longitude, latitude) coordinate to an H3 cell index.
h3_encode_string
Encode to H3 hex string (standard representation).
h3_is_valid
Check if an H3 index is valid.
h3_neighbors
Get all neighbor cells (k-ring of distance 1).
h3_parent
Get the parent cell at a coarser resolution.
h3_resolution
Get the resolution of an H3 cell index.
h3_to_boundary
Decode an H3 cell index to its boundary polygon.
h3_to_center
Decode an H3 cell index to its center point (lng, lat).