diff --git a/CHANGELOG.md b/CHANGELOG.md index 8301f85..34595d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.30.2 + +* Don't guess a higher maxzoom than is allowed for manual selection + ## 1.30.1 * Ensure that per-feature minzoom and maxzoom are integers diff --git a/main.cpp b/main.cpp index 4c55870..5d4d41c 100644 --- a/main.cpp +++ b/main.cpp @@ -1975,8 +1975,11 @@ int read_input(std::vector &sources, char *fname, int maxzoom, int minzo if (maxzoom < 0) { maxzoom = 0; } - if (maxzoom > MAX_ZOOM) { - maxzoom = MAX_ZOOM; + if (maxzoom > 32 - full_detail) { + maxzoom = 32 - full_detail; + } + if (maxzoom > 33 - low_detail) { // that is, maxzoom - 1 > 32 - low_detail + maxzoom = 33 - low_detail; } if (!quiet) { @@ -1991,8 +1994,11 @@ int read_input(std::vector &sources, char *fname, int maxzoom, int minzo if (mz < 0) { mz = 0; } - if (mz > MAX_ZOOM) { - mz = MAX_ZOOM; + if (mz > 32 - full_detail) { + mz = 32 - full_detail; + } + if (mz > 33 - low_detail) { // that is, mz - 1 > 32 - low_detail + mz = 33 - low_detail; } if (mz > maxzoom || count <= 0) { @@ -2993,6 +2999,10 @@ int main(int argc, char **argv) { maxzoom = 32 - full_detail; fprintf(stderr, "Highest supported zoom with detail %d is %d\n", full_detail, maxzoom); } + if (maxzoom > 33 - low_detail) { // that is, maxzoom - 1 > 32 - low_detail + maxzoom = 33 - low_detail; + fprintf(stderr, "Highest supported zoom with low detail %d is %d\n", low_detail, maxzoom); + } } if (maxzoom > MAX_ZOOM) { maxzoom = MAX_ZOOM; diff --git a/version.hpp b/version.hpp index 7cd64a4..138645b 100644 --- a/version.hpp +++ b/version.hpp @@ -1,6 +1,6 @@ #ifndef VERSION_HPP #define VERSION_HPP -#define VERSION "v1.30.1" +#define VERSION "v1.30.2" #endif