Converts a grid string into a geomgrid value.
Syntax
geomgrid ST_GridFromText(text XYCode);
geomgrid ST_GridFromText(text XYCode, text ZCode);Parameters
| Parameter | Description |
|---|---|
XYCode | The 2D grid code in string format. |
ZCode | The height code in 3D grid split encoding. |
Examples
Convert a 2D grid code string to a geomgrid value:
SELECT ST_GridFromText('G0013103220310313');Output:
st_gridfromtext
----------------------
0102001074271B122020Convert a 3D grid code string to its text representation using ST_AsText:
SELECT ST_AsText(ST_GridFromText('G00131032223023031031','+10010'));Output:
st_astext
------------------------
GZ00262064446046072072