Converts a Geohash string to a bigint value, making it efficient for storage and numeric computation.
Syntax
bigint ST_GeoHashID(cstring geoHash);Parameters
| Parameter | Type | Description |
|---|---|---|
geoHash | cstring | The Geohash string to convert. |
Usage notes
The function supports Geohash strings of up to 16 characters.
Examples
Convert a Geohash string derived from a geographic point to a bigint value:
SELECT ST_GeoHashID(
ST_GeoHash(ST_GeomFromWKT('POINT(-115.172816 36.114646)'), 11)::cstring
);Output:
2220678768189336756