From e5f2a5d1d3a281e282ca95cf1fd09ecef1fd646b Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Mon, 28 Aug 2023 13:53:37 -0700 Subject: [PATCH] Dropping a 0-length feature doesn't count as dropping-as-needed --- tile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tile.cpp b/tile.cpp index 7c2dad24..dda92506 100644 --- a/tile.cpp +++ b/tile.cpp @@ -2138,14 +2138,14 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch add_sample_to(extents, sf.extent, extents_increment, seq); // search here is for LLONG_MAX, not minextent, because we are dropping features, not coalescing them, // so we shouldn't expect to find anything small that we can related this feature to. - if (sf.extent + coalesced_area <= minextent && find_partial(partials, sf, which_partial, layer_unmaps, LLONG_MAX)) { + if (minextent != 0 && sf.extent + coalesced_area <= minextent && find_partial(partials, sf, which_partial, layer_unmaps, LLONG_MAX)) { preserve_attributes(arg->attribute_accum, sf, stringpool, pool_off, partials[which_partial]); strategy->dropped_as_needed++; continue; } } else if (additional[A_COALESCE_SMALLEST_AS_NEEDED]) { add_sample_to(extents, sf.extent, extents_increment, seq); - if (sf.extent + coalesced_area <= minextent && find_partial(partials, sf, which_partial, layer_unmaps, minextent)) { + if (minextent != 0 && sf.extent + coalesced_area <= minextent && find_partial(partials, sf, which_partial, layer_unmaps, minextent)) { partials[which_partial].geoms.push_back(sf.geometry); partials[which_partial].coalesced = true; coalesced_area += sf.extent;