文档

ST_GeomFromGeoHash

更新时间:

返回一个与给定的GeoHash字符串相对应的Geometry对象。

语法

geometry  ST_GeomFromGeoHash(text  geohash , integer  precision);

参数

参数名称

描述

geohash

GeoHash字符串。

precision

精度。如果未指定精度,则ST_GeomFromGeoHash根据输入的GeoHash字符串的全精度返回Polygon。

示例

  • 全精度返回:

    SELECT ST_AsText(ST_GeomFromGeoHash('wx47x9u8gumnhzp791zb'));
                               st_astext
    ---------------------------------------------------------------
     POLYGON((116 39.9999999999999,116 40,116 40,116 39.9999999999.
    .999,116 39.9999999999999))
    (1 row)
    
  • 指定精度返回:

    SELECT ST_AsText(ST_GeomFromGeoHash('wx47x9u8gumnhzp791zb',2));
                               st_astext
    ---------------------------------------------------------------
     POLYGON((112.5 39.375,112.5 45,123.75 45,123.75 39.375,112.5 .
    .39.375))
    (1 row)
    
  • 本页导读 (1)
文档反馈