mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 09:55:41 +02:00
Implement and test retaining multipliers by bit prefix
This commit is contained in:
@@ -55,6 +55,7 @@ extern size_t maximum_string_attribute_length;
|
|||||||
extern std::string accumulate_numeric;
|
extern std::string accumulate_numeric;
|
||||||
extern std::string use_h3_index;
|
extern std::string use_h3_index;
|
||||||
extern unsigned long long preserve_multiplier_density_threshold;
|
extern unsigned long long preserve_multiplier_density_threshold;
|
||||||
|
extern std::vector<int> preserve_multiplier_density_bits_by_zoom;
|
||||||
|
|
||||||
struct order_field {
|
struct order_field {
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ struct serial_val {
|
|||||||
s = milo::dtoa_milo(val);
|
s = milo::dtoa_milo(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string toString() const {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
double to_double() const {
|
double to_double() const {
|
||||||
return atof(s.c_str());
|
return atof(s.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+8320
File diff suppressed because one or more lines are too long
@@ -1255,6 +1255,11 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
|
|||||||
} else if (preserve_multiplier_density_threshold > 0 &&
|
} 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.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;
|
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 {
|
} else {
|
||||||
sf.dropped = FEATURE_DROPPED;
|
sf.dropped = FEATURE_DROPPED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user