ST_ Geohash

The ST_Geohash function returns the unique geohash value of the specified point geometry at depth=45.

Syntax

Read syntax diagramSkip visual syntax diagram ST_Geohash ( point_geometry )

Parameter

point_geometry
A value of type ST_Point that represents the point geometry for which the geohash is to be calculated. If the specified geometry is NULL or empty, one row with a geohash value of NULL is returned.

Restrictions

The specified point geometry must use SRS 4326 (GSE3001N).

Output

A single BIGINT value that is the geohash value of the specified point geometry at depth=45.

Example

The following SQL statement returns the geohash, at depth 45, of the point geometry with the coordinates (1,2):

values st_geohash(st_point(1,2))
Result:
1
--------------------
-4610318878716198912
1 record(s) selected.