Repository navigation
feat(analysis): optionally keep zones with no class overlap (#1998) - #2362
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| fn command_uses_tabulate_empty_zones(id: &str, params: &Value) -> bool { | ||
| tabulate_uses(id, params, |p| match p.get("includeEmptyZones") { | ||
| Some(Value::Bool(on)) => *on, | ||
| Some(Value::String(on)) => on.trim().eq_ignore_ascii_case("true"), |
There was a problem hiding this comment.
Maintainability risk (not a bug today): this re-implements the tool's boolean rule. boolean() in crates/analysis/src/lib.rs (~line 521) is the source of truth for which text means true: it currently accepts trimmed, case-insensitive "true"/"false". If that parser ever accepts more text ("yes", "1"), this check quietly stops requiring tabulate-intersection-empty-zones, and an older reader would then drop the zero rows without refusing the file, which the "Never silent" rule forbids. Suggest exporting one helper from analysis (e.g. analysis::parses_true(&Value) -> Option<bool>) and using it in both places, plus a test that the capability and the tool agree on the same text inputs. Confidence: medium; this is a drift risk, not a current defect.
There was a problem hiding this comment.
Agreed it duplicates the rule; it matches boolean() today, so sharing the helper is left for the release quality pass.
Code reviewI found no bugs or crash paths in this PR. The change is well tested and follows the repository rules I checked. One maintainability point is posted inline on Bugs: none found.
Security: none found. The change adds no input-handling surface beyond a boolean parameter. Performance: nothing material. Script capability checks now scan the script text twice for Quality (grouped nits, optional for the release quality pass):
AGENTS.md: the PR follows the rules I checked.
Already raised earlier: 0. Change sizeCompared with the base branch: the whole PR against main (merge base c7e0575 to PR head 66567c4).
|
📖 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
Tabulate Intersection omitted 164 of 3,030 traffic zones in the Twin Cities trial because they overlapped no class polygon. Include Empty Zones (
includeEmptyZones: true) keeps one row per unmatched polygon zone, in the usual zone order. The row has blank class fields and zero area, percentage and sums. An empty class layer produces a zero row for every polygon zone. The option defaults to off, preserving the omission notice and the behavior of existing calls and saved models.The shared tool spec supplies the checkbox and help in the Tools pane and the parameter description for the Assistant and MCP. The same tool runs on desktop, web and touch and via
gp.runfrom the CLI, Python, scripts and models. Ribbon and command search open the same Tools pane. The option uses the existing command and plugin interfaces. The operation creates the usual undoable standalone table. Saved projects, models and web tools requiretabulate-intersection-empty-zoneswhen the option is enabled. Older readers refuse files that require this capability.Testing
UI evidence
Before
After
Related issue
Part of #1998
Summary by CodeRabbit