ST_GeoHashID

更新时间: 2026-03-28 08:12:13

Converts a GeoHash string into a bigint value to improve storage and query efficiency.

Syntax

bigint ST_GeoHashID(cstring geoHash);

Parameters

ParameterDescription
geoHashThe GeoHash string to convert. Supports strings up to 11 characters.

Description

ST_GeoHashID encodes a GeoHash string as a bigint integer. Storing geospatial locations as integers reduces storage overhead and speeds up indexing and spatial computations compared to string-based GeoHash values.

Examples

Convert a point geometry to a GeoHash string and then to a bigint ID:

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

Output:

 2220678768189336756
上一篇: Auxiliary functions 下一篇: ST_GeoHashFromID
阿里云首页 云数据库 RDS 相关技术圈