This topic describes the ST_H3FromLatLng function. This function converts a latitude and longitude pair into an object of the H3Grid data type.
Syntax
h3grid ST_H3FromLatLng(float lat, float lng, Integer level)
Parameters
Parameter | Description |
lat | The latitude. |
lng | The longitude. |
level | The layer of the grid. Default value: 15. |
Examples
select st_astext(st_h3fromlatlng(20.5,128.2));
st_astext
-----------------
8f4a1266884c4f0
select st_astext(st_h3fromlatlng(20.5,128.2,8));
st_astext
-----------------
884a126689fffff