mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
store_file_utils.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 STORE_FILE_UTILS_H
19#define STORE_FILE_UTILS_H
20
21#include <sys/types.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include "render_config.h"
28
29 time_t get_planet_time(const char *tile_dir, const char *xmlname);
30
31 /* Build parent directories for the specified file name
32 * Note: the part following the trailing / is ignored
33 * e.g. mkdirp("/a/b/foo.png") == shell mkdir -p /a/b
34 */
35 int mkdirp(const char *path);
36
37 /* File path hashing. Used by both mod_tile and render daemon
38 * The two must both agree on the file layout for metatiling
39 * to work
40 */
41 int path_to_xyz(const char *tilepath, const char *path, char *xmlconfig, int *px, int *py, int *pz);
42
43 /* Returns the path to the metatile and the offset within the metatile */
44 int xyzo_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, const char *options, int x, int y, int z);
45 int xyz_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z);
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif /* STORE_FILE_UTILS_H */
int path_to_xyz(const char *tilepath, const char *path, char *xmlconfig, int *px, int *py, int *pz)
Parse a metatile or tile filesystem path back into (xmlconfig, px, py, pz).
Definition store_file_utils.c:202
int mkdirp(const char *path)
Recursively create all parent directories required for a target file path.
Definition store_file_utils.c:81
int xyzo_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, const char *options, int x, int y, int z)
Compute the .meta file path and sub-tile index for (xmlconfig, options, x, y, z).
Definition store_file_utils.c:298
int xyz_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z)
Compute the .meta file path and sub-tile index for unparameterized (xmlconfig, x, y,...
Definition store_file_utils.c:352
time_t get_planet_time(const char *tile_dir, const char *xmlname)
Retrieve the planet database import timestamp used to determine tile expiry.
Definition store_file_utils.c:43