Skip to main content
Version: 24.3.x

Categories: String, Geospatial, Conversion

ST_FROMGEOHASH

Returns the latitude and longitude coordinates of the center of the given geohash.

Syntax

ST_FROMGEOHASH(geohash varchar) → struct<latitude: double, longitude: double>

  • geohash: The geohash string to decode.

Examples

ST_FROMGEOHASH example
SELECT ST_FROMGEOHASH ('ezs42')
-- {'Latitude': 42.60498046875, 'Longitude': -5.60302734375}
ST_FROMGEOHASH example
SELECT ST_FROMGEOHASH ('9q9j8ue2v71y5zzy0s4q')
-- {'Latitude': 37.554162000000034, 'Longitude': -122.30609999999993}
ST_FROMGEOHASH example
SELECT ST_FROMGEOHASH ('ezs42')['latitude']
-- 42.60498046875
ST_FROMGEOHASH example
SELECT ST_FROMGEOHASH ('ezs42')['longitude']
-- -5.60302734375