Returns a Mapbox Vector Tile (MVT)-formatted binary for a tile retrieved 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 tile ID in 'z_x_y' format. |
x | The x value of the tile ID. |
y | The y value of the tile ID. |
z | The z value of the tile ID. |
Description
ST_Tile queries a pyramid by tile ID and returns the tile as an MVT binary (bytea). Tile IDs follow the 'z_x_y' format and use the EPSG:3857 coordinate system (Web Mercator).
Pass the tile ID as a single string (key) or as three separate integers (x, y, z). Both forms return identical results.
Examples
Pass the tile ID as a string:
SELECT ST_Tile('roads', '3_1_6');st_tile
----------
0xFFAABB8D8A6678...Pass the tile ID as separate x, y, z integers:
SELECT ST_Tile('roads', 1, 6, 3);st_tile
----------
0xFFAABB8D8A6678...