mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Revert "Revert "Limit feature expansion from multiplier density to 2x""
This reverts commit 44a683d808.
This commit is contained in:
+2
-1
@@ -94,10 +94,11 @@ struct serial_feature {
|
|||||||
|
|
||||||
#define FEATURE_DROPPED -1
|
#define FEATURE_DROPPED -1
|
||||||
#define FEATURE_KEPT 0
|
#define FEATURE_KEPT 0
|
||||||
#define FEATURE_NO_REALLY_KEEP_IT_AROUND INT_MAX
|
#define FEATURE_ADDED_FOR_MULTIPLIER_DENSITY INT_MAX
|
||||||
// <0: dropped
|
// <0: dropped
|
||||||
// 0: kept
|
// 0: kept
|
||||||
// >0: sequence number of additional feature kept by retain-points-multiplier
|
// >0: sequence number of additional feature kept by retain-points-multiplier
|
||||||
|
// INT_MAX: additional feature kept by preserve-multiplier-density-threshold
|
||||||
int dropped = FEATURE_DROPPED; // was this feature dropped by rate?
|
int dropped = FEATURE_DROPPED; // was this feature dropped by rate?
|
||||||
|
|
||||||
// unsigned long long drop_by; // dot-dropping priority
|
// unsigned long long drop_by; // dot-dropping priority
|
||||||
|
|||||||
@@ -1237,9 +1237,10 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
|
|||||||
} else if (z + extra_multiplier_zooms >= feature_minzoom && count->second + 1 < retain_points_multiplier) {
|
} else if (z + extra_multiplier_zooms >= feature_minzoom && count->second + 1 < retain_points_multiplier) {
|
||||||
count->second++;
|
count->second++;
|
||||||
sf.dropped = count->second;
|
sf.dropped = count->second;
|
||||||
} else if (preserve_multiplier_density_threshold > 0 &&
|
} else if (preserve_multiplier_density_threshold > 0 && count->second + 1 < 2 * retain_points_multiplier &&
|
||||||
sf.gap > ((1LL << (32 - z)) / preserve_multiplier_density_threshold) * ((1LL << (32 - z)) / preserve_multiplier_density_threshold)) {
|
sf.gap > ((1LL << (32 - z)) / preserve_multiplier_density_threshold) * ((1LL << (32 - z)) / preserve_multiplier_density_threshold)) {
|
||||||
sf.dropped = FEATURE_NO_REALLY_KEEP_IT_AROUND;
|
count->second++;
|
||||||
|
sf.dropped = FEATURE_ADDED_FOR_MULTIPLIER_DENSITY;
|
||||||
} else {
|
} else {
|
||||||
sf.dropped = FEATURE_DROPPED;
|
sf.dropped = FEATURE_DROPPED;
|
||||||
}
|
}
|
||||||
@@ -1893,7 +1894,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
} else {
|
} else {
|
||||||
can_stop_early = false;
|
can_stop_early = false;
|
||||||
|
|
||||||
if (sf.dropped != FEATURE_DROPPED && sf.dropped != FEATURE_NO_REALLY_KEEP_IT_AROUND) {
|
if (sf.dropped != FEATURE_DROPPED && sf.dropped != FEATURE_ADDED_FOR_MULTIPLIER_DENSITY) {
|
||||||
// Does the current multiplier cluster already have too many features?
|
// Does the current multiplier cluster already have too many features?
|
||||||
// (Because we are dropping dynamically, and we have already filled the
|
// (Because we are dropping dynamically, and we have already filled the
|
||||||
// cluster with features that were dynamically dropped from being
|
// cluster with features that were dynamically dropped from being
|
||||||
@@ -2140,7 +2141,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
if (sf.dropped == FEATURE_KEPT) {
|
if (sf.dropped == FEATURE_KEPT) {
|
||||||
layer.multiplier_cluster_size = 1;
|
layer.multiplier_cluster_size = 1;
|
||||||
lead_features_count++;
|
lead_features_count++;
|
||||||
} else if (sf.dropped == FEATURE_NO_REALLY_KEEP_IT_AROUND) {
|
} else if (sf.dropped == FEATURE_ADDED_FOR_MULTIPLIER_DENSITY) {
|
||||||
other_multiplier_cluster_features_count++;
|
other_multiplier_cluster_features_count++;
|
||||||
} else {
|
} else {
|
||||||
layer.multiplier_cluster_size++;
|
layer.multiplier_cluster_size++;
|
||||||
|
|||||||
Reference in New Issue
Block a user