To build, type:
git submodule update --init
GEN=ninja make duckdb_release release(You will need Git, CMake, and a C compiler. You do not strictly need Ninja. See below for other options.)
To run, run the bundled duckdb shell:
./duckdb/build/release/duckdb -unsignedThen, load the H3 extension like so:
LOAD 'build/release/h3.duckdb_extension';Test running an H3 function:
SELECT h3_cell_to_parent(cast(586265647244115967 as ubigint), 1);h3_latlng_to_cellh3_cell_to_lath3_cell_to_lngh3_cell_to_latlngh3_cell_to_boundary_wkth3_get_resolutionh3_get_base_cell_numberh3_string_to_h3h3_h3_to_stringh3_is_valid_cellh3_is_res_class_iiih3_is_pentagonh3_get_icosahedron_facesh3_cell_to_parenth3_cell_to_childrenh3_cell_to_center_childh3_cell_to_child_posh3_child_pos_to_cellh3_compact_cellsh3_uncompact_cellsh3_grid_diskh3_grid_disk_distancesh3_grid_disk_unsafeh3_grid_disk_distances_unsafeh3_grid_ring_unsafeh3_grid_path_cellsh3_grid_distanceh3_cell_to_local_ijh3_local_ij_to_cellh3_cell_to_vertexh3_cell_to_vertexesh3_vertex_to_lath3_vertex_to_lngh3_vertex_to_latlngh3_is_valid_vertexh3_is_valid_directed_edgeh3_origin_to_directed_edgesh3_directed_edge_to_cellsh3_get_directed_edge_originh3_get_directed_edge_destinationh3_cells_to_directed_edgeh3_are_neighbor_cellsh3_directed_edge_to_boundary_wkth3_get_hexagon_area_avgh3_cell_areah3_edge_lengthh3_get_num_cellsh3_get_res0_cellsh3_get_pentagonsh3_great_circle_distanceh3_cells_to_multi_polygon_wkt
The build instructions suggest using ninja because it enables parallelism by default.
Using make instead is fine, but you will want to enable the following parallelism option,
because building DuckDB can take a very long time (>=1 hour is not unusual). Run the below
replacing 4 with the number of CPU cores on your machine.
CMAKE_BUILD_PARALLEL_LEVEL=4 make duckdb_release releaseTo run tests:
make testTo update the submodules to latest upstream, run:
make update_depsh3-duckdb Copyright 2022 Isaac Brodsky. Licensed under the Apache 2.0 License.
H3 Copyright 2018 Uber Technologies Inc. (Apache 2.0 License)
DGGRID Copyright (c) 2015 Southern Oregon University
DuckDB Copyright 2018-2022 Stichting DuckDB Foundation (MIT License)
Build system adapted from sqlitescanner Copyright 2018-2022 DuckDB Labs BV (MIT License)