mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 18:35:41 +02:00
Don't try to stop early in the children if we dropped anything by rate
This commit is contained in:
@@ -1716,6 +1716,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
struct multiplier_state multiplier_state;
|
struct multiplier_state multiplier_state;
|
||||||
size_t multiplier_seq = retain_points_multiplier - 1;
|
size_t multiplier_seq = retain_points_multiplier - 1;
|
||||||
bool drop_rest = false; // are we dropping the remainder of a multiplier cluster whose first point was dropped?
|
bool drop_rest = false; // are we dropping the remainder of a multiplier cluster whose first point was dropped?
|
||||||
|
bool dropping_by_rate = false; // are we dropping anything by rate in this tile, or keeping it only as part of a multiplier?
|
||||||
unsigned long long next_feature_previndex = 0;
|
unsigned long long next_feature_previndex = 0;
|
||||||
|
|
||||||
for (size_t seq = 0;; seq++) {
|
for (size_t seq = 0;; seq++) {
|
||||||
@@ -1762,7 +1763,10 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
// this is a new multiplier cluster, so stop dropping features
|
// this is a new multiplier cluster, so stop dropping features
|
||||||
// that were dropped because the previous lead feature was dropped
|
// that were dropped because the previous lead feature was dropped
|
||||||
drop_rest = false;
|
drop_rest = false;
|
||||||
} else if (sf.dropped != FEATURE_DROPPED) {
|
} else {
|
||||||
|
dropping_by_rate = true;
|
||||||
|
|
||||||
|
if (sf.dropped != FEATURE_DROPPED) {
|
||||||
// Does the current multiplier cluster already have too many features?
|
// Does the current multiplier cluster already have too many features?
|
||||||
// If so, we have to drop this one, even if it would potentially qualify
|
// If so, we have to drop this one, even if it would potentially qualify
|
||||||
// as a secondary feature to be exposed by filtering
|
// as a secondary feature to be exposed by filtering
|
||||||
@@ -1770,6 +1774,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
sf.dropped = FEATURE_DROPPED;
|
sf.dropped = FEATURE_DROPPED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sf.dropped == FEATURE_DROPPED || drop_rest) {
|
if (sf.dropped == FEATURE_DROPPED || drop_rest) {
|
||||||
multiplier_seq = (multiplier_seq + 1) % retain_points_multiplier;
|
multiplier_seq = (multiplier_seq + 1) % retain_points_multiplier;
|
||||||
@@ -2063,11 +2068,17 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
if (within[j]) {
|
if (within[j]) {
|
||||||
long long estimated_complexity_out = geompos[j] - start_geompos[j];
|
long long estimated_complexity_out = geompos[j] - start_geompos[j];
|
||||||
|
|
||||||
|
if (dropping_by_rate) {
|
||||||
|
// large enough to make it not try to stop early
|
||||||
|
estimated_complexity_out = 1LL << 32;
|
||||||
|
}
|
||||||
|
|
||||||
geomfile[j]->serialize_long_long(0, &geompos[j], fname); // EOF
|
geomfile[j]->serialize_long_long(0, &geompos[j], fname); // EOF
|
||||||
geomfile[j]->end(&geompos[j], fname);
|
geomfile[j]->end(&geompos[j], fname);
|
||||||
within[j] = false;
|
within[j] = false;
|
||||||
|
|
||||||
if (additional[A_TRUNCATE_ZOOMS]) {
|
if (additional[A_TRUNCATE_ZOOMS]) {
|
||||||
|
fflush(geomfile[j]->fp);
|
||||||
pwrite(fileno(geomfile[j]->fp), &estimated_complexity_out, sizeof(estimated_complexity_out), start_geompos[j]);
|
pwrite(fileno(geomfile[j]->fp), &estimated_complexity_out, sizeof(estimated_complexity_out), start_geompos[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user