Skip to contents

Setup and Connection

Manage connections with H3 extension

ddbh3_create_conn()
Create a DuckDB connection with spatial and h3 extensions
ddbh3_default_conn()
Get or create default DuckDB connection

H3 representations

Converts from/to different H3 representations

ddbh3_h3_to_lon() ddbh3_h3_to_lat() ddbh3_h3_to_spatial() ddbh3_strings_to_bigint() ddbh3_bigint_to_strings() ddbh3_h3_to_points()
Convert H3 string or UBIGINT indexes to other representations
ddbh3_lonlat_to_spatial() ddbh3_lonlat_to_h3()
Convert longitude and latitude to H3 cell representations
ddbh3_polygons_to_spatial() ddbh3_lines_to_spatial() ddbh3_polygons_to_h3() ddbh3_lines_to_h3()
Convert polygon or linestring geometries to H3 cell representations
ddbh3_points_to_spatial() ddbh3_points_to_h3()
Convert spatial points to H3 cell representations

H3 hierarchy

Work with H3 resolutions and hierarchy levels

ddbh3_get_base_cell_number()
Get the base cell number of an H3 cell
ddbh3_digits_to_h3()
Build H3 cells from a base cell and digits
ddbh3_get_resolution()
Get the resolution of H3 cell indexes
ddbh3_get_child_pos()
Get the position of an H3 cell within its parent
ddbh3_child_pos_to_cell()
Get an H3 child cell from a parent and child position
ddbh3_get_parent() ddbh3_get_children() ddbh3_get_n_children() ddbh3_get_center_child()
Get parent and children H3 cells
ddbh3_get_icosahedron_faces()
Get the icosahedron faces of H3 cell indexes
ddbh3_compact() ddbh3_uncompact()
Compact and uncompact sets of H3 cells

H3 metrics

Measure areas, lengths and distances

ddbh3_get_area()
Get the area of H3 cells
ddbh3_get_hexagon_area_avg() ddbh3_get_hexagon_edge_length_avg()
Get the average area and edge length of H3 hexagons
ddbh3_great_circle_distance()
Get the great circle distance between two points

H3 neighborhood

Work with neighbors of H3 cells

ddbh3_grid_disk() ddbh3_grid_disk_distances() ddbh3_grid_ring()
Get H3 grid neighborhoods (disks, rings, and distances)
ddbh3_grid_distance()
Get the grid distance between two H3 cells
ddbh3_grid_path_cells()
Find a grid path connecting two H3 cells
ddbh3_is_neighbor()
Check if two H3 cells are neighbors
ddbh3_h3_to_local_ij() ddbh3_local_ij_to_h3()
Work with H3 local IJ coordinates
ddbh3_max_grid_disk_size()
Get the maximum grid disk size for a given distance k

H3 properties

Check properties of H3 cell indexes

H3 vertices

Extract and convert H3 cell vertices to spatial representations

H3 directed edges

Create H3 directed edges and convert them to cells, lengths and lines