Skip to content

OCaml bindings to Uber's H3 geospatial indexing system

License

Notifications You must be signed in to change notification settings

geocaml/ocaml-h3

Repository files navigation

ocaml-h3: OCaml bindings to Uber's H3 geospatial indexing system

build status License

Summary

OCaml bindings to Uber's H3 C library for indexing geo points.

Dependencies

First install H3 per the H3 readme instructions.

Example

Simple example using utop. First:

$ dune utop src

Then within utop

utop # let paris = {H3.lat=48.8566; H3.lng=2.3522};;
val paris : H3.lat_lng = {H3.lat = 48.8566; lng = 2.3522}

utop # let paris_h3 = H3.cell_of_lat_lng paris 9;;
val paris_h3 : int64 = 617550903642685439L

utop # Printf.printf "%Lx" paris_h3;;
891fb466257ffff- : unit = ()

See also examples/index.ml and examples/distance.ml which should exactly match the index.c and distance.c in the upstream Uber H3 C library.

About

OCaml bindings to Uber's H3 geospatial indexing system

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published