Returns all H3 grids within a grid distance of k from a central H3 grid, including the central grid itself.
Syntax
SETOF h3grid ST_GridDisk(h3grid origin, integer k);Parameters
| Parameter | Description |
|---|---|
origin | The central H3 grid. |
k | The grid distance from the central H3 grid. All grids at a distance less than or equal to k are returned. |
Examples
The following example returns all H3 grids within a grid distance of 5 from the grid at latitude 25.1, longitude 123.1. The query returns 91 rows.
SELECT ST_GridDisk(st_h3fromlatlng(25.1,123.1),5);Output:
st_griddisk
------------------------
01010060170363C5BAF408
01010066170363C5BAF408
01010062170363C5BAF408
01010063170363C5BAF408
01010061170363C5BAF408
....
(91 rows)该文章对您有帮助吗?