#spatial-index #geospatial #gis #geography #h3 #strong-typing

no-std bin+lib h3o

A Rust implementation of the H3 geospatial indexing system

19 releases

0.7.1 Dec 24, 2024
0.7.0 Nov 15, 2024
0.6.4 May 10, 2024
0.6.2 Mar 31, 2024
0.3.1 Mar 17, 2023

#7 in Geospatial

Download history 3526/week @ 2024-09-21 4191/week @ 2024-09-28 4828/week @ 2024-10-05 5282/week @ 2024-10-12 4972/week @ 2024-10-19 5239/week @ 2024-10-26 4583/week @ 2024-11-02 4392/week @ 2024-11-09 6047/week @ 2024-11-16 4368/week @ 2024-11-23 4864/week @ 2024-11-30 4761/week @ 2024-12-07 4236/week @ 2024-12-14 2537/week @ 2024-12-21 4234/week @ 2024-12-28 6400/week @ 2025-01-04

18,254 downloads per month
Used in 8 crates

BSD-3-Clause

3MB
7.5K SLoC

h3o

Crates.io Docs.rs CI Status Coverage License

Rust implementation of the H3 geospatial indexing system.

Design

This is not a binding of the reference implementation, but a reimplementation from scratch.

The goals are:

  • To be safer/harder to misuse by leveraging the strong typing of Rust.
  • To be 100% Rust (no C deps): painless compilation to WASM, easier LTO, …
  • To be as fast (or even faster when possible) than the reference library.

Installation

Cargo

  • Install the rust toolchain in order to have cargo installed by following this guide.
  • run cargo install h3o

Usage

use h3o::{LatLng, Resolution};

let coord = LatLng::new(37.769377, -122.388903).expect("valid coord");
let cell = coord.to_cell(Resolution::Nine);

Why this name?

Rust is an iron oxide. A Rust version of H3 is an H3 oxide, in other word $H_3O$ (a.k.a hydronium). Chemically speaking this is wrong ( $H_3O$ is produced by protonation of $H_2O$, not oxidation of $H_3$), but ¯\(ツ)

License

BSD 3-Clause

Dependencies