Do make indent, add flag --output-to-directory or -e to write pbf files to a directory, also add flag --no-tile-compression or -pC to get raw protobuf

This commit is contained in:
Shan-Chun Kuo
2017-04-07 13:33:01 +01:00
parent 9fb1208b79
commit a320248857
6 changed files with 26 additions and 21 deletions
+3 -3
View File
@@ -7,14 +7,14 @@
void write_raw_tile(char *outdir, int z, int tx, int ty, std::string pbf) {
mkdir(outdir, S_IRWXU | S_IRWXG | S_IRWXO);
std::string curdir(outdir);
std::string slash( "/" );
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());
std::ofstream pbfFile(newdir, std::ios::out | std::ios::binary);
pbfFile.write(pbf.data(), pbf.size());
pbfFile.close();
}