Geospatial Functions
This page lists all geospatial related functions in GreptimeDB. These functions
are enabled when you have common-function/geo
feature turned on (default: on).
- Geohash
- H3
h3_latlng_to_cell
h3_latlng_to_cell_string
h3_cell_to_string
h3_string_to_cell
h3_cell_center_latlng
h3_cell_resolution
h3_cell_base
h3_cell_is_pentagon
h3_cell_parent
h3_cell_to_children
h3_cell_to_children_size
h3_cell_to_child_pos
h3_child_pos_to_cell
h3_grid_disk
h3_grid_disk_distances
h3_grid_distance
h3_grid_path_cells
- S2
- Encodings
Geohash
See more about geohash encoding algorithms.
geohash
Get geohash encoded string from latitude, longitude and resolution.
SELECT geohash(37.76938, -122.3889, 11);
geohash_neighbours
Get all geohash neighbours for given coordinate and resolution.
Note that this function returns a String array and it only works on our HTTP Query API and Postgres channel.
SELECT geohash_neighbours(37.76938, -122.3889, 11);
H3
H3 is a geospatial index algorithm. See more about h3 encoding.