Description
The ST_SquareHashBoundary
function returns a WritableGeometry that defines
the boundary of a cell in a grid if given a unique ID for the location. It also can return
the boundary of the cell that contains the given point at the specified precision. Square
hash cells appear square when displayed on a Popular Mercator map.
Syntax
ST_SquareHashBoundary(String UNIQUE_ID)
Parameters
Parameter |
Type |
Description |
UNIQUE_ID
|
String |
The unique geohash identifier of a cell in a grid. |
Return Values
Return Type |
Description |
WritableGeometry |
A representation of the boundary of a cell in a grid. |
Examples
SELECT ST_SquareHashBoundary(hashStringId) FROM table;
SELECT ST_SquareHashBoundary("03332");
Syntax
ST_SquareHashBoundary(Number|String X, Number|String Y, Number precision)
Parameters
Parameter |
Type |
Description |
X
|
Number or String |
The longitude value of the point. |
Y
|
Number or String |
The latitude value of the point. |
precision
|
Number |
The length of the string key to be returned. The precision determines how large
the grid cells are (longer strings means higher precision and smaller grid
cells). |
Return Values
Return Type |
Description |
WritableGeometry |
The boundary of the grid cell at the given precision that the point falls
into. |
Examples
SELECT ST_SquareHashBoundary(x, y, precision) FROM table;
SELECT ST_SquareHashBoundary("-73.750333", "42.736103", 3);
SELECT ST_SquareHashBoundary(-73.750333, 42.736103, 3);