Skip to content

Filter Iowa bridges by deck condition only, matching the renderer#22

Merged
TimPurdum merged 1 commit into
mainfrom
fix/iowa-bridges-deck-condition-filter
Jun 29, 2026
Merged

Filter Iowa bridges by deck condition only, matching the renderer#22
TimPurdum merged 1 commit into
mainfrom
fix/iowa-bridges-deck-condition-filter

Conversation

@TimPurdum

Copy link
Copy Markdown
Collaborator

What

The Iowa Bridges sample's sidebar condition filter built a definition expression matching a bridge if any of DECK_COND_058, SUPERSTRUCTURE_COND_059, or SUBSTRUCTURE_COND_060 fell in the selected NBI code range. The map's UniqueValueRenderer, however, colors each dot solely by DECK_COND_058.

That mismatch meant a bridge could keep a "Good"-colored dot (deck = 8) while still qualifying through a poor superstructure or substructure rating, so dots would persist on the map after the user unchecked the box for their visible color.

This changes BridgeFilterState.BuildConditionClause() to filter on the same field the renderer symbolizes by:

-- before
DECK_COND_058 IN (...) OR SUPERSTRUCTURE_COND_059 IN (...) OR SUBSTRUCTURE_COND_060 IN (...)
-- after
DECK_COND_058 IN (...)

Now the dots that disappear always match the unchecked boxes. Also removes a stale comment that referenced an "Arcade renderer" — the renderer classifies by DECK_COND_058 directly (see the DEVIATION FROM PROMPT note in BridgeRendererFactory).

Why

Keeps the live demo, the accompanying blog post, and this sample consistent on how condition filtering works.

Testing

  • dotnet build succeeds.

🤖 Generated with Claude Code

The condition checkboxes built a definition expression that matched a bridge
if ANY of DECK_COND_058, SUPERSTRUCTURE_COND_059, or SUBSTRUCTURE_COND_060 fell
in the selected range. But the map's UniqueValueRenderer colors each dot solely
by DECK_COND_058, so a bridge could keep a "Good"-colored dot while qualifying
through a poor superstructure/substructure rating, making dots persist after the
user unchecked the box for their visible color.

Filter on the same field the renderer symbolizes by so the dots that disappear
always match the unchecked boxes. Also drops the stale comment referencing an
"Arcade renderer" (the renderer classifies by DECK_COND_058 directly).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ejz9vZZjusM5qtxqzXyDSk
@TimPurdum TimPurdum merged commit 35cc12e into main Jun 29, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant