mirror of
https://github.com/felt/tippecanoe.git
synced 2026-12-05 06:41:41 +01:00
With -pn, snap-round each layer's polygons consistently with each other
Wagyu snaps each edge to every "hot pixel" (vertex or rounded intersection) that it passes through. Each polygon was cleaned on its own, with only its own hot pixels, so a border shared by two polygons could be bent through a hot pixel in one of them and not in the other, leaving a shard gap or overlap between them even though --no-simplification-of-shared-nodes had simplified and rounded the border identically in both. (In Dane County tile 11/515/751, rounding moved one of a block's own vertices across its border with a sliver, and cleaning bent the block's copy of the border through a hot pixel that the sliver's copy didn't have.) Wagyu now has hot_pixels(), which returns the hot pixels of the rings added to it, and add_hot_pixels(), which gives execute() more hot pixels to snap to. When extra hot pixels are given, edges are snapped to every hot pixel they touch, including corner touches, so that whether a shared edge is snapped to a hot pixel can't depend on which polygon it is in. With -pn, the simplification worker now runs in two passes. The first simplifies and rounds every feature in the tile. Then the hot pixels of all the polygons in each layer are found together, which also finds crossings between features that no single feature would see. The second pass cleans each polygon with the layer's hot pixels near it as well as its own, so the borders it shares are snapped identically in each polygon. This is snap rounding of the whole layer's arrangement at once, so the result is still free of crossings. For Dane County Census blocks at -D8 -d8 -pt -pn, tiles 12/1031/1503 and 11/515/751 now have no gaps between blocks (from 10 and 23 pixels), and the gaps and overlaps at z9 and z10 go from 55/113 and 155/175 to 13/56 and 23/59 pixels, with no self-intersecting polygons. Natural Earth 10m countries at -z8 -pn take about 7% longer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ
This commit is contained in:
@@ -509,7 +509,7 @@ the same layer, enclose them in an `all` expression so they will all be evaluate
|
||||
* `-ps` or `--no-line-simplification`: Don't simplify lines and polygons
|
||||
* `-pS` or `--simplify-only-low-zooms`: Don't simplify lines and polygons at maxzoom (but do simplify at lower zooms)
|
||||
* `--simplification-at-maximum-zoom=`_scale_: Use the specified _scale_ at maxzoom instead of the standard simplification scale (which still applies at lower zooms)
|
||||
* `-pn` or `--no-simplification-of-shared-nodes`: Don't simplify away nodes at which LineStrings or Polygon rings converge, diverge, or cross. (This will not be effective if you also use `--coalesce`.) In between intersection nodes, LineString segments or polygon edges will be simplified identically in each feature if possible. Use this instead of `--detect-shared-borders`.
|
||||
* `-pn` or `--no-simplification-of-shared-nodes`: Don't simplify away nodes at which LineStrings or Polygon rings converge, diverge, or cross. (This will not be effective if you also use `--coalesce`.) In between intersection nodes, LineString segments or polygon edges will be simplified identically in each feature if possible. Polygons in the same layer are also snap-rounded to tile coordinates consistently with each other, so that the borders they share are snapped identically and do not leave gaps or overlaps between them. Use this instead of `--detect-shared-borders`.
|
||||
* `-pt` or `--no-tiny-polygon-reduction`: Don't combine the area of very small polygons into small squares that represent their combined area.
|
||||
* `-pT` or `--no-tiny-polygon-reduction-at-maximum-zoom`: Combine the area of very small polygons into small squares that represent their combined area only at zoom levels below the maximum.
|
||||
* `--tiny-polygon-size=`_size_: Use the specified _size_ for tiny polygons instead of the default 2. Anything above 6 or so will lead to visible artifacts with the default tile detail.
|
||||
|
||||
Reference in New Issue
Block a user