Skip to content

Commit

Permalink
Oh, I didn't git add the code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Oct 11, 2024
1 parent fa88470 commit 1eb4986
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 6 additions & 2 deletions tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ static bool skip_next_feature(decompressor *geoms, std::atomic<long long> *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
Expand Down Expand Up @@ -1243,7 +1243,7 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
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;
Expand All @@ -1252,6 +1252,10 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
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--) {
Expand Down

0 comments on commit 1eb4986

Please sign in to comment.