All Products
Search
Document Center

ApsaraDB RDS:ST_GridRing

Last Updated:Mar 28, 2026

Returns the hollow ring of H3 grids at exactly grid distance k from an origin cell.

Syntax

setof h3grid ST_GridRing(h3grid start, integer k);

Parameters

ParameterDescription
originThe origin H3 grid (center of the ring).
kThe grid distance from the origin.

Examples

Retrieve all H3 grids at grid distance 5 from the cell at latitude 25.1, longitude 123.1:

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

Output:

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