mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Merge pull request #622 from mapbox/cluster-maxzoom
Take cluster distance into account when guessing a maxzoom
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.30.5
|
||||||
|
|
||||||
|
* Take cluster distance into account when guessing a maxzoom
|
||||||
|
|
||||||
## 1.30.4
|
## 1.30.4
|
||||||
|
|
||||||
* Features within the z0 tile buffer of the antimeridian (not only
|
* Features within the z0 tile buffer of the antimeridian (not only
|
||||||
|
|||||||
@@ -1985,6 +1985,20 @@ int read_input(std::vector<source> &sources, char *fname, int maxzoom, int minzo
|
|||||||
if (!quiet) {
|
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));
|
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) {
|
if (dist_count != 0) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#ifndef VERSION_HPP
|
#ifndef VERSION_HPP
|
||||||
#define VERSION_HPP
|
#define VERSION_HPP
|
||||||
|
|
||||||
#define VERSION "v1.30.4"
|
#define VERSION "v1.30.5"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user