diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f118ab..c66b1ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.26.7 + +* Add an option to quiet the progress indicator but not warnings + ## 1.26.6 * Be more careful about checking for overflow when parsing numbers diff --git a/README.md b/README.md index fb3ba61..a5498d5 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,8 @@ tippecanoe -z5 -o filtered.mbtiles -j '{ "ne_10m_admin_0_countries": [ "all", [ ### Progress indicator - * `-q` or `--quiet`: Work quietly instead of reporting progress + * `-q` or `--quiet`: Work quietly instead of reporting progress or warning messages + * `-Q` or `--no-progress-indicator`: Don't report progress, but still give warnings * `-v` or `--version`: Report Tippecanoe's version number ### Filters diff --git a/main.cpp b/main.cpp index bdf33da..483b566 100644 --- a/main.cpp +++ b/main.cpp @@ -63,6 +63,7 @@ static int full_detail = -1; static int min_detail = 7; int quiet = 0; +int quiet_progress = 0; int geometry_scale = 0; double simplification = 1; size_t max_tile_size = 500000; @@ -274,7 +275,7 @@ static void merge(struct mergelist *merges, size_t nmerges, unsigned char *map, // Count this as an 75%-accomplishment, since we already 25%-counted it *progress += (ix.end - ix.start) * 3 / 4; - if (!quiet && 100 * *progress / *progress_max != *progress_reported) { + if (!quiet && !quiet_progress && 100 * *progress / *progress_max != *progress_reported) { fprintf(stderr, "Reordering geometry: %lld%% \r", 100 * *progress / *progress_max); *progress_reported = 100 * *progress / *progress_max; } @@ -641,7 +642,7 @@ void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int split // Count this as a 25%-accomplishment, since we will copy again *progress += (ix.end - ix.start) / 4; - if (!quiet && 100 * *progress / *progress_max != *progress_reported) { + if (!quiet && !quiet_progress && 100 * *progress / *progress_max != *progress_reported) { fprintf(stderr, "Reordering geometry: %lld%% \r", 100 * *progress / *progress_max); *progress_reported = 100 * *progress / *progress_max; } @@ -810,7 +811,7 @@ void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int split // Count this as an 75%-accomplishment, since we already 25%-counted it *progress += (ix.end - ix.start) * 3 / 4; - if (!quiet && 100 * *progress / *progress_max != *progress_reported) { + if (!quiet && !quiet_progress && 100 * *progress / *progress_max != *progress_reported) { fprintf(stderr, "Reordering geometry: %lld%% \r", 100 * *progress / *progress_max); *progress_reported = 100 * *progress / *progress_max; } @@ -1713,7 +1714,7 @@ int read_input(std::vector &sources, char *fname, int maxzoom, int minzo long long nprogress = 100 * ip / indices; if (nprogress != progress) { progress = nprogress; - if (!quiet) { + if (!quiet && !quiet_progress) { fprintf(stderr, "Maxzoom: %lld%% \r", progress); } } @@ -1809,7 +1810,7 @@ int read_input(std::vector &sources, char *fname, int maxzoom, int minzo long long nprogress = 100 * ip / indices; if (nprogress != progress) { progress = nprogress; - if (!quiet) { + if (!quiet && !quiet_progress) { fprintf(stderr, "Base zoom/drop rate: %lld%% \r", progress); } } @@ -2256,6 +2257,7 @@ int main(int argc, char **argv) { {"Progress indicator", 0, 0, 0}, {"quiet", no_argument, 0, 'q'}, + {"no-progress-indicator", no_argument, 0, 'Q'}, {"version", no_argument, 0, 'v'}, {"", 0, 0, 0}, @@ -2479,6 +2481,10 @@ int main(int argc, char **argv) { quiet = 1; break; + case 'Q': + quiet_progress = 1; + break; + case 'p': { char *cp; for (cp = optarg; *cp != '\0'; cp++) { diff --git a/main.hpp b/main.hpp index bcad361..d37ad52 100644 --- a/main.hpp +++ b/main.hpp @@ -16,6 +16,7 @@ void checkdisk(struct reader *r, int nreader); extern int geometry_scale; extern int quiet; +extern int quiet_progress; extern size_t CPUS; extern size_t TEMP_FILES; diff --git a/man/tippecanoe.1 b/man/tippecanoe.1 index 7795414..fe14b06 100644 --- a/man/tippecanoe.1 +++ b/man/tippecanoe.1 @@ -321,7 +321,9 @@ If you don't specify, it will use \fB\fC/tmp\fR\&. .SS Progress indicator .RS .IP \(bu 2 -\fB\fC\-q\fR or \fB\fC\-\-quiet\fR: Work quietly instead of reporting progress +\fB\fC\-q\fR or \fB\fC\-\-quiet\fR: Work quietly instead of reporting progress or warning messages +.IP \(bu 2 +\fB\fC\-Q\fR or \fB\fC\-\-no\-progress\-indicator\fR: Don't report progress, but still give warnings .IP \(bu 2 \fB\fC\-v\fR or \fB\fC\-\-version\fR: Report Tippecanoe's version number .RE diff --git a/serial.cpp b/serial.cpp index 1fa1ab1..741927b 100644 --- a/serial.cpp +++ b/serial.cpp @@ -629,7 +629,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) { if (*(sst->progress_seq) % 10000 == 0) { checkdisk(sst->readers, CPUS); - if (!quiet) { + if (!quiet && !quiet_progress) { fprintf(stderr, "Read %.2f million features\r", *sst->progress_seq / 1000000.0); } } diff --git a/tile.cpp b/tile.cpp index ad4779f..0a4aaa3 100644 --- a/tile.cpp +++ b/tile.cpp @@ -1261,7 +1261,7 @@ serial_feature next_feature(FILE *geoms, long long *geompos_in, char *metabase, double progress = floor(((((*geompos_in + *along - alongminus) / (double) todo) + (pass - (2 - passes))) / passes + z) / (maxzoom + 1) * 1000) / 10; if (progress >= *oprogress + 0.1) { - if (!quiet) { + if (!quiet && !quiet_progress) { fprintf(stderr, " %3.1f%% %d/%u/%u \r", progress, z, tx, ty); } *oprogress = progress; @@ -1901,7 +1901,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s double progress = floor(((((*geompos_in + *along - alongminus) / (double) todo) + (pass - (2 - passes))) / passes + z) / (maxzoom + 1) * 1000) / 10; if (progress >= oprogress + 0.1) { - if (!quiet) { + if (!quiet && !quiet_progress) { fprintf(stderr, " %3.1f%% %d/%u/%u \r", progress, z, tx, ty); } oprogress = progress; diff --git a/version.hpp b/version.hpp index 096f6e0..b056422 100644 --- a/version.hpp +++ b/version.hpp @@ -1,6 +1,6 @@ #ifndef VERSION_HPP #define VERSION_HPP -#define VERSION "tippecanoe v1.26.6\n" +#define VERSION "tippecanoe v1.26.7\n" #endif