Limit maxzoom to the max that actually works

This commit is contained in:
Eric Fischer
2016-02-03 17:12:17 -08:00
parent 6239809632
commit bcdb40b41e
2 changed files with 451 additions and 1 deletions
+7 -1
View File
@@ -63,6 +63,8 @@ int mb_geometry[GEOM_TYPES] = {
int CPUS;
int TEMP_FILES;
#define MAX_ZOOM 24
void init_cpus() {
CPUS = sysconf(_SC_NPROCESSORS_ONLN);
if (CPUS < 1) {
@@ -1543,7 +1545,6 @@ int read_json(int argc, char **argv, char *fname, const char *layername, int max
exit(EXIT_FAILURE);
}
#define MAX_ZOOM 30
struct tile {
unsigned x;
unsigned y;
@@ -2240,6 +2241,11 @@ int main(int argc, char **argv) {
}
}
if (maxzoom > MAX_ZOOM) {
maxzoom = MAX_ZOOM;
fprintf(stderr, "Highest supported zoom is %d\n", maxzoom);
}
if (minzoom > maxzoom) {
fprintf(stderr, "minimum zoom -Z cannot be greater than maxzoom -z\n");
exit(EXIT_FAILURE);