Improve quality of coalescing-as-needed; add options to limit feature count (#25)

* Add an option to limit geometry vertex count

* Update docs and changelog

* Track desired feature count and geometry size in strategies

* Remove dead code for a long-forgotten inaccessible option

* Fix the option name in changelog

* Refine coalesce-smallest to only coalesce onto other small features

* Clean polygons before coalescing-as-needed

* Don't accumulate tiny polygon holes as negative dust

* Add the option not to limit the feature count at maxzoom

* Add options to limit feature count more abruptly in each tile

* Revert "Add the option not to limit the feature count at maxzoom"

This reverts commit ace173ab7a.

* Revert "Fix the option name in changelog"

This reverts commit 38dbce8405.

* Revert "Add an option to limit geometry vertex count"

This reverts commit d379fdf06b.

* Remove test for reverted option

* Remove more leftovers from geometry size limiting

* Update changelog
This commit is contained in:
Erica Fischer
2022-11-17 13:09:10 -08:00
committed by GitHub
parent 7733cced43
commit 8eec2be462
30 changed files with 1773 additions and 636 deletions
+8
View File
@@ -83,6 +83,8 @@ int cluster_distance = 0;
int tiny_polygon_size = 2;
long justx = -1, justy = -1;
std::string attribute_for_id = "";
size_t limit_tile_feature_count = 0;
size_t limit_tile_feature_count_at_maxzoom = 0;
unsigned int drop_denser = 0;
std::vector<order_field> order_by;
@@ -2851,6 +2853,8 @@ int main(int argc, char **argv) {
{"Setting or disabling tile size limits", 0, 0, 0},
{"maximum-tile-bytes", required_argument, 0, 'M'},
{"maximum-tile-features", required_argument, 0, 'O'},
{"limit-tile-feature-count", required_argument, 0, '~'},
{"limit-tile-feature-count-at-maximum-zoom", required_argument, 0, '~'},
{"no-feature-limit", no_argument, &prevent[P_FEATURE_LIMIT], 1},
{"no-tile-size-limit", no_argument, &prevent[P_KILOBYTE_LIMIT], 1},
{"no-tile-compression", no_argument, &prevent[P_TILE_COMPRESSION], 1},
@@ -2981,6 +2985,10 @@ int main(int argc, char **argv) {
exit(EXIT_ARGS);
}
break;
} else if (strcmp(opt, "limit-tile-feature-count") == 0) {
limit_tile_feature_count = atoll_require(optarg, "Limit tile feature count");
} else if (strcmp(opt, "limit-tile-feature-count-at-maximum-zoom") == 0) {
limit_tile_feature_count_at_maxzoom = atoll_require(optarg, "Limit tile feature count at maxzoom");
} else if (strcmp(opt, "drop-denser") == 0) {
drop_denser = atoi_require(optarg, "Drop denser rate");
if (drop_denser > 100) {