mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Reduce tiling memory (#227)
* Trying to reduce memory in tiling * Let the simplification workers go out of scope earlier * Bail out quickly once the maximum feature count is reached * Update changelog and version
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# 2.53.0
|
||||
|
||||
* Stop trying to add features to the tile after the feature limit is reached
|
||||
|
||||
# 2.52.0
|
||||
|
||||
* Fix accidental loss (at all zooms) of features that specify an explicit minzoom
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"maxzoom": "0",
|
||||
"minzoom": "0",
|
||||
"name": "tests/loop/out/-z0_-O200_--cluster-densest-as-needed.json.check.mbtiles",
|
||||
"strategies": "[{\"coalesced_as_needed\":999,\"feature_count_desired\":1000}]",
|
||||
"strategies": "[{\"coalesced_as_needed\":999,\"feature_count_desired\":201}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"maxzoom": "0",
|
||||
"minzoom": "0",
|
||||
"name": "tests/loop/out/-z0_-O200_--drop-densest-as-needed.json.check.mbtiles",
|
||||
"strategies": "[{\"dropped_as_needed\":999,\"feature_count_desired\":1000}]",
|
||||
"strategies": "[{\"dropped_as_needed\":999,\"feature_count_desired\":201}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"maxzoom": "0",
|
||||
"minzoom": "0",
|
||||
"name": "tests/loop/out/-z0_-O200_--drop-fraction-as-needed.json.check.mbtiles",
|
||||
"strategies": "[{\"dropped_as_needed\":999,\"feature_count_desired\":1000}]",
|
||||
"strategies": "[{\"dropped_as_needed\":999,\"feature_count_desired\":201}]",
|
||||
"type": "overlay",
|
||||
"version": "2"
|
||||
}, "features": [
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1875,7 +1875,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
unsigned long long sfindex = sf.index;
|
||||
|
||||
if (sf.geometry.size() > 0) {
|
||||
if (lead_features_count > max_tile_size) {
|
||||
if (lead_features_count > max_tile_size || (lead_features_count + other_multiplier_cluster_features_count > max_tile_features && !prevent[P_FEATURE_LIMIT])) {
|
||||
// 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.
|
||||
skipped++;
|
||||
@@ -2110,6 +2110,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
tasks = 1;
|
||||
}
|
||||
|
||||
{
|
||||
pthread_t pthreads[tasks];
|
||||
std::vector<simplification_worker_arg> args;
|
||||
args.resize(tasks);
|
||||
@@ -2140,6 +2141,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < features.size(); i++) {
|
||||
signed char t = features[i].t;
|
||||
@@ -2261,6 +2263,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
}
|
||||
|
||||
if (layer_features[x].geometry.size() == 0) {
|
||||
layer_features[x] = serial_feature();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2301,6 +2304,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
||||
}
|
||||
|
||||
layer.features.push_back(std::move(feature));
|
||||
layer_features[x] = serial_feature();
|
||||
}
|
||||
|
||||
if (layer.features.size() > 0) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#ifndef VERSION_HPP
|
||||
#define VERSION_HPP
|
||||
|
||||
#define VERSION "v2.52.0"
|
||||
#define VERSION "v2.53.0"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user