mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-04 01:15:41 +02:00
Calculate point dropping during encoding instead of tiling
so it is consistent across tile boundaries, and so every point that exists at zoom x always also exists at zoom x+1.
This commit is contained in:
@@ -354,24 +354,21 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns
|
||||
pool_init(&values, 0);
|
||||
std::set<long long> dup;
|
||||
|
||||
double interval = 1;
|
||||
double seq = 0;
|
||||
long long count = 0;
|
||||
//long long along = 0;
|
||||
double accum_area = 0;
|
||||
|
||||
if (z < basezoom) {
|
||||
interval = exp(log(droprate) * (basezoom - z));
|
||||
}
|
||||
|
||||
std::vector<coalesce> features;
|
||||
|
||||
struct index *i;
|
||||
for (i = start; i < end; i++) {
|
||||
int t = i->type;
|
||||
|
||||
if (z > i->maxzoom) {
|
||||
continue;
|
||||
}
|
||||
if (z + line_detail <= i->minzoom) {
|
||||
if ((t == VT_LINE && z + line_detail <= i->minzoom) ||
|
||||
(t == VT_POINT && z < i->minzoom)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -382,17 +379,6 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns
|
||||
dup.insert(i->fpos);
|
||||
}
|
||||
|
||||
int t = i->type;
|
||||
if (t == VT_POINT) {
|
||||
seq++;
|
||||
|
||||
if (seq >= 0) {
|
||||
seq -= interval;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
char *meta = metabase + i->fpos;
|
||||
drawvec geom = decode_geometry(&meta, z, tx, ty, line_detail);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user