From 776da4a1b8ccdc30c0767d5710c7f9a29a3e23bb Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Thu, 10 Oct 2024 13:20:04 -0700 Subject: [PATCH] Revert "Add a flag to retain multiplier features by minimum distance" This reverts commit 01f14a4255742c0716130fd410dffdbb5ddb90ba. --- main.cpp | 4 ---- main.hpp | 1 - serial.hpp | 1 - tile.cpp | 10 +--------- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/main.cpp b/main.cpp index 9acb8727..9a912dbd 100644 --- a/main.cpp +++ b/main.cpp @@ -93,7 +93,6 @@ size_t limit_tile_feature_count_at_maxzoom = 0; unsigned int drop_denser = 0; std::map set_attributes; unsigned long long preserve_point_density_threshold = 0; -unsigned long long preserve_multiplier_density_threshold = 0; long long extend_zooms_max = 0; int retain_points_multiplier = 1; std::vector unidecode_data; @@ -3110,7 +3109,6 @@ int main(int argc, char **argv) { {"cluster-distance", required_argument, 0, 'K'}, {"cluster-maxzoom", required_argument, 0, 'k'}, {"preserve-point-density-threshold", required_argument, 0, '~'}, - {"preserve-multiplier-density-threshold", required_argument, 0, '~'}, {"Dropping or merging a fraction of features to keep under tile size limits", 0, 0, 0}, {"drop-densest-as-needed", no_argument, &additional[A_DROP_DENSEST_AS_NEEDED], 1}, @@ -3322,8 +3320,6 @@ int main(int argc, char **argv) { } } else if (strcmp(opt, "preserve-point-density-threshold") == 0) { preserve_point_density_threshold = atoll_require(optarg, "Preserve point density threshold"); - } else if (strcmp(opt, "preserve-multiplier-density-threshold") == 0) { - preserve_multiplier_density_threshold = atoll_require(optarg, "Preserve multiplier density threshold"); } else if (strcmp(opt, "extend-zooms-if-still-dropping-maximum") == 0) { extend_zooms_max = atoll_require(optarg, "Maximum number by which to extend zooms"); } else if (strcmp(opt, "retain-points-multiplier") == 0) { diff --git a/main.hpp b/main.hpp index cc28df3c..b5844d91 100644 --- a/main.hpp +++ b/main.hpp @@ -65,7 +65,6 @@ extern long long extend_zooms_max; extern int retain_points_multiplier; extern size_t maximum_string_attribute_length; extern std::string accumulate_numeric; -extern unsigned long long preserve_multiplier_density_threshold; struct order_field { std::string name; diff --git a/serial.hpp b/serial.hpp index 61cd5515..91479a4a 100644 --- a/serial.hpp +++ b/serial.hpp @@ -94,7 +94,6 @@ struct serial_feature { #define FEATURE_DROPPED -1 #define FEATURE_KEPT 0 -#define FEATURE_NO_REALLY_KEEP_IT_AROUND INT_MAX // <0: dropped // 0: kept // >0: sequence number of additional feature kept by retain-points-multiplier diff --git a/tile.cpp b/tile.cpp index 0244f120..d31e17d7 100644 --- a/tile.cpp +++ b/tile.cpp @@ -1237,9 +1237,6 @@ static serial_feature next_feature(decompressor *geoms, std::atomic * } else if (z + extra_multiplier_zooms >= feature_minzoom && count->second + 1 < retain_points_multiplier) { count->second++; sf.dropped = count->second; - } else if (preserve_multiplier_density_threshold > 0 && - sf.gap > ((1LL << (32 - z)) / preserve_multiplier_density_threshold) * ((1LL << (32 - z)) / preserve_multiplier_density_threshold)) { - sf.dropped = FEATURE_NO_REALLY_KEEP_IT_AROUND; } else { sf.dropped = FEATURE_DROPPED; } @@ -1901,11 +1898,8 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch } else { can_stop_early = false; - if (sf.dropped != FEATURE_DROPPED && sf.dropped != FEATURE_NO_REALLY_KEEP_IT_AROUND) { + if (sf.dropped != FEATURE_DROPPED) { // Does the current multiplier cluster already have too many features? - // (Because we are dropping dynamically, and we have already filled the - // cluster with features that were dynamically dropped from being - // primary features) // If so, we have to drop this one, even if it would potentially qualify // as a secondary feature to be exposed by filtering if (layer.multiplier_cluster_size >= (size_t) retain_points_multiplier) { @@ -2152,8 +2146,6 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch if (sf.dropped == FEATURE_KEPT) { layer.multiplier_cluster_size = 1; lead_features_count++; - } else if (sf.dropped == FEATURE_NO_REALLY_KEEP_IT_AROUND) { - other_multiplier_cluster_features_count++; } else { layer.multiplier_cluster_size++; other_multiplier_cluster_features_count++;