All Products
Search
Document Center

ApsaraDB RDS:ST_GridDisk

Last Updated:Mar 28, 2026

Returns all H3 grid cells whose distance from the central H3 grid is less than the specified distance k.

Syntax

setof h3grid ST_GridDisk(h3grid origin, integer k);

Parameters

ParameterTypeDescription
originh3gridThe central H3 grid cell.
kintegerThe distance from the central H3 grid.

Examples

The following example retrieves all H3 grid cells within a grid distance of 5 from the cell at latitude 25.1, longitude 123.1, for a total of 91 rows.

SELECT ST_GridDisk(st_h3fromlatlng(25.1,123.1),5);

Output:

 st_griddisk
------------------------
 01010060170363C5BAF408
 01010066170363C5BAF408
 01010062170363C5BAF408
 01010063170363C5BAF408
 01010061170363C5BAF408
 ....
(91 rows)