mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
renderd.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007 - 2026 by mod_tile contributors (see AUTHORS file)
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; If not, see http://www.gnu.org/licenses/.
16 */
17
18#ifndef RENDERD_H
19#define RENDERD_H
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#include "config.h"
26#include "gen_tile.h"
27
28#ifndef HAVE_DAEMON
29 int daemon(int nochdir, int noclose);
30#endif
31
33#define INILINE_MAX 256
35#define MAX_SLAVES 5
37#define RENDER_THREAD_STARTUP_TIMEOUT_SEC 5
38
42 typedef struct {
44 const char *iphostname;
46 const char *mapnik_font_dir;
48 const char *mapnik_plugins_dir;
50 const char *name;
52 const char *pid_filename;
54 const char *socketname;
56 const char *stats_filename;
58 const char *tile_dir;
60 int ipport;
66
70 typedef struct {
72 const char *attribution;
74 const char *cors;
76 const char *description;
78 const char *file_extension;
80 const char *host;
82 const char *htcpip;
84 const char *mime_type;
86 const char *output_format;
88 const char *parameterization;
90 const char *server_alias;
92 const char *tile_dir;
94 const char *xmlfile;
96 const char *xmlname;
98 const char *xmluri;
116
117 extern struct request_queue *render_request_queue;
118
119 void statsRenderFinish(int z, long time);
120 void request_exit(void);
121 void send_response(struct item *item, enum protoCmd rsp, int render_time);
122 enum protoCmd rx_request(struct protocol *req, int fd);
123
124#ifdef __cplusplus
125}
126#endif
127
128#endif /* RENDERD_H */
protoCmd
Command opcodes exchanged over the mod_tile / renderd IPC wire protocol.
Definition protocol.h:65
void request_exit(void)
Async-signal-safe shutdown trigger waking the main poll() event loop via exit_pipe_fd.
Definition renderd.c:212
void send_response(struct item *item, enum protoCmd rsp, int render_time)
Complete a metatile render request, notify all waiting clients, and free its queue items.
Definition renderd.c:126
void statsRenderFinish(int z, long time)
struct request_queue * render_request_queue
Global thread-safe render request queue shared by network I/O, local workers, and slave threads.
Definition renderd.c:75
enum protoCmd rx_request(struct protocol *req, int fd)
Normalize, validate, and enqueue an incoming wire protocol render or dirty request.
Definition renderd.c:159
int daemon(int nochdir, int noclose)
Definition daemon_compat.c:52
Node representing a queued or active metatile render request in the scheduler.
Definition gen_tile.h:50
Version 3 wire protocol message packet (PROTO_VER == 3).
Definition protocol.h:89
Global daemon and Mapnik runtime settings parsed from a [renderd] INI section.
Definition renderd.h:42
const char * mapnik_plugins_dir
Directory path searched for Mapnik input datasource plugins.
Definition renderd.h:48
const char * name
INI section name identifying this renderd instance (e.g., "renderd").
Definition renderd.h:50
int ipport
TCP listen port number when iphostname is configured.
Definition renderd.h:60
int mapnik_font_dir_recurse
Non-zero to recursively scan subdirectories under mapnik_font_dir.
Definition renderd.h:62
int num_threads
Number of worker rendering threads spawned for this daemon instance.
Definition renderd.h:64
const char * tile_dir
Default root tile/metatile storage directory or backend connection string.
Definition renderd.h:58
const char * mapnik_font_dir
Directory path searched for Mapnik TrueType/OpenType fonts.
Definition renderd.h:46
const char * socketname
UNIX domain socket path for IPC with mod_tile (NULL when listening over TCP).
Definition renderd.h:54
const char * iphostname
TCP listen hostname/IP address (NULL when using a UNIX domain socket).
Definition renderd.h:44
const char * pid_filename
Filesystem path where the daemon writes its PID file.
Definition renderd.h:52
const char * stats_filename
Optional output file path for periodic renderd runtime statistics dumps.
Definition renderd.h:56
Thread-safe multi-priority metatile render queue with hash-based duplicate coalescing.
Definition request_queue.h:77
Per-map-style configuration parsed from a [mapname] section in renderd.conf.
Definition renderd.h:70
const char * xmlfile
Filesystem path to the Mapnik XML stylesheet file.
Definition renderd.h:94
const char * cors
Cross-Origin Resource Sharing (Access-Control-Allow-Origin) policy string.
Definition renderd.h:74
int num_threads
Number of render threads initializing or serving this map style.
Definition renderd.h:110
double scale_factor
Mapnik rendering scale factor (1.0 for standard DPI, 2.0 for Retina/HiDPI).
Definition renderd.h:100
int tile_px_size
Width and height of a single rendered tile in pixels (e.g., 256 or 512).
Definition renderd.h:112
const char * server_alias
Space-separated HTTP virtual host aliases serving this map style.
Definition renderd.h:90
const char * file_extension
File extension of rendered tiles without leading dot (e.g., "png", "jpg").
Definition renderd.h:78
const char * htcpip
HTCP cache-invalidation target host/IP for notifying upstream caches (e.g., Squid).
Definition renderd.h:82
const char * output_format
Mapnik image writer format string (e.g., "png256", "jpeg80", "webp").
Definition renderd.h:86
const char * xmluri
Base HTTP URL path prefix where tiles for this style are exposed (e.g., "/osm/").
Definition renderd.h:98
int max_zoom
Maximum zoom level permitted for this map style.
Definition renderd.h:106
const char * host
Primary HTTP virtual host name serving this map style.
Definition renderd.h:80
const char * tile_dir
Tile storage root directory or backend connection URI overriding the daemon default.
Definition renderd.h:92
int min_zoom
Minimum zoom level permitted for this map style.
Definition renderd.h:108
const char * description
Human-readable map description advertised in TileJSON metadata.
Definition renderd.h:76
const char * mime_type
MIME type of rendered tiles (e.g., "image/png").
Definition renderd.h:84
int aspect_y
Vertical projection aspect ratio multiplier (typically 1).
Definition renderd.h:104
const char * xmlname
Logical map configuration identifier (xmlname) used in IPC requests.
Definition renderd.h:96
const char * attribution
Attribution string advertised in TileJSON metadata for this map style.
Definition renderd.h:72
const char * parameterization
Optional dynamic style parameterization handler name (e.g., "language").
Definition renderd.h:88
int aspect_x
Horizontal projection aspect ratio multiplier (typically 1, or 2 for Plate Carrée).
Definition renderd.h:102
int total_threads_ok
Count of worker threads that successfully loaded xmlfile during startup.
Definition renderd.h:114