mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
render_list.c File Reference
#include <getopt.h>
#include <glib.h>
#include <limits.h>
#include <math.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

int lon2tilex (double lon, int z)
 Convert a WGS84 longitude in degrees to a Slippy Map X tile coordinate at zoom z.
int lat2tiley (double lat, int z)
 Convert a WGS84 latitude in degrees to a Slippy Map Y tile coordinate at zoom z (Web Mercator).
int main (int argc, char **argv)
 Entry point for the render_list bulk tile pre-rendering CLI utility.

Function Documentation

◆ lat2tiley()

int lat2tiley ( double lat,
int z )

Convert a WGS84 latitude in degrees to a Slippy Map Y tile coordinate at zoom z (Web Mercator).

Parameters
latLatitude in decimal degrees ([-85.0511, 85.0511]).
zSlippy Map zoom level (0 to MAX_ZOOM).
Returns
Zero-based Y tile index at zoom z (increasing southward from the north Web Mercator limit).

◆ lon2tilex()

int lon2tilex ( double lon,
int z )

Convert a WGS84 longitude in degrees to a Slippy Map X tile coordinate at zoom z.

Parameters
lonLongitude in decimal degrees ([-180.0, 180.0]).
zSlippy Map zoom level (0 to MAX_ZOOM).
Returns
Zero-based X tile index at zoom z (note: returns 2^z when lon == 180.0).

◆ main()

int main ( int argc,
char ** argv )

Entry point for the render_list bulk tile pre-rendering CLI utility.

Parses command-line options and optional renderd INI configuration, initializes the storage backend and worker submission pool, and either iterates across all metatiles in a zoom/coordinate/lat-lon bounding box (--all) or reads whitespace-delimited X Y Z tile coordinates from stdin, enqueueing missing, expired, or forced (--force) metatiles to renderd and reporting throughput statistics upon completion.

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