From 1eb498604a85e5de4b347d6c9583c66b717709fd Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Fri, 11 Oct 2024 12:42:01 -0700 Subject: [PATCH] Oh, I didn't git add the code changes --- serial.cpp | 1 + tile.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/serial.cpp b/serial.cpp index f814275c..3b356c89 100644 --- a/serial.cpp +++ b/serial.cpp @@ -744,6 +744,7 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std:: additional[A_GENERATE_POLYGON_LABEL_POINTS] || sst->uses_gamma || retain_points_multiplier > 1 || + preserve_multiplier_density_threshold > 0 || cluster_distance != 0) { sf.index = bbox_index; } else { diff --git a/tile.cpp b/tile.cpp index 8ed603be..153c8166 100644 --- a/tile.cpp +++ b/tile.cpp @@ -1055,7 +1055,7 @@ static bool skip_next_feature(decompressor *geoms, std::atomic *geomp struct next_feature_state { unsigned long long previndex = 0; - unsigned long long prev_kept_index = 0; + unsigned long long prev_not_dropped_index = 0; }; // This function is called repeatedly from write_tile() to retrieve the next feature @@ -1243,7 +1243,7 @@ static serial_feature next_feature(decompressor *geoms, std::atomic * count->second++; sf.dropped = count->second; } else if (preserve_multiplier_density_threshold > 0 && - sf.gap > ((1LL << (32 - z)) / preserve_multiplier_density_threshold) * ((1LL << (32 - z)) / preserve_multiplier_density_threshold)) { + sf.index - next_feature_state.prev_not_dropped_index > ((1LL << (32 - z)) / preserve_multiplier_density_threshold) * ((1LL << (32 - z)) / preserve_multiplier_density_threshold)) { sf.dropped = FEATURE_ADDED_FOR_MULTIPLIER_DENSITY; } else { sf.dropped = FEATURE_DROPPED; @@ -1252,6 +1252,10 @@ static serial_feature next_feature(decompressor *geoms, std::atomic * sf.dropped = FEATURE_KEPT; } + if (sf.dropped != FEATURE_DROPPED) { + next_feature_state.prev_not_dropped_index = sf.index; + } + // Remove nulls, now that the expression evaluation filter has run for (ssize_t i = (ssize_t) sf.keys.size() - 1; i >= 0; i--) {