feat: cross-source AIP+OpenAIP zone merge (M2) - #10
Open
tomassasovsky wants to merge 1 commit into
Open
Conversation
Implements milestone M2 of the authoritative zone coverage plan. - New ZoneMerger.merge in zones_api_client collapses AIP+OpenAIP pairs that share a ZoneIdentity.matchKey into a single zone: OpenAIP vertex-exact geometry carrying AIP authority (category, permissions, vertical limits), source=openaip + confirmedBy=aip. - Both the runtime ZoneDeduplicator and the backend ZoneIngestService delegate to it, so the merge rule lives in exactly one place. - Safety: a matchKey miss keeps both zones (double-render beats dropping an authoritative zone); the OpenAIP zone with a real polygon is preferred for geometry. - Tests: EZE/Aeroparque/SAR collapse fixtures, polygon preference, keep-both on miss, and a designator-collision guard proving SAR 01-85 and distinct CTR/TMA names never share a matchKey. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ZoneMerger.merge(zones_api_client): when an OpenAIP zone and an ANAC AIP zone share aZoneIdentity.matchKey, they collapse into one zone — OpenAIP vertex-exact geometry carrying AIP authority (category, permissions, vertical limits),source = openaip+confirmedBy = aip.ZoneDeduplicatorand the backendZoneIngestServicedelegate to the single merge function, so the rule lives in exactly one place (no duplicated merge logic across layers).matchKeymiss keeps both zones (a double-render beats dropping an authoritative zone); the OpenAIP candidate carrying a real polygon is preferred for geometry.Plan
feat: complete, authoritative airspace zone coverage — Milestone M2 (depends on M1).
Test plan
zones_api_client:dart test— incl.zone_merger_test.dart(EZE/Aeroparque/SAR collapse → one zone each, polygon preference, keep-both on miss, keyless passthrough) and the designator-collision guard inzone_identity_test.dart(SAR 01–85 + distinct CTR/TMA names never share amatchKey).flight_rules_repository:dart test— dedup now runs id-collapse → cross-source merge; all existing tests green.dart analyze+dart formatclean on changed files.Notes
feat/zone-provenance-validity-fields(M1) since M2 builds on the typedsource/confirmedByfields. Merge M1 first.matchKeypairs) keep deterministic ordering via the existingMapZoneDisplayseverity sort; no separate stacking rule was needed.🤖 Generated with Claude Code