H3_LATLNG_TO_CELL
functionsupportedCore SQL functionsReturns the INTEGER value of the H3 cell ID for a given latitude, longitude, and resolution.
Syntax
H3_LATLNG_TO_CELL( <latitude> , <longitude> , <target_resolution> )
Parameters
| Name | Required | Description |
|---|---|---|
latitude | required | A FLOAT that represents the latitude. Values outside the standard latitude range are wrapped to the range [-90, 90]. |
longitude | required | A FLOAT that represents the longitude. Values outside the standard longitude range are wrapped to the range [-180, 180]. |
target_resolution | required | An INTEGER between 0 and 15 (inclusive) specifying the H3 resolution that you want to use for the returned H3 cell. Specifying any other INTEGER value results in an error. |
Returns
Returns an INTEGER value that corresponds to the H3 cell ID for the given location and resolution.
Usage notes
- Specifying NaN or Inf values for any input argument results in an error.