mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Merge pull request #622 from mapbox/cluster-maxzoom
Take cluster distance into account when guessing a maxzoom
This commit is contained in:
commit
bec1f41a4f
@ -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
|
||||
|
14
main.cpp
14
main.cpp
@ -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) {
|
||||
|
1154
tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json
Normal file
1154
tests/ne_110m_populated_places/out/-zg_-K20_-r1_-yNAME.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
#ifndef VERSION_HPP
|
||||
#define VERSION_HPP
|
||||
|
||||
#define VERSION "v1.30.4"
|
||||
#define VERSION "v1.30.5"
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user