Name

ST_GeoHash — ジオメトリのGeoHash表現を返します。

Synopsis

text ST_GeoHash(geometry geom, integer maxchars=full_precision_of_point);

説明

ジオメトリのGeoHash表現 (http://en.wikipedia.org/wiki/Geohash)を返します。GeoHashによって、ポイントは、prefixingに基づいてソートと検索が可能なテキスト形式にエンコードされます。短いGeoHashは低精度のポイント表現です。実際の点を含むボックスとも考えられます。

If no maxchars is specified ST_GeoHash returns a GeoHash based on full precision of the input geometry type. Points return a GeoHash with 20 characters of precision (about enough to hold the full double precision of the input). Other types return a GeoHash with a variable amount of precision, based on the size of the feature. Larger features are represented with less precision, smaller features with more precision. The idea is that the box implied by the GeoHash will always contain the input feature.

maxcharsを指定した場合には、ST_GeoHashは、最高でもその文字数によるGeoHashを返し、入力ジオメトリはおそらく低精度表現となります。ポイント以外では、計算の開始点はジオメトリのバウンディングボックスの中心となります。

Availability: 1.4.0

[Note]

ST_GeoHashはジオグラフィ (経度緯度)座標系では動作しません。

This method supports Circular Strings and Curves

SELECT ST_GeoHash(ST_SetSRID(ST_MakePoint(-126,48),4326));

         st_geohash
----------------------
 c0w3hf1s70w3hf1s70w3

SELECT ST_GeoHash(ST_SetSRID(ST_MakePoint(-126,48),4326),5);

 st_geohash
------------
 c0w3h
                
                

関連情報

ST_GeomFromGeoHash