|
mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
|
#include <dirent.h>#include <errno.h>#include <getopt.h>#include <glib.h>#include <limits.h>#include <stdio.h>#include <string.h>#include <sys/stat.h>#include <sys/time.h>#include <time.h>#include <unistd.h>#include "config.h"#include "g_logger.h"#include "protocol.h"#include "render_config.h"#include "render_submit_queue.h"#include "renderd_config.h"#include "store_file_utils.h"Functions | |
| static void | descend (const char *tile_dir, const char *search, int verbose) |
| Recursively traverse a tile cache directory tree and enqueue outdated .meta metatiles. | |
| void | render_layer (const char *tile_dir, const char *mapname, int min_zoom, int max_zoom, int verbose) |
| Scan and re-render outdated metatiles for a single map style across a zoom range. | |
| int | main (int argc, char **argv) |
| Entry point for the render_old stale-metatile re-rendering CLI utility. | |
Variables | |
| static int | num_render = 0 |
| Total count of outdated .meta metatiles enqueued for re-rendering (num_render) and scanned (num_all). | |
| static int | num_all = 0 |
| static time_t | planet_timestamp = 0 |
| Cutoff UNIX timestamp (planet-import-complete mtime or --timestamp override); older metatiles are re-rendered. | |
| static struct timeval start | end |
| Wall-clock timestamps marking the start and end of the tile scan and submission run. | |
|
static |
Recursively traverse a tile cache directory tree and enqueue outdated .meta metatiles.
Walks subdirectories under search, throttles via check_load(), inspects the st_mtime of each .meta file against planet_timestamp, decodes its coordinates via path_to_xyz(), and submits stale metatiles to renderd via enqueue().
| tile_dir | Root tile cache directory path used to strip the prefix in path_to_xyz(). |
| search | Current directory path being traversed. |
| verbose | Non-zero to log directory open errors and progress messages. |
| int main | ( | int | argc, |
| char ** | argv ) |
Entry point for the render_old stale-metatile re-rendering CLI utility.
Parses command-line options (-c/--config, -m/--map, -l/--max-load, -Z/--max-zoom, -z/--min-zoom, -n/--num-threads, -s/--socket, -t/--tile-dir, -T/--timestamp, -v/--verbose, -h/--help, -V/--version), loads renderd INI configuration, determines the planet import cutoff timestamp via --timestamp or get_planet_time(), spawns worker threads, scans all configured map layers (or the single --map style) via render_layer(), and prints throughput statistics upon completion.
| argc | Command-line argument count. |
| argv | Command-line argument vector. |
| void render_layer | ( | const char * | tile_dir, |
| const char * | mapname, | ||
| int | min_zoom, | ||
| int | max_zoom, | ||
| int | verbose ) |
Scan and re-render outdated metatiles for a single map style across a zoom range.
Iterates from min_zoom through max_zoom inclusive, constructing <tile_dir>/<mapname>/<z> for each zoom level and invoking descend() to find stale .meta files.
| tile_dir | Root tile cache directory path. |
| mapname | Configured map style name (xmlname). |
| min_zoom | Lowest zoom level to scan (inclusive). |
| max_zoom | Highest zoom level to scan (inclusive). |
| verbose | Non-zero to log each zoom level as it is scanned. |
|
static |
Wall-clock timestamps marking the start and end of the tile scan and submission run.
|
static |
|
static |
Total count of outdated .meta metatiles enqueued for re-rendering (num_render) and scanned (num_all).
|
static |
Cutoff UNIX timestamp (planet-import-complete mtime or --timestamp override); older metatiles are re-rendered.