2017-07-14 23:56:23 +00:00
|
|
|
#include <string>
|
2017-11-30 23:37:46 +00:00
|
|
|
#include <vector>
|
2017-07-14 23:56:23 +00:00
|
|
|
|
|
|
|
#ifndef DIRTILES_HPP
|
|
|
|
#define DIRTILES_HPP
|
|
|
|
|
2017-05-24 15:32:44 +00:00
|
|
|
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf);
|
2017-07-14 23:56:23 +00:00
|
|
|
|
2017-11-30 00:24:48 +00:00
|
|
|
void check_dir(const char *d, bool force, bool forcetable);
|
2017-07-20 21:17:09 +00:00
|
|
|
|
2017-11-30 23:37:46 +00:00
|
|
|
struct zxy {
|
|
|
|
long long z;
|
|
|
|
long long x;
|
|
|
|
long long y;
|
|
|
|
|
|
|
|
zxy(int _z, int _x, int _y)
|
|
|
|
: z(_z), x(_x), y(_y) {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator<(const zxy &other) const {
|
|
|
|
if (z < other.z) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (z == other.z) {
|
|
|
|
if (x < other.x) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (x == other.x) {
|
|
|
|
if (y > other.y) {
|
|
|
|
return true; // reversed for TMS
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string path() {
|
|
|
|
return std::to_string(z) + "/" + std::to_string(x) + "/" + std::to_string(y) + ".pbf";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<zxy> enumerate_dirtiles(const char *fname);
|
2017-11-30 23:49:14 +00:00
|
|
|
sqlite3 *dirmeta2tmp(const char *fname);
|
2017-11-30 23:37:46 +00:00
|
|
|
std::string dir_read_tile(std::string pbfPath, struct zxy tile);
|
|
|
|
|
2017-07-14 23:56:23 +00:00
|
|
|
#endif
|