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

no-std bin+lib h3o

A Rust implementation of the H3 geospatial indexing system

18 releases

new 0.7.0 Nov 15, 2024
0.6.4 May 10, 2024
0.6.2 Mar 31, 2024
0.4.0 Aug 9, 2023
0.3.1 Mar 17, 2023

#6 in Geospatial

Download history 2348/week @ 2024-07-31 2168/week @ 2024-08-07 2139/week @ 2024-08-14 1799/week @ 2024-08-21 1767/week @ 2024-08-28 2463/week @ 2024-09-04 1939/week @ 2024-09-11 3179/week @ 2024-09-18 3782/week @ 2024-09-25 4761/week @ 2024-10-02 4739/week @ 2024-10-09 4903/week @ 2024-10-16 5297/week @ 2024-10-23 5020/week @ 2024-10-30 4118/week @ 2024-11-06 4915/week @ 2024-11-13

20,031 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