--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: h3 excerpt: | DuckDB Community Extensions Hierarchical hexagonal indexing for geospatial data extension: name: h3 description: Hierarchical hexagonal indexing for geospatial data version: 1.5.6 language: C++ build: cmake license: Apache-2.0 requires_toolchains: "python3" maintainers: - isaacbrodsky repo: github: isaacbrodsky/h3-duckdb ref: ae1c424773752f775e0549971818454f61255291 docs: hello_world: | SELECT h3_latlng_to_cell(37.7887987, -122.3931578, 9); extended_description: | The H3 extension adds support for the [H3 hierarchical hexagonal grid system](https://h3geo.org/). extension_star_count: 254 extension_star_count_pretty: 254 extension_download_count: 104751 extension_download_count_pretty: 104.8k image: '/images/community_extensions/social_preview/preview_community_extension_h3.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 | | :--- | :---: | :---: | :---: | :---: | :---: | | Linux AMD64 | ✅ | ✅ | ✅ | ✅ | ✅ | | Linux ARM64 | ✅ | ✅ | ✅ | ✅ | ✅ | | macOS AMD64 | ✅ | ✅ | ✅ | ✅ | ❌ | | macOS ARM64 | ✅ | ✅ | ✅ | ✅ | ✅ | | Windows AMD64 | ✅ | ✅ | ✅ | ✅ | ✅ | | Windows ARM64 | ❌ | ❌ | ❌ | ❌ | ❌ | | WebAssembly | ✅ | ✅ | ✅ | ✅ | ✅ | ### Installing and Loading ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions
| function_name | function_type | description | comment | examples | |---------------------------------------------|---------------|------------------------------------------------------------------------------------|---------------------------------|--------------------------------------------------------| | h3_latlng_to_cell | scalar | Convert latitude/longitude coordinate to cell ID | NULL | NULL | | h3_latlng_to_cell_string | scalar | Convert latitude/longitude coordinate to cell ID (returns VARCHAR) | NULL | NULL | | h3_cell_to_lat | scalar | Convert cell ID to latitude | NULL | NULL | | h3_cell_to_lng | scalar | Convert cell ID to longitude | NULL | NULL | | h3_cell_to_latlng | scalar | Convert cell ID to latitude/longitude | NULL | NULL | | h3_cell_to_boundary_wkt | scalar | Convert cell ID to cell boundary | NULL | NULL | | h3_cell_to_boundary_wkb | scalar | Convert cell ID to cell boundary | NULL | NULL | | h3_get_resolution | scalar | Get resolution number of cell ID | NULL | NULL | | h3_get_base_cell_number | scalar | Get base cell number of cell ID | NULL | NULL | | h3_string_to_h3 | scalar | Convert VARCHAR cell ID to UBIGINT | NULL | NULL | | h3_h3_to_string | scalar | Convert BIGINT or UBIGINT cell ID to VARCHAR | NULL | NULL | | h3_is_valid_cell | scalar | True if this is a valid cell ID | NULL | NULL | | h3_is_res_class_iii | scalar | True if the cell's resolution is class III | NULL | NULL | | h3_is_pentagon | scalar | True if the cell is a pentagon | NULL | NULL | | h3_get_icosahedron_faces | scalar | List of icosahedron face IDs the cell is on | NULL | NULL | | h3_cell_to_parent | scalar | Get coarser cell for a cell | NULL | NULL | | h3_cell_to_children | scalar | Get finer cells for a cell | NULL | NULL | | h3_cell_to_children_size | scalar | Number of finer cells for a cell | NULL | NULL | | h3_cell_to_center_child | scalar | Get the center finer cell for a cell | NULL | NULL | | h3_cell_to_child_pos | scalar | Get a sub-indexing number for a cell inside a parent | NULL | NULL | | h3_child_pos_to_cell | scalar | Convert parent and sub-indexing number to a cell ID | NULL | NULL | | h3_compact_cells | scalar | Convert a set of single-resolution cells to the minimal mixed-resolution set | NULL | NULL | | h3_uncompact_cells | scalar | Convert a mixed-resolution set to a single-resolution set of cells | NULL | NULL | | h3_grid_disk | scalar | Find cells within a grid distance | NULL | NULL | | h3_grid_disk_distances | scalar | Find cells within a grid distance, sorted by distance | NULL | NULL | | h3_grid_disk_unsafe | scalar | Find cells within a grid distance, with no pentagon distortion | NULL | NULL | | h3_grid_disk_distances_unsafe | scalar | Find cells within a grid distance, sorted by distance, with no pentagon distortion | NULL | NULL | | h3_grid_disk_distances_safe | scalar | Find cells within a grid distance, sorted by distance | NULL | NULL | | h3_grid_ring | scalar | Find cells exactly a grid distance away | NULL | NULL | | h3_grid_ring_unsafe | scalar | Find cells exactly a grid distance away, with no pentagon distortion | NULL | NULL | | h3_grid_path_cells | scalar | Find a grid path to connect two cells | NULL | NULL | | h3_max_grid_disk_size | scalar | Maximum number of cells for a grid disk for size K | NULL | NULL | | h3_grid_distance | scalar | Find the grid distance between two cells | NULL | NULL | | h3_cell_to_local_ij | scalar | Convert a cell ID to a local I,J coordinate space | NULL | NULL | | h3_local_ij_to_cell | scalar | Convert a local I,J coordinate to a cell ID | NULL | NULL | | h3_cell_to_vertex | scalar | Get the vertex ID for a cell ID and vertex number | NULL | NULL | | h3_cell_to_vertexes | scalar | Get all vertex IDs for a cell ID | NULL | NULL | | h3_vertex_to_lat | scalar | Convert a vertex ID to latitude | NULL | NULL | | h3_vertex_to_lng | scalar | Convert a vertex ID to longitude | NULL | NULL | | h3_is_valid_vertex | scalar | True if passed a valid vertex ID | NULL | NULL | | h3_is_valid_directed_edge | scalar | True if passed a valid directed edge ID | NULL | NULL | | h3_origin_to_directed_edges | scalar | Get all directed edge IDs for a cell ID | NULL | NULL | | h3_directed_edge_to_cells | scalar | Convert a directed edge ID to origin/destination cell IDs | NULL | NULL | | h3_get_directed_edge_origin | scalar | Convert a directed edge ID to origin cell ID | NULL | NULL | | h3_get_directed_edge_destination | scalar | Convert a directed edge ID to destination cell ID | NULL | NULL | | h3_cells_to_directed_edge | scalar | Convert an origin/destination pair to directed edge ID | NULL | NULL | | h3_are_neighbor_cells | scalar | True if the two cell IDs are directly adjacent | NULL | NULL | | h3_directed_edge_to_boundary_wkt | scalar | Convert directed edge ID to linestring WKT | NULL | NULL | | h3_directed_edge_to_boundary_wkb | scalar | Convert directed edge ID to linestring WKB | NULL | NULL | | h3_reverse_directed_edge | scalar | Convert a directed edge to one where origin and destination are swapped | NULL | [SELECT h3_reverse_directed_edge('115283473fffffff');] | | h3_get_hexagon_area_avg | scalar | Get average area of a hexagon cell at resolution | NULL | NULL | | h3_cell_area | scalar | Get the area of a cell ID | NULL | NULL | | h3_get_hexagon_edge_length_avg | scalar | Average hexagon edge length at resolution | NULL | NULL | | h3_edge_length | scalar | Get the length of a directed edge ID | NULL | NULL | | h3_get_num_cells | scalar | Get the number of cells at a resolution | NULL | NULL | | h3_get_res0_cells | scalar | Get all resolution 0 cells | NULL | NULL | | h3_get_res0_cells_string | scalar | Get all resolution 0 cells (returns VARCHAR) | NULL | NULL | | h3_get_pentagons | scalar | Get all pentagons at a resolution | NULL | NULL | | h3_get_pentagons_string | scalar | Get all pentagons at a resolution (returns VARCHAR) | NULL | NULL | | h3_great_circle_distance | scalar | Compute the great circle distance between two points (haversine) | NULL | NULL | | h3_cells_to_multi_polygon_wkt | scalar | Convert a set of cells to multipolygon WKT | NULL | NULL | | h3_cells_to_multi_polygon_wkb | scalar | Convert a set of cells to multipolygon WKB | NULL | NULL | | h3_polygon_wkt_to_cells | scalar | Convert polygon WKT to a set of cells | NULL | NULL | | h3_polygon_wkt_to_cells_string | scalar | Convert polygon WKT to a set of cells (returns VARCHAR) | NULL | NULL | | h3_polygon_wkt_to_cells_experimental | scalar | Convert polygon WKT to a set of cells | new algorithm | NULL | | h3_polygon_wkt_to_cells_experimental_string | scalar | Convert polygon WKT to a set of cells | new algorithm (returns VARCHAR) | NULL | | h3_polygon_wkb_to_cells | scalar | NULL | NULL | NULL | | h3_is_valid_index | scalar | NULL | NULL | NULL | | h3_polygon_wkb_to_cells_string | scalar | NULL | NULL | NULL | | h3_vertex_to_Latlng | scalar | NULL | NULL | NULL | | h3_get_index_digit | scalar | NULL | NULL | NULL | | h3_construct_cell_string | scalar | NULL | NULL | NULL | | h3_polygon_wkb_to_cells_experimental_string | scalar | NULL | NULL | NULL | | h3_polygon_wkb_to_cells_experimental | scalar | NULL | NULL | NULL | | h3_version | scalar | NULL | NULL | NULL | | h3_construct_cell | scalar | NULL | NULL | NULL | ### Overloaded Functions
This extension does not add any function overloads. ### Added Types
This extension does not add any types. ### Added Settings
| name | description | input_type | scope | aliases | typed_value | |----------------|---------------------------------------------------------|------------|--------|---------|-------------| | temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |