mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 02:15:41 +02:00
Dropping a feature into a multiplier cluster still effectively drops it
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
"maxzoom": "10",
|
"maxzoom": "10",
|
||||||
"minzoom": "0",
|
"minzoom": "0",
|
||||||
"name": "tests/muni/out/-z10_--retain-points-multiplier_10_-M10000_--drop-smallest-as-needed.json.check.mbtiles",
|
"name": "tests/muni/out/-z10_--retain-points-multiplier_10_-M10000_--drop-smallest-as-needed.json.check.mbtiles",
|
||||||
"strategies": "[{\"dropped_by_rate\":4591},{\"dropped_by_rate\":4591},{\"dropped_by_rate\":4561},{\"dropped_by_rate\":4511},{\"dropped_by_rate\":4401},{\"dropped_by_rate\":4121},{\"dropped_by_rate\":3411},{\"dropped_by_rate\":1650},{\"dropped_by_rate\":1066,\"dropped_as_needed\":107,\"tile_size_desired\":68538},{\"dropped_by_rate\":1058,\"dropped_as_needed\":696,\"tile_size_desired\":72665},{\"dropped_as_needed\":1976,\"tile_size_desired\":67958}]",
|
"strategies": "[{\"dropped_by_rate\":4591},{\"dropped_by_rate\":4591},{\"dropped_by_rate\":4561},{\"dropped_by_rate\":4511},{\"dropped_by_rate\":4401},{\"dropped_by_rate\":4121},{\"dropped_by_rate\":3411},{\"dropped_by_rate\":1650},{\"dropped_by_rate\":1066,\"dropped_as_needed\":311,\"tile_size_desired\":68538},{\"dropped_by_rate\":1058,\"dropped_as_needed\":1579,\"tile_size_desired\":72665},{\"dropped_as_needed\":4452,\"tile_size_desired\":67958}]",
|
||||||
"tippecanoe_decisions": "{\"basezoom\":10,\"droprate\":2.5,\"retain_points_multiplier\":10}",
|
"tippecanoe_decisions": "{\"basezoom\":10,\"droprate\":2.5,\"retain_points_multiplier\":10}",
|
||||||
"type": "overlay",
|
"type": "overlay",
|
||||||
"version": "2"
|
"version": "2"
|
||||||
|
|||||||
@@ -1525,6 +1525,7 @@ bool drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer_features
|
|||||||
ssize_t which_serial_feature;
|
ssize_t which_serial_feature;
|
||||||
|
|
||||||
if (find_feature_to_accumulate_onto(layer.features, sf, which_serial_feature, layer_unmaps, LLONG_MAX, multiplier_seq)) {
|
if (find_feature_to_accumulate_onto(layer.features, sf, which_serial_feature, layer_unmaps, LLONG_MAX, multiplier_seq)) {
|
||||||
|
strategy.dropped_as_needed++;
|
||||||
if (layer.multiplier_cluster_size < (size_t) retain_points_multiplier) {
|
if (layer.multiplier_cluster_size < (size_t) retain_points_multiplier) {
|
||||||
// we have capacity to keep this feature as part of an existing multiplier cluster that isn't full yet
|
// we have capacity to keep this feature as part of an existing multiplier cluster that isn't full yet
|
||||||
// so do that instead of dropping it
|
// so do that instead of dropping it
|
||||||
@@ -1532,7 +1533,6 @@ bool drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer_features
|
|||||||
return false; // converted rather than dropped
|
return false; // converted rather than dropped
|
||||||
} else {
|
} else {
|
||||||
preserve_attributes(attribute_accum, sf, layer.features[which_serial_feature]);
|
preserve_attributes(attribute_accum, sf, layer.features[which_serial_feature]);
|
||||||
strategy.dropped_as_needed++;
|
|
||||||
drop_rest = true;
|
drop_rest = true;
|
||||||
return true; // dropped
|
return true; // dropped
|
||||||
}
|
}
|
||||||
@@ -1589,7 +1589,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
// empirical estimate from ne_10m_admin_0_countries, CPAD units, Cal fires.
|
// empirical estimate from ne_10m_admin_0_countries, CPAD units, Cal fires.
|
||||||
// only try to make an overzoomable final tile if it seems like it might work
|
// only try to make an overzoomable final tile if it seems like it might work
|
||||||
long long estimated_output_tile_size = 0.6693 * estimated_complexity - 3.36e+04;
|
long long estimated_output_tile_size = 0.6693 * estimated_complexity - 3.36e+04;
|
||||||
|
|
||||||
if (estimated_output_tile_size < (long long) (0.9 * max_tile_size)) {
|
if (estimated_output_tile_size < (long long) (0.9 * max_tile_size)) {
|
||||||
first_detail = 30 - z;
|
first_detail = 30 - z;
|
||||||
second_detail = detail;
|
second_detail = detail;
|
||||||
@@ -1870,8 +1869,8 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
} else if (additional[A_DROP_DENSEST_AS_NEEDED]) {
|
} else if (additional[A_DROP_DENSEST_AS_NEEDED]) {
|
||||||
add_sample_to(gaps, sf.gap, gaps_increment, seq);
|
add_sample_to(gaps, sf.gap, gaps_increment, seq);
|
||||||
if (sf.gap < mingap) {
|
if (sf.gap < mingap) {
|
||||||
|
can_stop_early = false;
|
||||||
if (drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer, sf, layer_unmaps, multiplier_seq, strategy, drop_rest, arg->attribute_accum)) {
|
if (drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer, sf, layer_unmaps, multiplier_seq, strategy, drop_rest, arg->attribute_accum)) {
|
||||||
can_stop_early = false;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1915,8 +1914,8 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
// search here is for LLONG_MAX, not minextent, because we are dropping features, not coalescing them,
|
// search here is for LLONG_MAX, not minextent, because we are dropping features, not coalescing them,
|
||||||
// so we shouldn't expect to find anything small that we can related this feature to.
|
// so we shouldn't expect to find anything small that we can related this feature to.
|
||||||
if (minextent != 0 && sf.extent + coalesced_area <= minextent) {
|
if (minextent != 0 && sf.extent + coalesced_area <= minextent) {
|
||||||
|
can_stop_early = false;
|
||||||
if (drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer, sf, layer_unmaps, multiplier_seq, strategy, drop_rest, arg->attribute_accum)) {
|
if (drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer, sf, layer_unmaps, multiplier_seq, strategy, drop_rest, arg->attribute_accum)) {
|
||||||
can_stop_early = false;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1934,11 +1933,9 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
}
|
}
|
||||||
} else if (additional[A_DROP_FRACTION_AS_NEEDED] || prevent[P_DYNAMIC_DROP]) {
|
} else if (additional[A_DROP_FRACTION_AS_NEEDED] || prevent[P_DYNAMIC_DROP]) {
|
||||||
add_sample_to(drop_sequences, drop_sequence, drop_sequences_increment, seq);
|
add_sample_to(drop_sequences, drop_sequence, drop_sequences_increment, seq);
|
||||||
// search here is for LLONG_MAX, not minextent, because we are dropping features, not coalescing them,
|
|
||||||
// so we shouldn't expect to find anything small that we can related this feature to.
|
|
||||||
if (mindrop_sequence != 0 && drop_sequence <= mindrop_sequence) {
|
if (mindrop_sequence != 0 && drop_sequence <= mindrop_sequence) {
|
||||||
|
can_stop_early = false;
|
||||||
if (drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer, sf, layer_unmaps, multiplier_seq, strategy, drop_rest, arg->attribute_accum)) {
|
if (drop_feature_unless_it_can_be_added_to_a_multiplier_cluster(layer, sf, layer_unmaps, multiplier_seq, strategy, drop_rest, arg->attribute_accum)) {
|
||||||
can_stop_early = false;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user