ST_PointFromGeoHash

TL;DR

ST_PointFromGeoHash converts a GeoHash cell center into a GEOMETRY point.

Syntax

ST_PointFromGeoHash(geohash, srid)

Arguments

geohash is a VARCHAR GeoHash string. srid is an INT64 spatial reference identifier for the returned point.

Return Value

Returns a GEOMETRY POINT at the GeoHash cell center.

Usage Notes

The resulting coordinates are the center of the GeoHash cell. Supply 4326 when the hash represents conventional longitude/latitude coordinates.

Examples

DROP DATABASE IF EXISTS geo_st_pointfromgeohash_demo;
CREATE DATABASE geo_st_pointfromgeohash_demo;
USE geo_st_pointfromgeohash_demo;

SELECT ST_AsText(ST_PointFromGeoHash('ezs42', 4326)) AS point_value;
SELECT ST_SRID(ST_PointFromGeoHash('ezs42', 4326)) AS point_srid;

DROP DATABASE geo_st_pointfromgeohash_demo;

See Also

ST_GeoHash, ST_LatFromGeoHash, ST_LongFromGeoHash