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

h3o

A Rust implementation of the H3 geospatial indexing system

4 releases (2 breaking)

0.3.1 Mar 17, 2023
0.3.0 Jan 31, 2023
0.2.0 Jan 15, 2023
0.1.0 Jan 9, 2023

#14 in Geospatial

Download history 3357/week @ 2023-01-07 5814/week @ 2023-01-14 2294/week @ 2023-01-21 6104/week @ 2023-01-28 5136/week @ 2023-02-04 7275/week @ 2023-02-11 5925/week @ 2023-02-18 2741/week @ 2023-02-25 3998/week @ 2023-03-04 3836/week @ 2023-03-11 2846/week @ 2023-03-18

13,786 downloads per month
Used in 3 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