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

no-std bin+lib h3o

A Rust implementation of the H3 geospatial indexing system

15 unstable releases (5 breaking)

0.6.2 Mar 31, 2024
0.6.0 Feb 23, 2024
0.4.0 Aug 9, 2023
0.3.4 Jul 28, 2023
0.3.1 Mar 17, 2023

#1 in #h3

Download history 1924/week @ 2023-12-23 1693/week @ 2023-12-30 2191/week @ 2024-01-06 3202/week @ 2024-01-13 3866/week @ 2024-01-20 2361/week @ 2024-01-27 2509/week @ 2024-02-03 797/week @ 2024-02-10 2591/week @ 2024-02-17 3439/week @ 2024-02-24 3120/week @ 2024-03-02 2714/week @ 2024-03-09 3063/week @ 2024-03-16 3346/week @ 2024-03-23 2449/week @ 2024-03-30 2086/week @ 2024-04-06

11,469 downloads per month
Used in 6 crates

BSD-3-Clause

3MB
8K 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