mirror of
https://github.com/felt/tippecanoe.git
synced 2026-12-05 06:41:41 +01:00
With -pn, let neighbors close over polygons that collapse entirely
A polygon that collapses away entirely is replaced by its outline, but with --no-simplification-of-shared-nodes that outline overlaps the neighboring features along every shared border, and those features already cover the space. So leave the shared borders out of the outline, as the spindle strips already do, and if every border is shared, leave the polygon out entirely instead of falling back to a rectangle. For Dane County Census blocks at -D8 -d8 -pt -pn, this reduces the overlapping pixels in tile 12/1031/1503 from 141 to 11 and in 11/515/751 from 915 to 38, and the number of revived rectangles at z8 from 6307 to 1414, at the cost of a few more one-pixel gaps (7 to 10 and 14 to 23) where a block of less than a pixel is left out and its neighbors' borders don't round to the same line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ
This commit is contained in:
@@ -674,7 +674,9 @@ TEST_CASE("A polygon that collapses entirely can be replaced by its outline", "[
|
||||
to_tile_scale(scaled, z, detail);
|
||||
REQUIRE(clean_or_clip_poly(scaled, 0, 0, false, true).size() == 0);
|
||||
|
||||
drawvec outline = union_polygon_strips(drawvec(), outline_strips(geom, z, detail));
|
||||
bool all_shared;
|
||||
drawvec outline = union_polygon_strips(drawvec(), outline_strips(geom, z, detail, 1, 0, 0, &all_shared));
|
||||
REQUIRE(!all_shared);
|
||||
double area = get_mp_area(outline);
|
||||
|
||||
// About a pixel wide along both arms, rather than a square
|
||||
|
||||
Reference in New Issue
Block a user