Change the function name rawtiles to dirtiles

This commit is contained in:
Shan-Chun Kuo
2017-05-24 16:32:44 +01:00
parent 5db7b504e8
commit 9c3fb0f669
5 changed files with 6 additions and 6 deletions
+20
View File
@@ -0,0 +1,20 @@
#include <iostream>
#include <fstream>
#include <string>
#include <sys/stat.h>
#include "dirtiles.hpp"
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf) {
mkdir(outdir, S_IRWXU | S_IRWXG | S_IRWXO);
std::string curdir(outdir);
std::string slash("/");
std::string newdir = curdir + slash + std::to_string(z);
mkdir(newdir.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
newdir = newdir + "/" + std::to_string(tx);
mkdir(newdir.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
newdir = newdir + "/" + std::to_string(ty) + ".pbf";
std::ofstream pbfFile(newdir, std::ios::out | std::ios::binary);
pbfFile.write(pbf.data(), pbf.size());
pbfFile.close();
}