mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Fix bad interaction between dynamic dropping and limiting by truncation (#260)
* Fix bad interaction between dynamic dropping and limiting by truncation * Don't enforce the tile size limit here if they said not to
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
# 2.62.0
|
||||||
|
|
||||||
|
* Fix another bad interaction, this time between dropping-as-needed and --limit-tile-feature-count
|
||||||
|
|
||||||
# 2.61.0
|
# 2.61.0
|
||||||
|
|
||||||
* Added --calculate-feature-index option
|
* Added --calculate-feature-index option
|
||||||
|
|||||||
+337
File diff suppressed because one or more lines are too long
@@ -2106,7 +2106,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
adjusted_feature_count = adjusted_feature_count * (skipped + kept) / kept;
|
adjusted_feature_count = adjusted_feature_count * (skipped + kept) / kept;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (too_many_bytes || adjusted_feature_count > adjusted_max_tile_size) {
|
if (too_many_bytes || (adjusted_feature_count > adjusted_max_tile_size && !prevent[P_KILOBYTE_LIMIT])) {
|
||||||
// Even being maximally conservative, each feature is still going to be
|
// Even being maximally conservative, each feature is still going to be
|
||||||
// at least one byte in the output tile, so this can't possibly work.
|
// at least one byte in the output tile, so this can't possibly work.
|
||||||
skipped++;
|
skipped++;
|
||||||
@@ -2490,13 +2490,17 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
|
|
||||||
if (z == maxzoom && limit_tile_feature_count_at_maxzoom != 0) {
|
if (z == maxzoom && limit_tile_feature_count_at_maxzoom != 0) {
|
||||||
if (layer_features.size() > limit_tile_feature_count_at_maxzoom) {
|
if (layer_features.size() > limit_tile_feature_count_at_maxzoom) {
|
||||||
can_stop_early = false;
|
// this is maxzoom; ok to stop early still because they said to limit abruptly
|
||||||
layer_features.resize(limit_tile_feature_count_at_maxzoom);
|
layer_features.resize(limit_tile_feature_count_at_maxzoom);
|
||||||
|
too_many_features = false; // don't try to drop; we have already truncated
|
||||||
|
skipped = 0; // doesn't matter that we skipped features; we have truncated
|
||||||
}
|
}
|
||||||
} else if (limit_tile_feature_count != 0) {
|
} else if (limit_tile_feature_count != 0) {
|
||||||
if (layer_features.size() > limit_tile_feature_count) {
|
if (layer_features.size() > limit_tile_feature_count) {
|
||||||
can_stop_early = false;
|
can_stop_early = false;
|
||||||
layer_features.resize(limit_tile_feature_count);
|
layer_features.resize(limit_tile_feature_count);
|
||||||
|
too_many_features = false; // don't try to drop; we have already truncated
|
||||||
|
skipped = 0; // doesn't matter that we skipped features; we have truncated
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#ifndef VERSION_HPP
|
#ifndef VERSION_HPP
|
||||||
#define VERSION_HPP
|
#define VERSION_HPP
|
||||||
|
|
||||||
#define VERSION "v2.61.0"
|
#define VERSION "v2.62.0"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user