ST_LongFromGeoHash¶
TL;DR¶
ST_LongFromGeoHash 解码 GeoHash,并返回其单元中心点的经度。
语法¶
ST_LongFromGeoHash(geohash)
参数说明¶
geohash 是 VARCHAR GeoHash 字符串。
返回值¶
返回解码后的中心经度,类型为 FLOAT64。
使用说明¶
结果是编码单元的中心;GeoHash 精度决定解码坐标的精度。无效 GeoHash 字符会被拒绝。
示例¶
DROP DATABASE IF EXISTS geo_st_longfromgeohash_demo;
CREATE DATABASE geo_st_longfromgeohash_demo;
USE geo_st_longfromgeohash_demo;
SELECT ST_LongFromGeoHash('ezs42') AS longitude;
SELECT ST_LongFromGeoHash(ST_GeoHash(12.5, -7.25, 20)) AS round_trip_longitude;
DROP DATABASE geo_st_longfromgeohash_demo;