#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 2660/week @ 2024-09-17 3922/week @ 2024-09-24 4174/week @ 2024-10-01 4940/week @ 2024-10-08 5276/week @ 2024-10-15 4944/week @ 2024-10-22 5133/week @ 2024-10-29 4130/week @ 2024-11-05 4817/week @ 2024-11-12 6207/week @ 2024-11-19 4412/week @ 2024-11-26 4865/week @ 2024-12-03 4399/week @ 2024-12-10 3935/week @ 2024-12-17 2862/week @ 2024-12-24 3694/week @ 2024-12-31

15,815 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