This topic describes the ST_Tile function, which generates a MVT-formatted standard binary structure based on the ID of a tile from 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 ID of the tile. |
x | The x value in the tile ID. |
y | The y value in the tile ID. |
z | The z value in the tile ID. |
Description
This function returns a MVT-formatted standard binary structure that is generated
based on the ID of a tile from a pyramid. The tile ID that is specified by the key
parameter is encoded in the 'z_x_y'
format based on the EPSG:4326
or EPSG:3857
coordinate system.
Note If the
EPSG:4326
coordinate system is used, the number of chunks on the x axis is twice the number
of chunks on the y axis. The z value starts from 1. If the z value is 1, the tile
ID can only be 1_0_0
or 1_1_0
.
Example
select ST_Tile('roads', '3_1_6');
st_tile
----------
0xFFAABB8D8A6678...
select ST_Tile('roads', 1, 6, 3);
st_tile
----------
0xFFAABB8D8A6678...