Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/752 Add optional --quiet flag to tilemaker #754

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/RUNNING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/options_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace OptionsParser {

OsmOptions osm;
bool showHelp = false;
bool quiet = false;
bool verbose = false;
bool mergeSqlite = false;
OutputMode outputMode = OutputMode::File;
Expand Down
1 change: 1 addition & 0 deletions src/options_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
5 changes: 5 additions & 0 deletions src/tilemaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down