mirror of
https://github.com/felt/tippecanoe.git
synced 2026-12-05 06:41:41 +01:00
Only exempt the unshared length of a ring from tiny polygon reduction
Long, narrow rings were exempted from tiny polygon reduction so that spindle preservation could keep them as lines. But with -pn, no strips are added along borders shared with other features, so a narrow block whose length is mostly shared border was exempted, then collapsed completely in cleaning, and was then replaced by revive_polygon()'s placeholder rectangle, which overlaps its neighbors. (In Dane County census blocks at -D8 -d8 -pn, this raised the number of revived polygons at z12 from 57 to 92.) Now only the part of the ring's length that is not made of shared edges counts toward the exemption, so such blocks are combined into tiny polygons as before. The shared edges can be matched exactly here, because tiny polygon reduction happens before simplification. reduce_tiny_poly() takes the length function as a callback because clip.cpp is also linked into tools that don't include polygon.cpp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ
This commit is contained in:
@@ -26,6 +26,10 @@ extern size_t shared_edges_count;
|
||||
// coordinate of the tile origin that the geometry is relative to.
|
||||
drawvec thin_polygon_strips(drawvec const &geom, int z, int detail, double simplification = 1, long long ox = 0, long long oy = 0);
|
||||
|
||||
// The length of the ring from geom[i] to geom[j] (world coordinates relative to
|
||||
// a tile origin at (ox, oy)) that is not made of edges shared with other features
|
||||
double unshared_perimeter(drawvec const &geom, size_t i, size_t j, long long ox, long long oy);
|
||||
|
||||
// Union the strips from thin_polygon_strips() with a cleaned polygon
|
||||
// (both in tile coordinates)
|
||||
drawvec union_polygon_strips(drawvec const &geom, drawvec const &strips);
|
||||
|
||||
Reference in New Issue
Block a user