Add optional --quiet flag to tilemaker (#754)

This commit is contained in:
John Bayly
2024-10-13 21:37:08 +01:00
committed by GitHub
parent a9681849dd
commit 6ecacf4646
4 changed files with 10 additions and 0 deletions
+3
View File
@@ -123,6 +123,9 @@ Don't forget to add `--store /path/to/your/ssd` if you don't have lots of RAM.
Running tilemaker with the `--verbose` argument will output any issues encountered during tile
creation.
Running tilemaker with the `--quiet` argument will suppress anything written to stdout during
tile creation. stderr is unaffected.
You may see geometry errors reported by Boost::Geometry. This typically reflects an error
in the OSM source data (for example, a multipolygon with several inner rings but no outer ring).
Often, if the geometry could not be written to the layer, the error will subsequently show in
+1
View File
@@ -42,6 +42,7 @@ namespace OptionsParser {
OsmOptions osm;
bool showHelp = false;
bool quiet = false;
bool verbose = false;
bool mergeSqlite = false;
OutputMode outputMode = OutputMode::File;
+1
View File
@@ -25,6 +25,7 @@ po::options_description getParser(OptionsParser::Options& options) {
("merge" ,po::bool_switch(&options.mergeSqlite), "merge with existing .mbtiles (overwrites otherwise)")
("config", po::value< string >(&options.jsonFile)->default_value("config.json"), "config JSON file")
("process",po::value< string >(&options.luaFile)->default_value("process.lua"), "tag-processing Lua file")
("quiet", po::bool_switch(&options.quiet), "quiet, suppress standard output")
("verbose",po::bool_switch(&options.verbose), "verbose error output")
("skip-integrity",po::bool_switch(&options.osm.skipIntegrity), "don't enforce way/node integrity")
("log-tile-timings", po::bool_switch(&options.logTileTimings), "log how long each tile takes");
+5
View File
@@ -95,6 +95,11 @@ int main(const int argc, const char* argv[]) {
if (options.showHelp) { OptionsParser::showHelp(); return 0; }
if (options.quiet) {
// Suppress anything written to std out
std::cout.setstate(std::ios_base::failbit);
}
verbose = options.verbose;
vector<string> bboxElements = parseBox(options.bbox);