- Categories:
ST_GEOGFROMGEOHASH¶
Returns a GEOGRAPHY object for the polygon that represents the boundaries of a geohash.
The optional precision argument specifies the precision to use for the input geohash.
For example, passing 5 for precision specifies that the function should use the first 5 characters of the input geohash.
- See also:
Syntax¶
Arguments¶
Required:
geohashThe argument must be a geohash.
Optional:
precisionThe number of characters to use from the input geohash. For example, passing
5forprecisioncauses the function to use the first 5 characters in the geohash.You can specify a value from
1to20.By default,
precisionis20, which causes the function to use up to the first 20 characters of the geohash.
Returns¶
The function returns a value of type GEOGRAPHY.
Examples¶
The following example returns the GEOGRAPHY object for a geohash:
The following example returns the GEOGRAPHY object for a less precise geohash. The function uses the first 6 characters from the input geohash: