PostgreSQL bindings for H3
Developed in collaboration with Scandinavian Highlands.
- PostgreSQL 9.6 or higher (including server headers). It might work with earlier versions, we have not tested earlier than 9.6.
- C compiler (e.g., gcc)
- GNU Make
- Git & CMake (for libh3)
If the prerequsites are met you can use the PGXN Client to download, build, and install, e.g.:
$ pgxn install h3 $ pgxn load -d mydb h3 $ psql -d mydb =# SELECT h3_geo_to_h3(POINT('37.3615593,-122.0553238'), 5); h3_geo_to_h3 ----------------- 85e35e73fffffff (1 row)
Generally, all functions have been renamed from camelCase in H3 to snake_case in SQL with an added
h3_ prefix (except when that would result in a double
h3_ prefix). For example
See API reference for all provided functions.
This project is released under the Apache 2.0 License.