Repository navigation
fix(analysis): warn about Clip boundary slivers (#1998) - #2118
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| index, where a tiny sliver can make an apparently empty page. Ordinary clipped pieces give no | ||
| sliver notice, and empty intersections are still left out. |
There was a problem hiding this comment.
Doc overclaim (Quality, confidence high). "Ordinary clipped pieces give no sliver notice" is not true as a general statement. The check is a ratio against the input feature's area, so a small real piece below 1e-6 of a very large input is counted too. The notice text hedges with "may be", but this sentence does not. Suggested wording:
| index, where a tiny sliver can make an apparently empty page. Ordinary clipped pieces give no | |
| sliver notice, and empty intersections are still left out. | |
| index, where a tiny sliver can make an apparently empty page. A small real piece below that | |
| ratio is counted too; empty intersections are still left out. |
There was a problem hiding this comment.
Fair: a small real piece of a very large input can fall under the ratio too, so the sentence should say a notice is possible there. That's wording, left for the release quality pass.
| } | ||
| r.messages.extend(left.notes("Clip", &clip_ds.name)); | ||
| if slivers > 0 { | ||
| r.messages.push(format!("Clip: {slivers} output feature(s) have less than one millionth of their input feature's area; they may be slivers along the clip boundary (kept unchanged)")); |
There was a problem hiding this comment.
Quality, confidence medium (not a blocker). The ratio is taken in the analysis plane (Web Mercator within ±85.05°), so "area" in this message means plane area, not ground area. Mercator's scale grows as 1/cos²(lat), so for a feature spanning many degrees of latitude the ratio can be off by a large factor. The user guide says "overlay plane"; the notice does not. Also, 1e-6 appears here, in clip_part, and in the docs. A named constant would keep the three in step.
There was a problem hiding this comment.
Right, it's a ratio of plane areas, and a ratio within one feature barely moves with Mercator's scale at county size. Saying "area in the overlay plane" in the message is wording, left for the release quality pass.
Code reviewBugs: None found. Security: None. No new input parsing or parameters. (confidence: high) Performance: Two extra O(n) area passes per feature, which are negligible next to the overlay. The sliver count is summed on the calling thread after each batch, so Cancel behaviour is unchanged. (confidence: high) Quality:
AGENTS.md:
Nothing here blocks merging. The two inline comments cover the substantive points. The notice-catalogue gap and the constant are nits for the release quality pass. Earlier review concerns already raised: 0 (there were no prior threads). Change sizeCompared: the whole PR against main (merge base 4585899 to PR head ecd8a44).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Clip can keep tiny positive-area polygons where an input feature meets the clip boundary. Used as a map series index, these can produce apparently empty pages. Clip now gives one notice counting output polygon features with less than
1e-6of their source feature's total polygon area, saying they may be slivers along the clip boundary. Every output feature and coordinate is kept as before; no parameter is added. The user guide explains the notice and the map series consequence.The ratio is dimensionless and measured in the existing overlay plane. The trial's three slivers have approximate area ratios from
1.3e-12to3.9e-10, while the smallest of the 14 real pieces is0.0375. The1e-6threshold is more than 2,500 times above the largest artifact ratio and 37,000 times below the smallest real piece. It catches all three artifacts without flagging any real trial piece, with ample separation on both sides.Each worker measures its already-projected input and intersection once per kept polygon feature, without extra projection, geometry copies, or contact predicates. The existing Cancel checks remain in place. Other overlay tools are unchanged.
Testing
partpath bit for bit. An ordinary partial clip gives no sliver notice.cargo fmt --all: passed.cargo test -p rustgis-analysis: 613 tests passed.RUSTFLAGS="-D warnings" cargo check -p rustgis-analysis --target wasm32-unknown-unknown: passed.cargo xtask cion the fork's CI: passed, including workspace Clippy and tests, layers, schema-feature Clippy, and schema/fixture consistency.UI evidence
No visible UI layout or rendering change. The new text uses the existing tool-result notice path; the trial output above is the behavior evidence.
Related issue
Part of #1998: Clip boundary sliver notice only.
Summary by CodeRabbit