H3_TRY_POLYGON_TO_CELLS

functionsupportedCore SQL functions

docs.snowflake.com ↗

Geospatial functions

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).

Syntax

H3_TRY_POLYGON_TO_CELLS( <geography_polygon> , <target_resolution> )

Parameters

NameRequiredDescription
geography_polygonrequiredA GEOGRAPHY object that represents a Polygon.
target_resolutionrequiredAn INTEGER between 0 and 15 (inclusive) that specifies the H3 resolution that you want to use for the returned H3 cells. Specifying any other INTEGER value results in an error.

Returns

Returns an array of INTEGER values or 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. - If the function cannot perform a successful calculation, returns NULL without reporting an error.

Usage notes