Make sure the first non-empty-geometry in the layer is marked as primary

This commit is contained in:
Erica Fischer
2024-02-13 12:23:23 -08:00
parent 65a1d0a25f
commit 0e3ac8e08d
+7 -3
View File
@@ -1875,6 +1875,13 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
} else {
kept++;
if (features.size() == 0) {
// first feature of the the tile is always kept.
// it may not have been marked kept in next_feature
// if its geometry was clipped down to nothing
sf.dropped = FEATURE_KEPT;
}
if (sf.dropped == FEATURE_KEPT && retain_points_multiplier > 1) {
sf.full_keys.push_back("tippecanoe:retain_points_multiplier_first");
sf.full_values.emplace_back(mvt_bool, "true");
@@ -1983,9 +1990,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
first_time = false;
// Adjust tile size limit based on the ratio of multiplier cluster features to lead features
if (lead_features_count == 0) { // how can this happen?
lead_features_count = 1;
}
size_t scaled_max_tile_size = max_tile_size * (lead_features_count + other_multiplier_cluster_features_count) / lead_features_count;
// printf("%d/%d/%d: given %zu lead features and %zu cluster features, tile size is %zu\n", z, tx, ty, lead_features_count, other_multiplier_cluster_features_count, scaled_max_tile_size);