mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
render_expired.c File Reference
#include <getopt.h>
#include <glib.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/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.h"

Functions

static gint64 tile_key (int z, int x, int y)
 Pack metatile zoom and grid coordinates (z, x, y) into a 64-bit hash key.
static int tile_is_requested (int z, int x, int y)
 Check whether a metatile has already been seen and processed during this run.
static void set_tile_requested (int z, int x, int y)
 Record a metatile in tile_requested so subsequent ancestor traversals skip it.
int main (int argc, char **argv)
 Entry point for the render_expired tile expiration and re-rendering CLI utility.

Variables

static GHashTable * tile_requested
 Deduplication set of already-processed metatile coordinates (gint64 packed keys).

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Entry point for the render_expired tile expiration and re-rendering CLI utility.

Reads expired tile coordinates (z/x/y) from stdin, normalizes each coordinate to max_zoom, walks upward through ancestor zoom levels down to min_zoom, deduplicates metatiles via tile_requested, checks cache existence via the configured storage backend, and deletes (--delete-from), marks expired (--touch-from), or enqueues re-render jobs to renderd accordingly.

Parameters
argcCommand-line argument count.
argvCommand-line argument vector.
Returns
0 on completion, or 1 on invalid options, missing config/map, or storage init failure.

◆ set_tile_requested()

void set_tile_requested ( int z,
int x,
int y )
static

Record a metatile in tile_requested so subsequent ancestor traversals skip it.

Allocates a heap gint64 key owned and freed by tile_requested.

Parameters
zMetatile-adjusted zoom level.
xMetatile X index.
yMetatile Y index.

◆ tile_is_requested()

int tile_is_requested ( int z,
int x,
int y )
static

Check whether a metatile has already been seen and processed during this run.

Parameters
zMetatile-adjusted zoom level.
xMetatile X index.
yMetatile Y index.
Returns
Non-zero (TRUE) if (z, x, y) is present in tile_requested, 0 (FALSE) otherwise.

◆ tile_key()

gint64 tile_key ( int z,
int x,
int y )
static

Pack metatile zoom and grid coordinates (z, x, y) into a 64-bit hash key.

Parameters
zMetatile-adjusted zoom level (z - excess_zoomlevels).
xMetatile X index (x >> excess_zoomlevels, masked to 24 bits).
yMetatile Y index (y >> excess_zoomlevels, masked to 24 bits).
Returns
Packed 64-bit integer key suitable for g_int64_hash.

Variable Documentation

◆ tile_requested

GHashTable* tile_requested
static

Deduplication set of already-processed metatile coordinates (gint64 packed keys).

Ensures each metatile is stat'ed, deleted, touched, or queued for re-rendering at most once even when multiple input z/x/y coordinates expand to overlapping ancestor metatiles.