|
mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
|
In-memory builder and serializer for a METATILE x METATILE grid of rendered map tiles. More...
#include <metatile.h>
Public Member Functions | |
| metaTile (const std::string &xmlconfig, const std::string &options, int x, int y, int z) | |
| Construct a new metaTile container for the given map style and top-left tile coordinates. | |
| void | clear () |
| Reset all sub-tile image payloads in the METATILE x METATILE grid to empty strings. | |
| void | set (int x, int y, const std::string &data) |
| Store encoded image data for a single sub-tile within the metatile grid. | |
| const std::string | get (int x, int y) |
| Retrieve the encoded image data for a single sub-tile within the metatile grid. | |
| int | xyz_to_meta_offset (int x, int y, int z) |
| Compute the linear index into a metatile's offset table for tile (x, y, z). | |
| void | save (struct storage_backend *store) |
| Serialize the metatile header, index table, and tile payloads, and write to storage. | |
| void | expire_tiles (int sock, const char *host, const char *uri) |
| Send HTCP cache purge requests for every individual tile covered by this metatile. | |
In-memory builder and serializer for a METATILE x METATILE grid of rendered map tiles.
Collects individual rendered tile payloads (set()), serializes them with a meta_layout header and offset index table into a storage backend (save()), and dispatches HTCP cache invalidation requests for all constituent tiles (expire_tiles()).
| metaTile::metaTile | ( | const std::string & | xmlconfig, |
| const std::string & | options, | ||
| int | x, | ||
| int | y, | ||
| int | z ) |
Construct a new metaTile container for the given map style and top-left tile coordinates.
Initializes all sub-tile image buffers to empty strings via clear().
| xmlconfig | Logical map style name (e.g., "default"). |
| options | Style parameterization options string (empty string if unused). |
| x | Top-left tile X coordinate of the metatile (aligned to METATILE). |
| y | Top-left tile Y coordinate of the metatile (aligned to METATILE). |
| z | Tile zoom level. |
| void metaTile::clear | ( | ) |
Reset all sub-tile image payloads in the METATILE x METATILE grid to empty strings.
| void metaTile::expire_tiles | ( | int | sock, |
| const char * | host, | ||
| const char * | uri ) |
Send HTCP cache purge requests for every individual tile covered by this metatile.
Clamps the iteration range to min(2^z, METATILE) so non-existent coordinates are not purged at very low zoom levels (e.g., z = 0..2).
| sock | Connected UDP socket descriptor to the HTCP cache server (no-op if < 0). |
| host | Public HTTP hostname used in the purged tile URLs. |
| uri | Base URI path prefix for the tileset. |
| const std::string metaTile::get | ( | int | x, |
| int | y ) |
| void metaTile::save | ( | struct storage_backend * | store | ) |
Serialize the metatile header, index table, and tile payloads, and write to storage.
Assembles the binary metatile blob in memory:
Writes the resulting buffer via store->metatile_write() and logs a warning if memory allocation or storage persistence fails.
| store | Storage backend instance responsible for persisting the metatile. |
| void metaTile::set | ( | int | x, |
| int | y, | ||
| const std::string & | data ) |
| int metaTile::xyz_to_meta_offset | ( | int | x, |
| int | y, | ||
| int | z ) |
Compute the linear index into a metatile's offset table for tile (x, y, z).
Masks the lower bits of x and y against METATILE - 1 (assuming METATILE is a power of two) and arranges entries in column-major order (dx * METATILE + dy).
| x | Global tile X coordinate. |
| y | Global tile Y coordinate. |
| z | Tile zoom level (unused; kept for signature consistency). |