Appearance
H3_LATLNG_TO_CELL
Returns the BIGINT value of an H3 cell ID for a supplied latitude and longitude at a given resolution.
Syntax
sql
H3_LATLNG_TO_CELL(<lat>, <long>, <target_resolution>)Arguments
<lat>: AFLOAT4orFLOAT8latitude<long>: AFLOAT4orFLOAT8longitude<target_resolution>: An integer between 0-15 (inclusive) specifying the H3 resolution of the returned cell
Returns
A BIGINT value corresponding to the H3 cell ID for the given location and resolution. Resolution outside a valid range results in an error.
Example
sql
SELECT h3_latlng_to_cell(0, 0, 3);
-- 592035265791393791