Repository navigation
test(analysis): pin Repair Geometry where rules for inside differ, and cancel Check and Repair Geometry (#2003) - #2291
Conversation
…d cancel Check and Repair Geometry (opengeos#2003) Check Geometry and Repair Geometry join the long tools the cancel tests run, as AGENTS.md asks of a tool whose work grows with its input. Two tests pin today's output where another rule for what is inside would give a different polygon, in both windings: a plus sign, a hole crossing its shell, a part inside another wound either way (one is a hole listed as a part), the same part twice (from another vertex, reversed), a ring traced twice, spikes in and out, and the two overlap examples in the PostGIS manual's ST_MakeValid page. Two valid shapes (a hole wound as its shell, an island in another part's hole) are copied unchanged. No behavior changes.
…d, and the valid ones in every winding
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
|
Claude autofix
|
| } | ||
|
|
||
| /// Every registered long command looks at Cancel in its work, without timing. | ||
| /// A long command stops when it is cancelled while it runs (#1562): every command the app runs |
There was a problem hiding this comment.
The PR description says Check Geometry and Repair Geometry were added to cancel_tools and that both cancel tests run them, but that list isn't in this PR. cancel_tools doesn't exist anywhere in the repo, crates/engine/src/tests/cancellation.rs is not in the changed files, and this PR only changes this doc comment. The tool list in cancellation.rs (around line 222) has no checkGeometry or repairGeometry entry.
Both tools grow with their input and look at Cancel per feature (repair_geometry.rs:104,179, check_geometry.rs:85,139), so AGENTS.md's "a tool whose work grows with its input goes in the lists in long_commands" applies. Adding them to that tools array would be the missing change, along the lines of:
("checkGeometry", json!({"input": "Cities"})),
("repairGeometry", json!({"input": "Countries"})),I haven't run the cancel tests, so I can't say whether these fixtures pass them. Either way the PR description's "cancel tests pass with the two tools added" is not true for this head commit.
Code reviewBugs
Security
Performance
Quality
AGENTS.md
Not verified
Earlier concerns: there are no prior review threads on this PR, so none were left alone. Change sizeCompared with
|
Summary
Groundwork for #2003, tests only. Nothing changes in how Repair Geometry works.
Check Geometry and Repair Geometry are now in
cancel_tools, so both cancel tests run them. Their work grows with the layer, and both look at Cancel per feature.what_is_inside_where_rules_differpins today's output on the shapes where another rule for what's inside (even-odd, say) would give a different polygon. Each runs as written, with every ring reversed (GeoJSON's and Shapefile's windings), and with one ring at a time reversed:Two valid shapes, a hole wound like its shell and an island in another part's hole, are checked to be copied unchanged in every winding.
the_postgis_manual_examples_merge_into_one_polygonruns the two overlap examples from the ST_MakeValid page. Each comes out as one polygon, as the manual shows for itsstructuremethod. The manual gives no areas, so the expected ones are this tool's own output. They're also checked against a bound any union has to meet: at least the largest part, less than all parts added up.If the
ruleparameter from #2003 goes ahead, these tests show that the default rule's output stays the same.Testing
cargo xtask cipasses.cargo test -p rustgis-analysis --test repair_geometry: 20 pass.long_commands_stop_when_cancelled_while_they_run,cancelling_at_each_check_leaves_nothing_behind) pass with the two tools added.UI evidence
No visible UI change.
Related issue
Part of #2003.
Summary by CodeRabbit