Fix obviously wrong aircraft trails and implement trail validation #16

Closed
opened 2025-08-24 18:53:29 +02:00 by olemd · 2 comments
Owner

Description

Aircraft trails sometimes show obviously incorrect flight paths that don't make sense physically, such as impossible speeds, teleporting between distant locations, or zigzag patterns that no aircraft could perform.

Current Issues

  • Teleporting: Aircraft appear to jump instantly between distant locations
  • Impossible speeds: Trails show movement faster than any aircraft could achieve
  • Zigzag patterns: Random position jumps creating unrealistic flight paths
  • Ground/air transitions: Aircraft appearing to fly underground or at impossible altitudes
  • No validation: System accepts any position data without sanity checks

Root Causes

  1. Bad ADS-B data: Receivers sometimes get corrupted position data
  2. Signal interference: Poor signal quality leading to decode errors
  3. Multiple aircraft confusion: ICAO address conflicts or decoder issues
  4. No position validation: System doesn't filter obviously wrong coordinates
  5. Missing speed/distance checks: No validation of position change rates

Expected Trail Validation

  • Maximum speed check: Reject position updates requiring >Mach 3 speeds
  • Maximum distance check: Ignore positions >500nm from last known position
  • Altitude sanity: Reject positions below ground or above FL600
  • Time consistency: Ensure position updates are chronologically consistent
  • Coordinate validity: Check lat/lon are within Earth's bounds

Implementation Ideas

  1. Speed validation: Calculate speed between positions, reject if >2000 knots
  2. Distance validation: Reject position jumps >500nm without time gap
  3. Altitude validation: Reject negative altitudes or >60,000ft
  4. Geographic validation: Ensure coordinates are valid (lat: -90 to 90, lon: -180 to 180)
  5. Time validation: Reject out-of-order timestamps
  6. Confidence scoring: Weight position updates by signal strength and validation confidence

Files to Investigate

    • Position decoding and validation
    • Aircraft state updates and trail management
    • Frontend trail rendering
  • Trail data structures and history management

Success Criteria

  • Aircraft trails show realistic flight paths only
  • Obviously wrong position data is filtered out
  • System logs validation failures for debugging
  • Performance impact is minimal
  • Users see cleaner, more accurate flight tracking

This will significantly improve the user experience by showing only plausible aircraft movements.

## Description Aircraft trails sometimes show obviously incorrect flight paths that don't make sense physically, such as impossible speeds, teleporting between distant locations, or zigzag patterns that no aircraft could perform. ## Current Issues - **Teleporting**: Aircraft appear to jump instantly between distant locations - **Impossible speeds**: Trails show movement faster than any aircraft could achieve - **Zigzag patterns**: Random position jumps creating unrealistic flight paths - **Ground/air transitions**: Aircraft appearing to fly underground or at impossible altitudes - **No validation**: System accepts any position data without sanity checks ## Root Causes 1. **Bad ADS-B data**: Receivers sometimes get corrupted position data 2. **Signal interference**: Poor signal quality leading to decode errors 3. **Multiple aircraft confusion**: ICAO address conflicts or decoder issues 4. **No position validation**: System doesn't filter obviously wrong coordinates 5. **Missing speed/distance checks**: No validation of position change rates ## Expected Trail Validation - **Maximum speed check**: Reject position updates requiring >Mach 3 speeds - **Maximum distance check**: Ignore positions >500nm from last known position - **Altitude sanity**: Reject positions below ground or above FL600 - **Time consistency**: Ensure position updates are chronologically consistent - **Coordinate validity**: Check lat/lon are within Earth's bounds ## Implementation Ideas 1. **Speed validation**: Calculate speed between positions, reject if >2000 knots 2. **Distance validation**: Reject position jumps >500nm without time gap 3. **Altitude validation**: Reject negative altitudes or >60,000ft 4. **Geographic validation**: Ensure coordinates are valid (lat: -90 to 90, lon: -180 to 180) 5. **Time validation**: Reject out-of-order timestamps 6. **Confidence scoring**: Weight position updates by signal strength and validation confidence ## Files to Investigate - - Position decoding and validation - - Aircraft state updates and trail management - - Frontend trail rendering - Trail data structures and history management ## Success Criteria - Aircraft trails show realistic flight paths only - Obviously wrong position data is filtered out - System logs validation failures for debugging - Performance impact is minimal - Users see cleaner, more accurate flight tracking This will significantly improve the user experience by showing only plausible aircraft movements.
Author
Owner

Implementation Complete

Position validation has been implemented to fix obviously wrong aircraft trails! The solution adds comprehensive validation to the data merger to filter out impossible position updates before they can create unrealistic flight paths.

🔍 What was implemented:

1. Validation Function ()

  • Geographic bounds check: Rejects lat/lon outside Earth's coordinate system (-90°/+90° lat, -180°/+180° lon)
  • Altitude validation: Rejects impossible altitudes (below -500ft or above 60,000ft)
  • Speed validation: Calculates implied speed between positions and rejects anything >2000 knots (~Mach 3)
  • Distance validation: Rejects position jumps >500 nautical miles
  • Time validation: Rejects out-of-order timestamps
  • Speed consistency: Warns when reported ground speed differs significantly from implied speed

2. Integration Points

  • ****: Position points are validated before being added to position history (trails)
  • ****: Position updates are validated before updating aircraft state

3. Logging & Debugging

  • Rejection logging:
  • Warning logging:
  • ICAO addresses included for easy debugging of specific aircraft

🎯 Problem Resolution:

Before: Aircraft could show teleporting, impossible speeds, zigzag patterns, underground flight
After: Only realistic position updates are accepted, creating clean and plausible flight trails

📋 Validation Constants:

  • Max Speed: 2000 knots (approximately Mach 3 at cruise altitude)
  • Max Distance Jump: 500 nautical miles
  • Altitude Range: -500ft to 60,000ft (allows below sea level but caps at commercial ceiling)
  • Speed Warning Threshold: 800+ knots (logged but not rejected)

🧪 Testing:

  • Code compiles successfully
  • Passes checks
  • Formatted with

The validation runs in real-time as aircraft data flows through the system, ensuring users only see realistic flight paths while maintaining detailed logs for debugging any false positives.

Location: (validatePosition function)
Files Modified:

## ✅ Implementation Complete Position validation has been implemented to fix obviously wrong aircraft trails! The solution adds comprehensive validation to the data merger to filter out impossible position updates before they can create unrealistic flight paths. ### 🔍 **What was implemented:** **1. Validation Function ()** - **Geographic bounds check**: Rejects lat/lon outside Earth's coordinate system (-90°/+90° lat, -180°/+180° lon) - **Altitude validation**: Rejects impossible altitudes (below -500ft or above 60,000ft) - **Speed validation**: Calculates implied speed between positions and rejects anything >2000 knots (~Mach 3) - **Distance validation**: Rejects position jumps >500 nautical miles - **Time validation**: Rejects out-of-order timestamps - **Speed consistency**: Warns when reported ground speed differs significantly from implied speed **2. Integration Points** - ****: Position points are validated before being added to position history (trails) - ****: Position updates are validated before updating aircraft state **3. Logging & Debugging** - **Rejection logging**: - **Warning logging**: - ICAO addresses included for easy debugging of specific aircraft ### 🎯 **Problem Resolution:** **Before:** Aircraft could show teleporting, impossible speeds, zigzag patterns, underground flight **After:** Only realistic position updates are accepted, creating clean and plausible flight trails ### 📋 **Validation Constants:** - **Max Speed**: 2000 knots (approximately Mach 3 at cruise altitude) - **Max Distance Jump**: 500 nautical miles - **Altitude Range**: -500ft to 60,000ft (allows below sea level but caps at commercial ceiling) - **Speed Warning Threshold**: 800+ knots (logged but not rejected) ### 🧪 **Testing:** - ✅ Code compiles successfully - ✅ Passes checks - ✅ Formatted with The validation runs in real-time as aircraft data flows through the system, ensuring users only see realistic flight paths while maintaining detailed logs for debugging any false positives. **Location**: (validatePosition function) **Files Modified**:
Author
Owner

Implementation Complete

Position validation has been implemented to fix obviously wrong aircraft trails! The solution adds comprehensive validation to the data merger to filter out impossible position updates before they can create unrealistic flight paths.

🔍 What was implemented:

1. Validation Function (validatePosition)

  • Geographic bounds check: Rejects lat/lon outside Earth's coordinate system (-90°/+90° lat, -180°/+180° lon)
  • Altitude validation: Rejects impossible altitudes (below -500ft or above 60,000ft)
  • Speed validation: Calculates implied speed between positions and rejects anything >2000 knots (~Mach 3)
  • Distance validation: Rejects position jumps >500 nautical miles
  • Time validation: Rejects out-of-order timestamps
  • Speed consistency: Warns when reported ground speed differs significantly from implied speed

2. Integration Points

  • updateHistories(): Position points are validated before being added to position history (trails)
  • mergeAircraftData(): Position updates are validated before updating aircraft state

3. Logging & Debugging

  • Rejection logging: [POSITION_VALIDATION] ICAO ABCDEF: REJECTED - Invalid latitude: 95.123456
  • Warning logging: [POSITION_VALIDATION] ICAO ABCDEF: WARNING - High speed detected: 850 knots
  • ICAO addresses included for easy debugging of specific aircraft

🎯 Problem Resolution:

Before: Aircraft could show teleporting, impossible speeds, zigzag patterns, underground flight
After: Only realistic position updates are accepted, creating clean and plausible flight trails

📋 Validation Constants:

  • Max Speed: 2000 knots (approximately Mach 3 at cruise altitude)
  • Max Distance Jump: 500 nautical miles
  • Altitude Range: -500ft to 60,000ft (allows below sea level but caps at commercial ceiling)
  • Speed Warning Threshold: 800+ knots (logged but not rejected)

🧪 Testing:

  • Code compiles successfully
  • Passes go vet checks
  • Formatted with gofmt

The validation runs in real-time as aircraft data flows through the system, ensuring users only see realistic flight paths while maintaining detailed logs for debugging any false positives.

Location: internal/merger/merger.go:836-993 (validatePosition function)
Files Modified: internal/merger/merger.go

## ✅ Implementation Complete Position validation has been implemented to fix obviously wrong aircraft trails! The solution adds comprehensive validation to the data merger to filter out impossible position updates before they can create unrealistic flight paths. ### 🔍 What was implemented: **1. Validation Function (validatePosition)** - **Geographic bounds check**: Rejects lat/lon outside Earth's coordinate system (-90°/+90° lat, -180°/+180° lon) - **Altitude validation**: Rejects impossible altitudes (below -500ft or above 60,000ft) - **Speed validation**: Calculates implied speed between positions and rejects anything >2000 knots (~Mach 3) - **Distance validation**: Rejects position jumps >500 nautical miles - **Time validation**: Rejects out-of-order timestamps - **Speed consistency**: Warns when reported ground speed differs significantly from implied speed **2. Integration Points** - **updateHistories()**: Position points are validated before being added to position history (trails) - **mergeAircraftData()**: Position updates are validated before updating aircraft state **3. Logging & Debugging** - **Rejection logging**: [POSITION_VALIDATION] ICAO ABCDEF: REJECTED - Invalid latitude: 95.123456 - **Warning logging**: [POSITION_VALIDATION] ICAO ABCDEF: WARNING - High speed detected: 850 knots - ICAO addresses included for easy debugging of specific aircraft ### 🎯 Problem Resolution: **Before:** Aircraft could show teleporting, impossible speeds, zigzag patterns, underground flight **After:** Only realistic position updates are accepted, creating clean and plausible flight trails ### 📋 Validation Constants: - **Max Speed**: 2000 knots (approximately Mach 3 at cruise altitude) - **Max Distance Jump**: 500 nautical miles - **Altitude Range**: -500ft to 60,000ft (allows below sea level but caps at commercial ceiling) - **Speed Warning Threshold**: 800+ knots (logged but not rejected) ### 🧪 Testing: - ✅ Code compiles successfully - ✅ Passes go vet checks - ✅ Formatted with gofmt The validation runs in real-time as aircraft data flows through the system, ensuring users only see realistic flight paths while maintaining detailed logs for debugging any false positives. **Location**: internal/merger/merger.go:836-993 (validatePosition function) **Files Modified**: internal/merger/merger.go
olemd closed this issue 2025-08-24 19:54:32 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: olemd/skyview#16
No description provided.