Merge pull request #622 from mapbox/cluster-maxzoom

Take cluster distance into account when guessing a maxzoom
This commit is contained in:
Eric Fischer 2018-08-01 13:54:47 -07:00 committed by GitHub
commit bec1f41a4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1173 additions and 1 deletions

View File

@ -1,3 +1,7 @@
## 1.30.5
* Take cluster distance into account when guessing a maxzoom
## 1.30.4
* Features within the z0 tile buffer of the antimeridian (not only

View File

@ -1985,6 +1985,20 @@ int read_input(std::vector<source> &sources, char *fname, int maxzoom, int minzo
if (!quiet) {
fprintf(stderr, "Choosing a maxzoom of -z%d for features about %d feet (%d meters) apart\n", maxzoom, (int) ceil(dist_ft), (int) ceil(dist_ft / 3.28084));
}
bool changed = false;
while (maxzoom < 32 - full_detail && maxzoom < 33 - low_detail && cluster_distance > 0) {
unsigned long long zoom_mingap = ((1LL << (32 - maxzoom)) / 256 * cluster_distance) * ((1LL << (32 - maxzoom)) / 256 * cluster_distance);
if (avg > zoom_mingap) {
break;
}
maxzoom++;
changed = true;
}
if (changed) {
printf("Choosing a maxzoom of -z%d to keep most features distinct with cluster distance %d\n", maxzoom, cluster_distance);
}
}
if (dist_count != 0) {

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#define VERSION "v1.30.4"
#define VERSION "v1.30.5"
#endif