- Categories:
H3_ TRY_ POLYGON_ TO_ CELLS¶
A special version of H3_POLYGON_TO_CELLS that returns NULL if an error occurs when it attempts to return an array of INTEGER values of the IDs of H3 cells that have centroids contained by a Polygon (specified by a GEOGRAPHY object).
语法
实参
geography_polygon表示多边形的 GEOGRAPHY 对象。
target_resolutionAn INTEGER between 0 and 15 (inclusive) that specifies the H3 resolution (https://h3geo.org/docs/core-library/restable) that you want to use for the returned H3 cells.
指定其他任何 INTEGER 值都会导致错误。
返回
返回 INTEGER 值或 NULL 的数组。
- If the function can perform a successful calculation, returns an array of INTEGER values for the IDs of the H3 cells that have centroids contained in the specified input Polygon.
- 如果函数无法执行成功的计算,则返回 NULL 而不报告错误。
使用说明
See H3_POLYGON_TO_CELLS for the usage notes.
示例
The following example attempts to return an array of INTEGER values of the IDs of H3 cells that have centroids contained by a Polygon (specified by a GEOGRAPHY object). Because the array with the cells that cover the given hexagon at the given resolution exceeds the allowed size limit, the function returns NULL.
For examples that successfully return an array of IDs, see H3_POLYGON_TO_CELLS.