Skip to content

feat: cross-source AIP+OpenAIP zone merge (M2) - #10

Open
tomassasovsky wants to merge 1 commit into
feat/zone-provenance-validity-fieldsfrom
feat/zone-cross-source-merge
Open

feat: cross-source AIP+OpenAIP zone merge (M2)#10
tomassasovsky wants to merge 1 commit into
feat/zone-provenance-validity-fieldsfrom
feat/zone-cross-source-merge

Conversation

@tomassasovsky

Copy link
Copy Markdown
Owner

Summary

  • Adds ZoneMerger.merge (zones_api_client): when an OpenAIP zone and an ANAC AIP zone share a ZoneIdentity.matchKey, they collapse into one 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 the single merge function, so the rule lives in exactly one place (no duplicated merge logic across layers).
  • Safety-first: a matchKey miss 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 coverageMilestone 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 in zone_identity_test.dart (SAR 01–85 + distinct CTR/TMA names never share a matchKey).
  • flight_rules_repository: dart test — dedup now runs id-collapse → cross-source merge; all existing tests green.
  • dart analyze + dart format clean on changed files.
  • Reviewer: spot-check a real ingest run once OpenAIP + AIP both have live data (M3b) — confirm EZE/Aeroparque render once.

Notes

  • Base branch is feat/zone-provenance-validity-fields (M1) since M2 builds on the typed source/confirmedBy fields. Merge M1 first.
  • Residual geographic overlaps (genuinely distinct zones, not matchKey pairs) keep deterministic ordering via the existing MapZoneDisplay severity sort; no separate stacking rule was needed.

🤖 Generated with Claude Code

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>
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