From 452b3f80a71fb840169b8f6742f39e606b92166d Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Wed, 14 Dec 2022 13:35:43 -0800 Subject: [PATCH] Don't do the drop rate adjustment until the maxzoom is finalized --- main.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index 7f1ad1ca..223e2109 100644 --- a/main.cpp +++ b/main.cpp @@ -2166,12 +2166,6 @@ int read_input(std::vector &sources, char *fname, int maxzoom, int minzo if (!quiet) { fprintf(stderr, "Choosing a drop rate of %f\n", droprate); } - - droprate /= exp(log(drop_rate_multiplier) / maxzoom); - - if (drop_rate_multiplier != 1 && !quiet) { - fprintf(stderr, "Adjusting drop rate to %f with multiplier\n", droprate); - } } } @@ -2210,7 +2204,7 @@ int read_input(std::vector &sources, char *fname, int maxzoom, int minzo // or the United States to z13. if (total_tile_count > 2 * 1024 * 1024) { - printf("Limiting maxzoom to -z%d to keep from generating %lld tiles\n", i - 1, (long long) total_tile_count); + fprintf(stderr, "Limiting maxzoom to -z%d to keep from generating %lld tiles\n", i - 1, (long long) total_tile_count); maxzoom = i - 1; break; } @@ -2230,6 +2224,14 @@ int read_input(std::vector &sources, char *fname, int maxzoom, int minzo maxzoom = minzoom; } + if (drop_rate_multiplier != 1 && maxzoom != 0) { + droprate /= exp(log(drop_rate_multiplier) / maxzoom); + + if (!quiet) { + fprintf(stderr, "Adjusting drop rate to %f with multiplier %f\n", droprate, drop_rate_multiplier); + } + } + fix_dropping = true; if (basezoom == -1) {