Skip to content

Commit e89046b

Browse files
authored
Also use renderd_config for mod_tile (openstreetmap#440)
Follow-up to openstreetmap#391 & openstreetmap#400
1 parent 9873dde commit e89046b

8 files changed

Lines changed: 749 additions & 1299 deletions

File tree

Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ test: gen_tile_test renderd_config_test renderd_test render_expired_test render_
149149
all-local:
150150
$(APXS) -c $(DEF_LDLIBS) $(AM_CFLAGS) \
151151
$(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \
152-
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
152+
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS) \
153153
@srcdir@/src/mod_tile.c \
154154
@srcdir@/src/g_logger.c \
155+
@srcdir@/src/renderd_config.c \
155156
@srcdir@/src/store.c \
156157
@srcdir@/src/store_file.c \
157158
@srcdir@/src/store_file_utils.c \
@@ -167,9 +168,10 @@ install-mod_tile:
167168
$(APXS) -S LIBEXECDIR=$(DESTDIR)`$(APXS) \
168169
-q LIBEXECDIR` -c -i $(DEF_LDLIBS) $(AM_CFLAGS) \
169170
$(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \
170-
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
171+
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS) \
171172
@srcdir@/src/mod_tile.c \
172173
@srcdir@/src/g_logger.c \
174+
@srcdir@/src/renderd_config.c \
173175
@srcdir@/src/store.c \
174176
@srcdir@/src/store_file.c \
175177
@srcdir@/src/store_file_utils.c \

docs/man/renderd.conf.5

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RENDERD.CONF 5 "2024-03-16" "mod_tile v0.7.1"
1+
.TH RENDERD.CONF 5 "2024-06-06" "mod_tile v0.7.1"
22
.\" Please adjust this date whenever revising the manpage.
33

44
.SH NAME
@@ -14,7 +14,7 @@ This manual page documents briefly the \fBrenderd.conf\fR configuration file.
1414
.PP
1515
The default location is \fB'/etc/renderd.conf'\fR (macro definition \fB'RENDERD_CONFIG'\fR).
1616
.PP
17-
All option names are \fBcase-insensitive\fR unless otherwise specified.
17+
All option names are \fBcase-insensitive\fR.
1818

1919

2020
.SH RENDERD
@@ -100,37 +100,32 @@ There must be at least one \fB[map]\fR section.
100100
\fB[map]\fR section names can be anything else, but they must all be unique.
101101

102102
.TP
103-
.B ASPECTX
103+
.B aspectx
104104
Specify the X aspect to be used by \fBmod_tile\fR.
105105
Only used by \fBmod_tile\fR.
106106
The default value is \fB'1'\fR.
107-
This option name is \fBcase-sensitive\fR.
108107

109108
.TP
110-
.B ASPECTY
109+
.B aspecty
111110
Specify the Y aspect to be used by \fBmod_tile\fR.
112111
Only used by \fBmod_tile\fR.
113112
The default value is \fB'1'\fR.
114-
This option name is \fBcase-sensitive\fR.
115113

116114
.TP
117-
.B ATTRIBUTION
115+
.B attribution
118116
Specify the data attribution to be provided by \fBmod_tile\fR as \fBTileJSON\fR (via \fB{URI}/tile-layer.json\fR).
119117
Only used by \fBmod_tile\fR.
120118
The default value is \fB'&copy;<a href=\\\\\\"http://www.openstreetmap.org/\\\\\\">OpenStreetMap</a> and <a href=\\\\\\"http://wiki.openstreetmap.org/wiki/Contributors\\\\\\">contributors</a>, <a href=\\\\\\"http://opendatacommons.org/licenses/odbl/\\\\\\">(ODbL)</a>'\fR (macro definition \fB'DEFAULT_ATTRIBUTION'\fR).
121-
This option name is \fBcase-sensitive\fR.
122119

123120
.TP
124-
.B CORS
121+
.B cors
125122
Specify the CORS configuration for \fBmod_tile\fR.
126123
Only used by \fBmod_tile\fR.
127-
This option name is \fBcase-sensitive\fR.
128124

129125
.TP
130-
.B DESCRIPTION
126+
.B description
131127
Specify the description to be provided by \fBmod_tile\fR as \fBTileJSON\fR (via \fB{URI}/tile-layer.json\fR).
132128
Only used by \fBmod_tile\fR.
133-
This option name is \fBcase-sensitive\fR.
134129

135130
.TP
136131
.B htcphost
@@ -143,28 +138,24 @@ Specify the IP address/hostname of the Host to be used by \fBrenderd\fR for HTCP
143138
Only used by \fBrenderd\fR.
144139

145140
.TP
146-
.B MAXZOOM
141+
.B maxzoom
147142
Specify the maximum zoom level for this section.
148143
The default value is \fB'20'\fR (macro definition \fB'MAX_ZOOM'\fR).
149-
This option name is \fBcase-sensitive\fR.
150144

151145
.TP
152-
.B MINZOOM
146+
.B minzoom
153147
Specify the minimum zoom level for this section.
154148
The default value is \fB'0'\fR.
155-
This option name is \fBcase-sensitive\fR.
156149

157150
.TP
158-
.B PARAMETERIZE_STYLE
151+
.B parameterize_style
159152
Specify the parameterization style/function to be used for this section.
160153
The value of \fB'language'\fR seems to be the only one supported.
161-
This option name is \fBcase-sensitive\fR.
162154

163155
.TP
164-
.B SERVER_ALIAS
156+
.B server_alias
165157
Specify a URL alias of this server to be provided by \fBmod_tile\fR as \fBTileJSON\fR (via \fB{URI}/tile-layer.json\fR).
166158
Only used by \fBmod_tile\fR.
167-
This option name is \fBcase-sensitive\fR.
168159

169160
.TP
170161
.B scale
@@ -173,10 +164,9 @@ Only used by \fBrenderd\fR.
173164
The default value is \fB'1.0'\fR.
174165

175166
.TP
176-
.B TILEDIR
167+
.B tiledir
177168
Specify the directory path into which tiles will be written by \fBrenderd\fR.
178169
The default value is \fB'/var/cache/renderd/tiles'\fR (macro definition \fB'RENDERD_TILE_DIR'\fR).
179-
This option name is \fBcase-sensitive\fR.
180170

181171
.TP
182172
.B tilesize
@@ -185,14 +175,12 @@ Only used by \fBrenderd\fR.
185175
The default value is \fB'256'\fR.
186176

187177
.TP
188-
.B TYPE
178+
.B type
189179
Specify the tile configuration (in the format \fB'<extension> <mime-type> <output-format>'\fR) for this section (e.g. \fB'png image/png png256'\fR).
190-
This option name is \fBcase-sensitive\fR.
191180

192181
.TP
193-
.B URI
182+
.B uri
194183
Specify the URI prefix with which tiles can be accessed for this section.
195-
This option name is \fBcase-sensitive\fR.
196184

197185
.TP
198186
.B xml

includes/mod_tile.h

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -92,54 +92,54 @@ typedef struct stats_data {
9292
} stats_data;
9393

9494
typedef struct {
95-
const char *store;
96-
char xmlname[XMLCONFIG_MAX];
97-
char baseuri[PATH_MAX];
98-
char fileExtension[PATH_MAX];
99-
char mimeType[PATH_MAX];
100-
const char *description;
95+
char **hostnames;
10196
const char *attribution;
97+
const char *baseuri;
10298
const char *cors;
103-
char **hostnames;
104-
int noHostnames;
105-
int minzoom;
106-
int maxzoom;
99+
const char *description;
100+
const char *fileExtension;
101+
const char *mimeType;
102+
const char *store;
103+
const char *xmlname;
107104
int aspect_x;
108105
int aspect_y;
109106
int enableOptions;
107+
int maxzoom;
108+
int minzoom;
109+
int noHostnames;
110110
} tile_config_rec;
111111

112112
typedef struct {
113113
apr_array_header_t *configs;
114-
int request_timeout;
115-
int request_timeout_priority;
116-
int max_load_old;
117-
int max_load_missing;
118-
apr_time_t veryold_threshold;
114+
apr_time_t very_old_threshold;
115+
const char *cache_extended_hostname;
116+
const char *renderd_socket_name;
117+
const char *tile_dir;
118+
double cache_duration_last_modified_factor;
119119
int cache_duration_dirty;
120+
int cache_duration_low_zoom;
120121
int cache_duration_max;
122+
int cache_duration_medium_zoom;
121123
int cache_duration_minimum;
122-
int cache_duration_low_zoom;
124+
int cache_extended_duration;
123125
int cache_level_low_zoom;
124-
int cache_duration_medium_zoom;
125126
int cache_level_medium_zoom;
126-
double cache_duration_last_modified_factor;
127-
char renderd_socket_name[PATH_MAX];
128-
int renderd_socket_port;
129-
char tile_dir[PATH_MAX];
130-
char cache_extended_hostname[PATH_MAX];
131-
int cache_extended_duration;
127+
int delaypool_render_size;
128+
int delaypool_tile_size;
129+
int enable_bulk_mode;
130+
int enable_dirty_url;
131+
int enable_global_stats;
132+
int enable_status_url;
133+
int enable_tile_throttling;
134+
int enable_tile_throttling_xforward;
135+
int max_load_missing;
136+
int max_load_old;
132137
int mincachetime[MAX_ZOOM_SERVER + 1];
133-
int enableGlobalStats;
134-
int enableTileThrottling;
135-
int enableTileThrottlingXForward;
136-
int delaypoolTileSize;
137-
long delaypoolTileRate;
138-
int delaypoolRenderSize;
139-
long delaypoolRenderRate;
140-
int bulkMode;
141-
int enableStatusUrl;
142-
int enableDirtyUrl;
138+
int renderd_socket_port;
139+
int request_timeout;
140+
int request_timeout_priority;
141+
long delaypool_render_rate;
142+
long delaypool_tile_rate;
143143
} tile_server_conf;
144144

145145
typedef struct tile_request_data {

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ set(mod_tile_SRCS
7777
${COMMON_SRCS}
7878
${STORE_SRCS}
7979
mod_tile.c
80+
renderd_config.c
8081
)
8182
set(mod_tile_LIBS
8283
${APR_LIBRARIES}
8384
${COMMON_LIBRARIES}
85+
${INIPARSER_LIBRARIES}
8486
${STORE_LIBRARIES}
8587
)
8688
add_library(mod_tile SHARED ${mod_tile_SRCS})

0 commit comments

Comments
 (0)