Search Shortcut cmd + k | ctrl + k
duck_dggs

DuckDB extension for discrete global grid systems (DGGS) powered by DGGRID v9.

Maintainer(s): am2222

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, 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

INSTALL duck_dggs FROM community;
LOAD duck_dggs;

Example

INSTALL duck_dggs FROM community;
LOAD duck_dggs;

-- Geographic point → cell ID at resolution 5 (default ISEA4H grid)
SELECT geo_to_seqnum('POINT(0.0 0.0)'::GEOMETRY, 5);
-- → 2380

-- Cell ID → cell centre point
SELECT seqnum_to_geo(2380, 5);
-- → POINT (-0.9020481125846749 -1.2067949803565235e-09)

-- Cell ID → cell boundary polygon (requires the spatial extension)
LOAD spatial;
SELECT seqnum_to_boundary(2380, 5);
-- → POLYGON ((...))

-- Grid statistics
SELECT dggs_n_cells(5);
-- → 10242

-- Neighbors, parent, children
SELECT seqnum_neighbors(2380::UBIGINT, 5);
-- → [2412, 2413, 2381, 2348, 2347, 2379]

SELECT seqnum_parent(2380::UBIGINT, 5);
-- → 599

SELECT seqnum_children(599::UBIGINT, 4);
-- → [2380, 2412, 2413, 2381, 2348, 2347, 2379]

-- Use a custom grid (ISEA3H — aperture 3 hexagons)
SELECT geo_to_seqnum('POINT(0.0 0.0)'::GEOMETRY, 5,
    dggs_params('ISEA', 3, 'HEXAGON', 0.0, 58.28252559, 11.25));
-- → 572

-- Mixed-aperture sequence grid
SELECT dggs_n_cells(3,
    dggs_params('ISEA', 3, 'HEXAGON', 0.0, 58.28252559, 11.25, true, '3434'));
-- → 362

About duck_dggs

duck_dggs transforms geographic coordinates (as GEOMETRY POINT) to and from DGGS cell identifiers across multiple coordinate reference frames, powered by DGGRID v9.

Full documentation: https://am2222.github.io/duckdb-dggs/

All transform functions accept a GEOMETRY POINT (x = longitude°, y = latitude°) and a resolution integer. Every function has a second overload that accepts an explicit dggs_params struct for full control over the grid configuration.

Grid configuration

All functions use ISEA4H by default (ISEA projection, aperture 4, hexagon topology). Pass a dggs_params struct as the last argument to use a different grid:

-- Standard (6 args)
dggs_params(projection, aperture, topology, azimuth_deg, pole_lat_deg, pole_lon_deg)
-- With aperture sequence (8 args)
dggs_params(projection, aperture, topology, azimuth_deg, pole_lat_deg, pole_lon_deg,
            is_aperture_sequence, aperture_sequence)

Common presets:

Grid Call
ISEA4H (default) dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25)
ISEA3H dggs_params('ISEA', 3, 'HEXAGON', 0.0, 58.28252559, 11.25)
ISEA4T (triangles) dggs_params('ISEA', 4, 'TRIANGLE', 0.0, 58.28252559, 11.25)
ISEA4D (diamonds) dggs_params('ISEA', 4, 'DIAMOND', 0.0, 58.28252559, 11.25)
FULLER4H dggs_params('FULLER', 4, 'HEXAGON', 0.0, 58.28252559, 11.25)
Mixed aperture dggs_params('ISEA', 3, 'HEXAGON', 0.0, 58.28252559, 11.25, true, '3437')

Utility functions:

  • duck_dggs_version() — extension version string
  • dggs_params(...) — build a grid configuration (6-arg or 8-arg with aperture sequence)

Grid statistics (each has res and optional params overload):

  • dggs_n_cells — total cell count at a resolution
  • dggs_cell_area_km — average cell area in km²
  • dggs_cell_dist_km — average cell spacing in km
  • dggs_cls_km — characteristic length scale in km
  • dggs_res_info — all stats as a struct

Transform functions (each has res and optional params overload):

  • From GEO: geo_to_seqnum, geo_to_geo, geo_to_plane, geo_to_projtri, geo_to_q2dd, geo_to_q2di
  • From SEQNUM: seqnum_to_geo, seqnum_to_boundary, seqnum_to_seqnum, seqnum_to_plane, seqnum_to_projtri, seqnum_to_q2dd, seqnum_to_q2di
  • From Q2DI: q2di_to_seqnum, q2di_to_geo, q2di_to_plane, q2di_to_projtri, q2di_to_q2dd, q2di_to_q2di
  • From Q2DD: q2dd_to_seqnum, q2dd_to_geo, q2dd_to_plane, q2dd_to_projtri, q2dd_to_q2dd, q2dd_to_q2di
  • From PROJTRI: projtri_to_seqnum, projtri_to_geo, projtri_to_plane, projtri_to_projtri, projtri_to_q2dd, projtri_to_q2di

Neighbor & hierarchy functions:

  • seqnum_neighbors — topologically adjacent cells
  • seqnum_parent — parent cell at res-1
  • seqnum_all_parents — all touching parent cells at res-1
  • seqnum_children — child cells at res+1
  • seqnum_index_parent / seqnum_index_children — parent and children in the grid's hierarchical indexing system (Z3 / ZOrder / Z7); unlike the spatial functions these form a strict tree
  • seqnum_k_ring — the cell plus every cell within k neighbor steps

Coverage & geodesy:

  • polygon_to_seqnums — every cell whose centre lies inside a POLYGON / MULTIPOLYGON
  • seqnum_cell_area_km — true spherical area of one cell (vs the grid average)
  • geo_distance_km / geo_azimuth_deg — great-circle distance and bearing between points

Hierarchical index conversions:

  • seqnum_to_zorder / zorder_to_seqnum — Z-order (Morton code) indexing
  • seqnum_to_z3 / z3_to_seqnum — Z3 index (aperture 3 only)
  • seqnum_to_z7 / z7_to_seqnum — Z7 index (aperture 7 only)
  • seqnum_to_vertex2dd / vertex2dd_to_seqnum — vertex-based 2D coordinates

IGEO7 / Z7 bit-level operations (operate directly on the packed 64-bit Z7 index; no dggs_params needed; logic ported from allixender/igeo7_duckdb):

  • igeo7_from_string / igeo7_to_string — compact string ↔ packed 64-bit index
  • igeo7_encode — pack base cell + 20 three-bit digit slots
  • igeo7_encode_at_resolution — igeo7_encode then truncate to a target resolution
  • igeo7_get_resolution — resolution (0–20) from a packed index
  • igeo7_get_base_cell — base cell ID (0–11)
  • igeo7_get_digit — extract the i-th digit (1–20)
  • igeo7_parent / igeo7_parent_at — ancestor at res-1 or a specific resolution
  • igeo7_get_neighbours / igeo7_get_neighbour — all 6 neighbours or one by direction
  • igeo7_first_non_zero — position of the first non-zero digit slot
  • igeo7_is_valid — false only for the UINT64_MAX invalid-neighbour sentinel
  • igeo7_decode_str — verbose base-d1.d2…d20 form showing all 20 slots (SQL macro)
  • igeo7_string_parent / igeo7_string_local_pos / igeo7_string_is_center — compact-string helpers (SQL macros)
  • igeo7_geo_to_authalic / igeo7_authalic_to_geo — remap each vertex's latitude in a GEOMETRY between WGS84 geodetic and authalic (equal-area sphere) using the Karney 2022 order-6 polynomial Fourier series; useful before equal-area binning of lon/lat data

Added Functions

function_name function_type description comment examples
dggs_cell_area_km scalar Returns the average cell area in square kilometres at the given grid resolution. NULL [dggs_cell_area_km(5)]
dggs_cell_area_km scalar Returns the average cell area in square kilometres at the given grid resolution. NULL [dggs_cell_area_km(5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
dggs_cell_dist_km scalar Returns the average distance in kilometres between the centres of adjacent cells at the given grid resolution. NULL [dggs_cell_dist_km(5)]
dggs_cell_dist_km scalar Returns the average distance in kilometres between the centres of adjacent cells at the given grid resolution. NULL [dggs_cell_dist_km(5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
dggs_cls_km scalar Returns the characteristic length scale (CLS) in kilometres at the given grid resolution. NULL [dggs_cls_km(5)]
dggs_cls_km scalar Returns the characteristic length scale (CLS) in kilometres at the given grid resolution. NULL [dggs_cls_km(5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
dggs_n_cells scalar Returns the total number of cells at the given grid resolution. NULL [dggs_n_cells(5)]
dggs_n_cells scalar Returns the total number of cells at the given grid resolution. NULL [dggs_n_cells(5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
dggs_params scalar Builds the grid-configuration struct accepted as the optional last argument of every transform function, selecting the projection ('ISEA' or 'FULLER'), the aperture (3, 4 or 7), the cell topology ('HEXAGON', 'TRIANGLE' or 'DIAMOND') and the icosahedron orientation. NULL [dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25)]
dggs_params scalar Builds the grid-configuration struct accepted as the optional last argument of every transform function, with a mixed-aperture grid: when is_aperture_sequence is true, aperture_sequence gives the aperture ('3', '4' or '7') used at each resolution level. NULL [dggs_params('ISEA', 3, 'HEXAGON', 0.0, 58.28252559, 11.25, true, '3437')]
dggs_res_info scalar Returns every grid statistic for the given resolution as a single struct of cell count, area, spacing and characteristic length scale. NULL [dggs_res_info(5)]
dggs_res_info scalar Returns every grid statistic for the given resolution as a single struct of cell count, area, spacing and characteristic length scale. NULL [dggs_res_info(5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
duck_dggs_version scalar Returns the version of the loaded duck_dggs extension together with the version of the bundled DGGRID library. NULL [duck_dggs_version()]
geo_azimuth_deg scalar Returns the initial great-circle bearing from point a to point b, in degrees clockwise from north in [0, 360). NULL [geo_azimuth_deg('POINT(-75.7 45.4)'::GEOMETRY, 'POINT(-0.1 51.5)'::GEOMETRY)]
geo_distance_km scalar Returns the great-circle distance in km between two POINT geometries (x = longitude, y = latitude), on the WGS84 authalic sphere DGGRID uses. NULL [geo_distance_km('POINT(-75.7 45.4)'::GEOMETRY, 'POINT(-0.1 51.5)'::GEOMETRY)]
geo_to_geo scalar Snaps a lon/lat point to the centre of the DGGS cell that contains it at the given resolution. NULL [geo_to_geo('POINT(0.0 0.0)'::GEOMETRY, 5)]
geo_to_geo scalar Snaps a lon/lat point to the centre of the DGGS cell that contains it at the given resolution. NULL [geo_to_geo('POINT(0.0 0.0)'::GEOMETRY, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
geo_to_plane scalar Returns the unfolded icosahedron plane coordinates of the DGGS cell that contains the given lon/lat point. NULL [geo_to_plane('POINT(0.0 0.0)'::GEOMETRY, 5)]
geo_to_plane scalar Returns the unfolded icosahedron plane coordinates of the DGGS cell that contains the given lon/lat point. NULL [geo_to_plane('POINT(0.0 0.0)'::GEOMETRY, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
geo_to_projtri scalar Returns the PROJTRI coordinate (icosahedron triangle number plus x/y within the projected triangle) of the DGGS cell that contains the given lon/lat point. NULL [geo_to_projtri('POINT(0.0 0.0)'::GEOMETRY, 5)]
geo_to_projtri scalar Returns the PROJTRI coordinate (icosahedron triangle number plus x/y within the projected triangle) of the DGGS cell that contains the given lon/lat point. NULL [geo_to_projtri('POINT(0.0 0.0)'::GEOMETRY, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
geo_to_q2dd scalar Returns the Q2DD coordinate (quad number plus continuous x/y within the quad) of the DGGS cell that contains the given lon/lat point. NULL [geo_to_q2dd('POINT(0.0 0.0)'::GEOMETRY, 5)]
geo_to_q2dd scalar Returns the Q2DD coordinate (quad number plus continuous x/y within the quad) of the DGGS cell that contains the given lon/lat point. NULL [geo_to_q2dd('POINT(0.0 0.0)'::GEOMETRY, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
geo_to_q2di scalar Returns the Q2DI coordinate (quad number plus integer i/j indices) of the DGGS cell that contains the given lon/lat point. NULL [geo_to_q2di('POINT(0.0 0.0)'::GEOMETRY, 5)]
geo_to_q2di scalar Returns the Q2DI coordinate (quad number plus integer i/j indices) of the DGGS cell that contains the given lon/lat point. NULL [geo_to_q2di('POINT(0.0 0.0)'::GEOMETRY, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
geo_to_seqnum scalar Returns the sequential cell index (SEQNUM) of the DGGS cell that contains the given lon/lat point at the given resolution. NULL [geo_to_seqnum('POINT(0.0 0.0)'::GEOMETRY, 5)]
geo_to_seqnum scalar Returns the sequential cell index (SEQNUM) of the DGGS cell that contains the given lon/lat point at the given resolution. NULL [geo_to_seqnum('POINT(0.0 0.0)'::GEOMETRY, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
igeo7_authalic_to_geo scalar Remaps every vertex latitude of a geometry from authalic (equal-area sphere) back to geodetic (WGS84) latitude, inverting igeo7_geo_to_authalic. NULL [igeo7_authalic_to_geo('POINT (0 44.87170287343394)'::GEOMETRY)]
igeo7_decode_str macro Renders a packed IGEO7/Z7 index in the verbose base-d1.d2…d20 form, showing all 20 digit slots including the padding 7s. NULL [igeo7_decode_str(32023330408103935::UBIGINT)]
igeo7_encode scalar Packs a base cell (0-11) and exactly 20 three-bit digits into the canonical 64-bit IGEO7/Z7 index, using 7 for every slot beyond the target resolution; the INTEGER overload accepts unadorned SQL literals. NULL [igeo7_encode(8, 0, 0, 4, 3, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7)]
igeo7_encode_at_resolution scalar Packs a base cell and 20 three-bit digits and truncates the result to the given resolution, filling slots res+1..20 with padding; equivalent to igeo7_parent_at(igeo7_encode(…), res) in one call. NULL [igeo7_encode_at_resolution(8, 3, 0, 0, 4, 3, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7)]
igeo7_first_non_zero scalar Returns the position (1-20) of the first non-zero digit slot of a packed IGEO7/Z7 index, or 0 when every slot is zero or padding. NULL [igeo7_first_non_zero(igeo7_from_string('0800432'))]
igeo7_from_string scalar Parses a compact IGEO7/Z7 string (base cell plus significant digits) into the canonical 64-bit packed index. NULL [igeo7_from_string('0800432')]
igeo7_geo_to_authalic scalar Remaps every vertex latitude of a geometry from geodetic (WGS84) to authalic (equal-area sphere) latitude, passing longitude and any Z/M components through unchanged. NULL [igeo7_geo_to_authalic('POINT (0 45)'::GEOMETRY)]
igeo7_get_base_cell scalar Returns the base cell ID (0-11) held in the top 4 bits of a packed IGEO7/Z7 index. NULL [igeo7_get_base_cell(igeo7_from_string('0800432'))]
igeo7_get_digit scalar Returns the digit at position pos (1-20) of a packed IGEO7/Z7 index, or 7 (padding) when pos is out of range or beyond the cell's resolution. NULL [igeo7_get_digit(igeo7_from_string('0800432'), 3)]
igeo7_get_neighbour scalar Returns the neighbour of a packed IGEO7/Z7 index in direction 1-6, or the invalid sentinel UINT64_MAX for an out-of-range or pentagon-excluded direction. NULL [igeo7_get_neighbour(igeo7_from_string('0800432'), 1)]
igeo7_get_neighbours scalar Returns the six neighbours of a packed IGEO7/Z7 index; directions excluded by a pentagon yield the invalid sentinel UINT64_MAX. NULL [igeo7_get_neighbours(igeo7_from_string('0800432'))]
igeo7_get_resolution scalar Returns the resolution (0-20) of a packed IGEO7/Z7 index, given by the number of digit slots before the first padding value. NULL [igeo7_get_resolution(igeo7_from_string('0800432'))]
igeo7_is_valid scalar Returns false only when a packed IGEO7/Z7 index equals the invalid sentinel UINT64_MAX that neighbour lookups return for excluded directions. NULL [igeo7_is_valid(igeo7_from_string('0800432'))]
igeo7_parent scalar Returns the parent of a packed IGEO7/Z7 index one resolution level up; a resolution-0 index returns itself. NULL [igeo7_parent(igeo7_from_string('0800432'))]
igeo7_parent_at scalar Returns the ancestor of a packed IGEO7/Z7 index at the given resolution, keeping digits 1..res and filling the remaining slots with padding. NULL [igeo7_parent_at(igeo7_from_string('0800432'), 3)]
igeo7_string_is_center macro Returns true when a compact IGEO7 string ends in '0', meaning the cell covers the centre position within its parent. NULL [igeo7_string_is_center('080040')]
igeo7_string_local_pos macro Returns the last character of a compact IGEO7 string: the cell's local position digit within its parent. NULL [igeo7_string_local_pos('0800432')]
igeo7_string_parent macro Returns the parent of a compact IGEO7 string by dropping its last character. NULL [igeo7_string_parent('0800432')]
igeo7_to_string scalar Renders a packed IGEO7/Z7 index in compact string form: a two-digit base cell followed by the significant digits, stopping at the first padding slot. NULL [igeo7_to_string(612839406969683967::UBIGINT)]
polygon_to_seqnums scalar Returns the sequential indices, ascending, of every cell whose centre lies inside a POLYGON or MULTIPOLYGON (holes are excluded). Edges are straight lines in longitude/latitude, so the polygon must not cross the antimeridian. NULL [polygon_to_seqnums('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))'::GEOMETRY, 5)]
polygon_to_seqnums scalar Returns the sequential indices, ascending, of every cell whose centre lies inside a POLYGON or MULTIPOLYGON (holes are excluded). Edges are straight lines in longitude/latitude, so the polygon must not cross the antimeridian. NULL [polygon_to_seqnums('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))'::GEOMETRY, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
projtri_to_geo scalar Returns the centre of the DGGS cell at the given PROJTRI coordinate as a lon/lat POINT. NULL [projtri_to_geo(7, 0.6875, 0.0, 5)]
projtri_to_geo scalar Returns the centre of the DGGS cell at the given PROJTRI coordinate as a lon/lat POINT. NULL [projtri_to_geo(7, 0.6875, 0.0, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
projtri_to_plane scalar Converts a PROJTRI coordinate to unfolded icosahedron plane coordinates. NULL [projtri_to_plane(7, 0.6875, 0.0, 5)]
projtri_to_plane scalar Converts a PROJTRI coordinate to unfolded icosahedron plane coordinates. NULL [projtri_to_plane(7, 0.6875, 0.0, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
projtri_to_projtri scalar Re-encodes a PROJTRI coordinate through a full round-trip via the DGGS engine, normalising it to its cell. NULL [projtri_to_projtri(7, 0.6875, 0.0, 5)]
projtri_to_projtri scalar Re-encodes a PROJTRI coordinate through a full round-trip via the DGGS engine, normalising it to its cell. NULL [projtri_to_projtri(7, 0.6875, 0.0, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
projtri_to_q2dd scalar Converts a PROJTRI coordinate to Q2DD (quad number plus continuous x/y within the quad). NULL [projtri_to_q2dd(7, 0.6875, 0.0, 5)]
projtri_to_q2dd scalar Converts a PROJTRI coordinate to Q2DD (quad number plus continuous x/y within the quad). NULL [projtri_to_q2dd(7, 0.6875, 0.0, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
projtri_to_q2di scalar Converts a PROJTRI coordinate to Q2DI (quad number plus integer i/j indices). NULL [projtri_to_q2di(7, 0.6875, 0.0, 5)]
projtri_to_q2di scalar Converts a PROJTRI coordinate to Q2DI (quad number plus integer i/j indices). NULL [projtri_to_q2di(7, 0.6875, 0.0, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
projtri_to_seqnum scalar Converts a PROJTRI coordinate to the sequential index of the DGGS cell that contains it. NULL [projtri_to_seqnum(7, 0.6875, 0.0, 5)]
projtri_to_seqnum scalar Converts a PROJTRI coordinate to the sequential index of the DGGS cell that contains it. NULL [projtri_to_seqnum(7, 0.6875, 0.0, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2dd_to_geo scalar Returns the centre of the DGGS cell at the given Q2DD coordinate as a lon/lat POINT. NULL [q2dd_to_geo(3, 0.15625, 0.27063, 5)]
q2dd_to_geo scalar Returns the centre of the DGGS cell at the given Q2DD coordinate as a lon/lat POINT. NULL [q2dd_to_geo(3, 0.15625, 0.27063, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2dd_to_plane scalar Converts a Q2DD coordinate to unfolded icosahedron plane coordinates. NULL [q2dd_to_plane(3, 0.15625, 0.27063, 5)]
q2dd_to_plane scalar Converts a Q2DD coordinate to unfolded icosahedron plane coordinates. NULL [q2dd_to_plane(3, 0.15625, 0.27063, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2dd_to_projtri scalar Converts a Q2DD coordinate to PROJTRI (icosahedron triangle number plus x/y within the projected triangle). NULL [q2dd_to_projtri(3, 0.15625, 0.27063, 5)]
q2dd_to_projtri scalar Converts a Q2DD coordinate to PROJTRI (icosahedron triangle number plus x/y within the projected triangle). NULL [q2dd_to_projtri(3, 0.15625, 0.27063, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2dd_to_q2dd scalar Re-encodes a Q2DD coordinate through a full round-trip via the DGGS engine, normalising it to its cell. NULL [q2dd_to_q2dd(3, 0.15625, 0.27063, 5)]
q2dd_to_q2dd scalar Re-encodes a Q2DD coordinate through a full round-trip via the DGGS engine, normalising it to its cell. NULL [q2dd_to_q2dd(3, 0.15625, 0.27063, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2dd_to_q2di scalar Converts a Q2DD coordinate to Q2DI (quad number plus integer i/j indices). NULL [q2dd_to_q2di(3, 0.15625, 0.27063, 5)]
q2dd_to_q2di scalar Converts a Q2DD coordinate to Q2DI (quad number plus integer i/j indices). NULL [q2dd_to_q2di(3, 0.15625, 0.27063, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2dd_to_seqnum scalar Converts a Q2DD coordinate to the sequential index of the DGGS cell that contains it. NULL [q2dd_to_seqnum(3, 0.15625, 0.27063, 5)]
q2dd_to_seqnum scalar Converts a Q2DD coordinate to the sequential index of the DGGS cell that contains it. NULL [q2dd_to_seqnum(3, 0.15625, 0.27063, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2di_to_geo scalar Returns the centre of the DGGS cell at the given Q2DI coordinate as a lon/lat POINT. NULL [q2di_to_geo(3, 10, 10, 5)]
q2di_to_geo scalar Returns the centre of the DGGS cell at the given Q2DI coordinate as a lon/lat POINT. NULL [q2di_to_geo(3, 10, 10, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2di_to_plane scalar Converts a Q2DI coordinate to unfolded icosahedron plane coordinates. NULL [q2di_to_plane(3, 10, 10, 5)]
q2di_to_plane scalar Converts a Q2DI coordinate to unfolded icosahedron plane coordinates. NULL [q2di_to_plane(3, 10, 10, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2di_to_projtri scalar Converts a Q2DI coordinate to PROJTRI (icosahedron triangle number plus x/y within the projected triangle). NULL [q2di_to_projtri(3, 10, 10, 5)]
q2di_to_projtri scalar Converts a Q2DI coordinate to PROJTRI (icosahedron triangle number plus x/y within the projected triangle). NULL [q2di_to_projtri(3, 10, 10, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2di_to_q2dd scalar Converts a Q2DI coordinate to Q2DD (quad number plus continuous x/y within the quad). NULL [q2di_to_q2dd(3, 10, 10, 5)]
q2di_to_q2dd scalar Converts a Q2DI coordinate to Q2DD (quad number plus continuous x/y within the quad). NULL [q2di_to_q2dd(3, 10, 10, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2di_to_q2di scalar Re-encodes a Q2DI coordinate through a full round-trip via the DGGS engine, normalising it to its cell. NULL [q2di_to_q2di(3, 10, 10, 5)]
q2di_to_q2di scalar Re-encodes a Q2DI coordinate through a full round-trip via the DGGS engine, normalising it to its cell. NULL [q2di_to_q2di(3, 10, 10, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
q2di_to_seqnum scalar Converts a Q2DI coordinate to the sequential index of the DGGS cell that contains it. NULL [q2di_to_seqnum(3, 10, 10, 5)]
q2di_to_seqnum scalar Converts a Q2DI coordinate to the sequential index of the DGGS cell that contains it. NULL [q2di_to_seqnum(3, 10, 10, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_all_parents scalar Returns the sequential indices of every cell at resolution res - 1 that the given cell touches, with the containing parent first. NULL [seqnum_all_parents(2412::UBIGINT, 5)]
seqnum_all_parents scalar Returns the sequential indices of every cell at resolution res - 1 that the given cell touches, with the containing parent first. NULL [seqnum_all_parents(2412::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_cell_area_km scalar Returns the true spherical area in km² of one cell, on the WGS84 authalic sphere. Unlike dggs_cell_area_km, which is the grid average, this differs between cells (pentagons are smaller). NULL [seqnum_cell_area_km(2380::UBIGINT, 5)]
seqnum_cell_area_km scalar Returns the true spherical area in km² of one cell, on the WGS84 authalic sphere. Unlike dggs_cell_area_km, which is the grid average, this differs between cells (pentagons are smaller). NULL [seqnum_cell_area_km(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_children scalar Returns the sequential indices of the cells at resolution res + 1 that belong to the given cell (7 for an aperture-4 hexagon grid). NULL [seqnum_children(599::UBIGINT, 4)]
seqnum_children scalar Returns the sequential indices of the cells at resolution res + 1 that belong to the given cell (7 for an aperture-4 hexagon grid). NULL [seqnum_children(599::UBIGINT, 4, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_index_children scalar Returns the sequential indices of the cell's children at resolution res + 1 in the grid's hierarchical indexing system (Z3, ZOrder or Z7). Unlike seqnum_children, the index children of different cells never overlap; single-aperture hexagon grids only. NULL [seqnum_index_children(599::UBIGINT, 4)]
seqnum_index_children scalar Returns the sequential indices of the cell's children at resolution res + 1 in the grid's hierarchical indexing system (Z3, ZOrder or Z7). Unlike seqnum_children, the index children of different cells never overlap; single-aperture hexagon grids only. NULL [seqnum_index_children(599::UBIGINT, 4, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_index_parent scalar Returns the sequential index of the cell's parent at resolution res - 1 in the grid's hierarchical indexing system (Z3 for aperture 3, ZOrder for 4, Z7 for 7). Every cell has exactly one index parent, even where it straddles several spatial parents; single-aperture hexagon grids only. NULL [seqnum_index_parent(2380::UBIGINT, 5)]
seqnum_index_parent scalar Returns the sequential index of the cell's parent at resolution res - 1 in the grid's hierarchical indexing system (Z3 for aperture 3, ZOrder for 4, Z7 for 7). Every cell has exactly one index parent, even where it straddles several spatial parents; single-aperture hexagon grids only. NULL [seqnum_index_parent(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_k_ring scalar Returns the cell and every cell within k neighbor steps of it, ordered by distance in steps (the cell itself first) and ascending within each ring. NULL [seqnum_k_ring(2380::UBIGINT, 1, 5)]
seqnum_k_ring scalar Returns the cell and every cell within k neighbor steps of it, ordered by distance in steps (the cell itself first) and ascending within each ring. NULL [seqnum_k_ring(2380::UBIGINT, 1, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_neighbors scalar Returns the sequential indices of the cells topologically adjacent to the given cell, excluding the cell itself (6 for interior hexagons, 5 for the pentagons at the icosahedron vertices). NULL [seqnum_neighbors(2380::UBIGINT, 5)]
seqnum_neighbors scalar Returns the sequential indices of the cells topologically adjacent to the given cell, excluding the cell itself (6 for interior hexagons, 5 for the pentagons at the icosahedron vertices). NULL [seqnum_neighbors(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_parent scalar Returns the sequential index of the cell at resolution res - 1 that contains the centre of the given cell. NULL [seqnum_parent(2380::UBIGINT, 5)]
seqnum_parent scalar Returns the sequential index of the cell at resolution res - 1 that contains the centre of the given cell. NULL [seqnum_parent(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_boundary scalar Returns the boundary of the DGGS cell with the given sequential index as a closed POLYGON; requires the spatial extension. NULL [seqnum_to_boundary(2380::UBIGINT, 5)]
seqnum_to_boundary scalar Returns the boundary of the DGGS cell with the given sequential index as a closed POLYGON; requires the spatial extension. NULL [seqnum_to_boundary(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_geo scalar Returns the centre of the DGGS cell with the given sequential index as a lon/lat POINT. NULL [seqnum_to_geo(2380::UBIGINT, 5)]
seqnum_to_geo scalar Returns the centre of the DGGS cell with the given sequential index as a lon/lat POINT. NULL [seqnum_to_geo(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_plane scalar Converts a sequential cell index to unfolded icosahedron plane coordinates. NULL [seqnum_to_plane(2380::UBIGINT, 5)]
seqnum_to_plane scalar Converts a sequential cell index to unfolded icosahedron plane coordinates. NULL [seqnum_to_plane(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_projtri scalar Converts a sequential cell index to PROJTRI (icosahedron triangle number plus x/y within the projected triangle). NULL [seqnum_to_projtri(2380::UBIGINT, 5)]
seqnum_to_projtri scalar Converts a sequential cell index to PROJTRI (icosahedron triangle number plus x/y within the projected triangle). NULL [seqnum_to_projtri(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_q2dd scalar Converts a sequential cell index to Q2DD (quad number plus continuous x/y within the quad). NULL [seqnum_to_q2dd(2380::UBIGINT, 5)]
seqnum_to_q2dd scalar Converts a sequential cell index to Q2DD (quad number plus continuous x/y within the quad). NULL [seqnum_to_q2dd(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_q2di scalar Converts a sequential cell index to Q2DI (quad number plus integer i/j indices). NULL [seqnum_to_q2di(2380::UBIGINT, 5)]
seqnum_to_q2di scalar Converts a sequential cell index to Q2DI (quad number plus integer i/j indices). NULL [seqnum_to_q2di(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_seqnum scalar Re-encodes a sequential cell index through a full round-trip via the DGGS engine, which validates and normalises it. NULL [seqnum_to_seqnum(2380::UBIGINT, 5)]
seqnum_to_seqnum scalar Re-encodes a sequential cell index through a full round-trip via the DGGS engine, which validates and normalises it. NULL [seqnum_to_seqnum(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_vertex2dd scalar Converts a sequential cell index to VERTEX2DD, which addresses the cell by vertex-based x/y plus its triangle and vertex numbers. NULL [seqnum_to_vertex2dd(2380::UBIGINT, 5)]
seqnum_to_vertex2dd scalar Converts a sequential cell index to VERTEX2DD, which addresses the cell by vertex-based x/y plus its triangle and vertex numbers. NULL [seqnum_to_vertex2dd(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_z3 scalar Converts a sequential cell index to its Z3 hierarchical index; aperture 3 hexagon grids only. NULL [seqnum_to_z3(100::UBIGINT, 4, dggs_params('ISEA', 3, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_z7 scalar Converts a sequential cell index to its Z7 hierarchical index; aperture 7 hexagon grids only. NULL [seqnum_to_z7(100::UBIGINT, 4, dggs_params('ISEA', 7, 'HEXAGON', 0.0, 58.28252559, 11.25))]
seqnum_to_zorder scalar Converts a sequential cell index to its Z-order (Morton code) index, which preserves spatial locality; aperture 3 and 4 grids only. NULL [seqnum_to_zorder(2380::UBIGINT, 5)]
seqnum_to_zorder scalar Converts a sequential cell index to its Z-order (Morton code) index, which preserves spatial locality; aperture 3 and 4 grids only. NULL [seqnum_to_zorder(2380::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
vertex2dd_to_seqnum scalar Converts a VERTEX2DD coordinate back to the sequential index of the DGGS cell that contains it. NULL [vertex2dd_to_seqnum(true, 3, 1, 0.15625, 0.27063293868263705, 5)]
vertex2dd_to_seqnum scalar Converts a VERTEX2DD coordinate back to the sequential index of the DGGS cell that contains it. NULL [vertex2dd_to_seqnum(true, 3, 1, 0.15625, 0.27063293868263705, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]
z3_to_seqnum scalar Converts a Z3 hierarchical index back to a sequential cell index; aperture 3 hexagon grids only. NULL [z3_to_seqnum(2994893752201379839::UBIGINT, 4, dggs_params('ISEA', 3, 'HEXAGON', 0.0, 58.28252559, 11.25))]
z7_to_seqnum scalar Converts a Z7 hierarchical index back to a sequential cell index; aperture 7 hexagon grids only. NULL [z7_to_seqnum(1162491653815009279::UBIGINT, 4, dggs_params('ISEA', 7, 'HEXAGON', 0.0, 58.28252559, 11.25))]
zorder_to_seqnum scalar Converts a Z-order (Morton code) index back to a sequential cell index; aperture 3 and 4 grids only. NULL [zorder_to_seqnum(3688448094816436224::UBIGINT, 5)]
zorder_to_seqnum scalar Converts a Z-order (Morton code) index back to a sequential cell index; aperture 3 and 4 grids only. NULL [zorder_to_seqnum(3688448094816436224::UBIGINT, 5, dggs_params('ISEA', 4, 'HEXAGON', 0.0, 58.28252559, 11.25))]

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