ST_GeomFromGeoHash — GeoHash文字列からジオメトリを返します。
geometry ST_GeomFromGeoHash(text geohash, integer precision=full_precision_of_geohash);
GeoHash文字列からジオメトリを返します。ジオメトリはGeoHashバウンディングボックスのポリゴン表現となります。
If no precision is specified ST_GeomFromGeoHash returns a polygon based on full precision of the input GeoHash string.
precisionが指定されると、ST_GeomFromGeoHashは、ポリゴンを生成するためGeoHashからの多数の文字を使います。
Availability: 2.1.0
SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz0'));
st_astext
--------------------------------------------------------------------------------------------------------------------------
POLYGON((-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646,-115.172816 36.114646))
SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz0', 4));
st_astext
------------------------------------------------------------------------------------------------------------------------------
POLYGON((-115.3125 36.03515625,-115.3125 36.2109375,-114.9609375 36.2109375,-114.9609375 36.03515625,-115.3125 36.03515625))
SELECT ST_AsText(ST_GeomFromGeoHash('9qqj7nmxncgyy4d0dbxqz0', 10));
st_astext
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
POLYGON((-115.17282128334 36.1146408319473,-115.17282128334 36.1146461963654,-115.172810554504 36.1146461963654,-115.172810554504 36.1146408319473,-115.17282128334 36.1146408319473))