Generates an MVT-formatted standard binary structure from a tile ID in a pyramid.
Syntax
bytea ST_Tile(cstring name, cstring key);
bytea ST_Tile(cstring name, int x, int y, int z);Parameters
| Parameter | Description |
|---|---|
name | The name of the pyramid. |
key | The tile ID, encoded in 'z_x_y' format. |
x | The x value in the tile ID. |
y | The y value in the tile ID. |
z | The z value in the tile ID. |
Usage notes
ST_Tile returns an MVT-formatted standard binary structure based on the tile ID in a pyramid. The tile ID is encoded in 'z_x_y' format and must correspond to either the EPSG:4326 or EPSG:3857 coordinate system.
When using EPSG:4326:
The number of chunks on the x-axis is twice the number on the y-axis.
The z value starts from
1. At z=1, the only valid tile IDs are1_0_0and1_1_0.
Examples
The following examples show both ways to call ST_Tile. Both calls return the same result — the first uses the key string format, and the second passes the x, y, and z values individually.
SELECT ST_Tile('roads', '3_1_6');st_tile
----------
0xFFAABB8D8A6678...SELECT ST_Tile('roads', 1, 6, 3);st_tile
----------
0xFFAABB8D8A6678...