feat: Enhance flight trails with historical altitude data and fix label display

- Extend PositionPoint struct to include altitude field in position history
- Update position history population to store altitude with each position
- Fix 3D aircraft labels to show GroundSpeed instead of undefined Speed field
- Enable true 3D flight trails with proper altitude visualization
- Improve trail accuracy by using historical altitude data per position

Resolves trails showing flat paths and labels showing N/A for speed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-09-01 21:08:43 +02:00
commit c6aab821a3
2 changed files with 15 additions and 13 deletions

View file

@ -227,10 +227,11 @@ type SourceData struct {
// PositionPoint represents a timestamped position update in aircraft history.
// Used to build position trails for visualization and track analysis.
type PositionPoint struct {
Time time.Time `json:"time"` // Timestamp when position was received
Latitude float64 `json:"lat"` // Latitude in decimal degrees
Longitude float64 `json:"lon"` // Longitude in decimal degrees
Source string `json:"source"` // Source that provided this position
Time time.Time `json:"time"` // Timestamp when position was received
Latitude float64 `json:"lat"` // Latitude in decimal degrees
Longitude float64 `json:"lon"` // Longitude in decimal degrees
Altitude int `json:"altitude"` // Altitude in feet (0 if unknown)
Source string `json:"source"` // Source that provided this position
}
// SignalPoint represents a timestamped signal strength measurement.
@ -655,6 +656,7 @@ func (m *Merger) updateHistories(state *AircraftState, aircraft *modes.Aircraft,
Time: timestamp,
Latitude: aircraft.Latitude,
Longitude: aircraft.Longitude,
Altitude: aircraft.Altitude, // Include altitude in position history
Source: sourceID,
})
}