Don't swap attributes when reducing tiny polygon dust (#207)

* Don't swap attributes when reducing tiny polygon dust

Because the dust placeholder may be misleadingly far from the feature
that contributed the most area to it

* Remove unused arguments; update changelog
This commit is contained in:
Erica Fischer
2024-02-26 15:41:26 -08:00
committed by GitHub
parent 2b6630c42c
commit a987197eed
7 changed files with 35 additions and 59 deletions
+1 -3
View File
@@ -1591,8 +1591,6 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
FILE *prefilter_read_fp = NULL;
json_pull *prefilter_jp = NULL;
serial_feature tiny_feature; // used to track which feature currently represents the dust
if (z < minzoom) {
prefilter = NULL;
postfilter = NULL;
@@ -1852,7 +1850,7 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
bool prevent_tiny = prevent[P_TINY_POLYGON_REDUCTION] ||
(prevent[P_TINY_POLYGON_REDUCTION_AT_MAXZOOM] && z == maxzoom);
if (!prevent_tiny && !additional[A_GRID_LOW_ZOOMS]) {
sf.geometry = reduce_tiny_poly(sf.geometry, z, line_detail, &still_need_simplification_after_reduction, &simplified_away_by_reduction, &accum_area, &sf, &tiny_feature);
sf.geometry = reduce_tiny_poly(sf.geometry, z, line_detail, &still_need_simplification_after_reduction, &simplified_away_by_reduction, &accum_area);
if (simplified_away_by_reduction) {
strategy->tiny_polygons++;
}