Implement and test retaining multipliers by bit prefix

This commit is contained in:
Erica Fischer
2025-02-11 10:30:22 -08:00
parent 260d404466
commit 285d1931af
5 changed files with 9949 additions and 0 deletions
+1
View File
@@ -55,6 +55,7 @@ extern size_t maximum_string_attribute_length;
extern std::string accumulate_numeric;
extern std::string use_h3_index;
extern unsigned long long preserve_multiplier_density_threshold;
extern std::vector<int> preserve_multiplier_density_bits_by_zoom;
struct order_field {
std::string name;
+4
View File
@@ -58,6 +58,10 @@ struct serial_val {
s = milo::dtoa_milo(val);
}
std::string toString() const {
return s;
}
double to_double() const {
return atof(s.c_str());
}
File diff suppressed because it is too large Load Diff
+5
View File
@@ -1255,6 +1255,11 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
} else if (preserve_multiplier_density_threshold > 0 &&
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 if (preserve_multiplier_density_bits_by_zoom.size() > 0 &&
(size_t) z < preserve_multiplier_density_bits_by_zoom.size() &&
(sf.index >> (64 - preserve_multiplier_density_bits_by_zoom[z])) !=
(next_feature_state.prev_not_dropped_index >> (64 - preserve_multiplier_density_bits_by_zoom[z]))) {
sf.dropped = FEATURE_ADDED_FOR_MULTIPLIER_DENSITY;
} else {
sf.dropped = FEATURE_DROPPED;
}