All Products
Search
Document Center

ApsaraDB RDS:ST_GeoHashFromID

Last Updated:Mar 28, 2026

Converts a bigint value to a Geohash string. Use this function to reverse the output of ST_GeoHashID.

Syntax

cstring ST_GeoHashFromID(bigint value);

Parameters

ParameterDescription
valueThe integer value to convert. Pass the return value of ST_GeoHashID.

Examples

The following example converts a geometry point to a Geohash string, encodes it as a bigint with ST_GeoHashID, and then decodes it back to a Geohash string with ST_GeoHashFromID.

SELECT ST_GeoHashFromID(
    ST_GeoHashID(ST_GeoHash(
        ST_GeomFromText('POINT(-115.172816 36.114646)'), 11)::cstring));

Output:

 9qqj7nmxncg