名稱

ST_PointFromGeoHash — 從 GeoHash 字串回傳一個點。

概要

point ST_PointFromGeoHash(text geohash, integer precision=full_precision_of_geohash);

描述

從 GeoHash 字串回傳一個點。該點代表 GeoHash 的中心點。

如果沒有指定 precision,則 ST_PointFromGeoHash 會根據輸入 GeoHash 字串的完整精確度回傳一個點。

如果指定了 precision,ST_PointFromGeoHash 將使用 GeoHash 中指定數量的字元來建立點。

可用版本:2.1.0

範例

SELECT ST_AsText(ST_PointFromGeoHash('9qqj7nmxncgyy4d0dbxqz0'));
          st_astext
------------------------------
 POINT(-115.172816 36.114646)

SELECT ST_AsText(ST_PointFromGeoHash('9qqj7nmxncgyy4d0dbxqz0', 4));
             st_astext
-----------------------------------
 POINT(-115.13671875 36.123046875)

SELECT ST_AsText(ST_PointFromGeoHash('9qqj7nmxncgyy4d0dbxqz0', 10));
                 st_astext
-------------------------------------------
 POINT(-115.172815918922 36.1146435141563)