Skip to content

Commit

Permalink
Also use renderd_config for mod_tile (openstreetmap#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
hummeltech authored Jun 19, 2024
1 parent 9873dde commit e89046b
Show file tree
Hide file tree
Showing 8 changed files with 749 additions and 1,299 deletions.
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ test: gen_tile_test renderd_config_test renderd_test render_expired_test render_
all-local:
$(APXS) -c $(DEF_LDLIBS) $(AM_CFLAGS) \
$(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS) \
@srcdir@/src/mod_tile.c \
@srcdir@/src/g_logger.c \
@srcdir@/src/renderd_config.c \
@srcdir@/src/store.c \
@srcdir@/src/store_file.c \
@srcdir@/src/store_file_utils.c \
Expand All @@ -167,9 +168,10 @@ install-mod_tile:
$(APXS) -S LIBEXECDIR=$(DESTDIR)`$(APXS) \
-q LIBEXECDIR` -c -i $(DEF_LDLIBS) $(AM_CFLAGS) \
$(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS) \
@srcdir@/src/mod_tile.c \
@srcdir@/src/g_logger.c \
@srcdir@/src/renderd_config.c \
@srcdir@/src/store.c \
@srcdir@/src/store_file.c \
@srcdir@/src/store_file_utils.c \
Expand Down
40 changes: 14 additions & 26 deletions docs/man/renderd.conf.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH RENDERD.CONF 5 "2024-03-16" "mod_tile v0.7.1"
.TH RENDERD.CONF 5 "2024-06-06" "mod_tile v0.7.1"
.\" Please adjust this date whenever revising the manpage.

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


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

.TP
.B ASPECTX
.B aspectx
Specify the X aspect to be used by \fBmod_tile\fR.
Only used by \fBmod_tile\fR.
The default value is \fB'1'\fR.
This option name is \fBcase-sensitive\fR.

.TP
.B ASPECTY
.B aspecty
Specify the Y aspect to be used by \fBmod_tile\fR.
Only used by \fBmod_tile\fR.
The default value is \fB'1'\fR.
This option name is \fBcase-sensitive\fR.

.TP
.B ATTRIBUTION
.B attribution
Specify the data attribution to be provided by \fBmod_tile\fR as \fBTileJSON\fR (via \fB{URI}/tile-layer.json\fR).
Only used by \fBmod_tile\fR.
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).
This option name is \fBcase-sensitive\fR.

.TP
.B CORS
.B cors
Specify the CORS configuration for \fBmod_tile\fR.
Only used by \fBmod_tile\fR.
This option name is \fBcase-sensitive\fR.

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

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

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

.TP
.B MINZOOM
.B minzoom
Specify the minimum zoom level for this section.
The default value is \fB'0'\fR.
This option name is \fBcase-sensitive\fR.

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

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

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

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

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

.TP
.B TYPE
.B type
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).
This option name is \fBcase-sensitive\fR.

.TP
.B URI
.B uri
Specify the URI prefix with which tiles can be accessed for this section.
This option name is \fBcase-sensitive\fR.

.TP
.B xml
Expand Down
66 changes: 33 additions & 33 deletions includes/mod_tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,54 +92,54 @@ typedef struct stats_data {
} stats_data;

typedef struct {
const char *store;
char xmlname[XMLCONFIG_MAX];
char baseuri[PATH_MAX];
char fileExtension[PATH_MAX];
char mimeType[PATH_MAX];
const char *description;
char **hostnames;
const char *attribution;
const char *baseuri;
const char *cors;
char **hostnames;
int noHostnames;
int minzoom;
int maxzoom;
const char *description;
const char *fileExtension;
const char *mimeType;
const char *store;
const char *xmlname;
int aspect_x;
int aspect_y;
int enableOptions;
int maxzoom;
int minzoom;
int noHostnames;
} tile_config_rec;

typedef struct {
apr_array_header_t *configs;
int request_timeout;
int request_timeout_priority;
int max_load_old;
int max_load_missing;
apr_time_t veryold_threshold;
apr_time_t very_old_threshold;
const char *cache_extended_hostname;
const char *renderd_socket_name;
const char *tile_dir;
double cache_duration_last_modified_factor;
int cache_duration_dirty;
int cache_duration_low_zoom;
int cache_duration_max;
int cache_duration_medium_zoom;
int cache_duration_minimum;
int cache_duration_low_zoom;
int cache_extended_duration;
int cache_level_low_zoom;
int cache_duration_medium_zoom;
int cache_level_medium_zoom;
double cache_duration_last_modified_factor;
char renderd_socket_name[PATH_MAX];
int renderd_socket_port;
char tile_dir[PATH_MAX];
char cache_extended_hostname[PATH_MAX];
int cache_extended_duration;
int delaypool_render_size;
int delaypool_tile_size;
int enable_bulk_mode;
int enable_dirty_url;
int enable_global_stats;
int enable_status_url;
int enable_tile_throttling;
int enable_tile_throttling_xforward;
int max_load_missing;
int max_load_old;
int mincachetime[MAX_ZOOM_SERVER + 1];
int enableGlobalStats;
int enableTileThrottling;
int enableTileThrottlingXForward;
int delaypoolTileSize;
long delaypoolTileRate;
int delaypoolRenderSize;
long delaypoolRenderRate;
int bulkMode;
int enableStatusUrl;
int enableDirtyUrl;
int renderd_socket_port;
int request_timeout;
int request_timeout_priority;
long delaypool_render_rate;
long delaypool_tile_rate;
} tile_server_conf;

typedef struct tile_request_data {
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ set(mod_tile_SRCS
${COMMON_SRCS}
${STORE_SRCS}
mod_tile.c
renderd_config.c
)
set(mod_tile_LIBS
${APR_LIBRARIES}
${COMMON_LIBRARIES}
${INIPARSER_LIBRARIES}
${STORE_LIBRARIES}
)
add_library(mod_tile SHARED ${mod_tile_SRCS})
Expand Down
Loading

0 comments on commit e89046b

Please sign in to comment.