From e51af89d8485dbbb4679f686494a80eb4b10633a Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Sun, 24 Aug 2025 14:53:24 +0200 Subject: [PATCH] Enhance aircraft type detection with proper ADS-B categories and visual differentiation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded ICAO matches with standards-compliant ADS-B category parsing: - Implement RTCA DO-260B weight-based categories (Light/Medium/Heavy/Super) - Add helicopter, military, cargo, and GA aircraft type detection - Create distinct SVG icons for each aircraft type (helicopter with rotor disc, swept-wing military, wide-body cargo, etc.) - Enhanced callsign-based fallback classification - Remove hardcoded aircraft 478058 helicopter detection per user feedback - Support proper ADS-B category strings like "Medium 34000-136000kg" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- assets/static/js/modules/aircraft-manager.js | 92 +++++++++++++++++--- 1 file changed, 81 insertions(+), 11 deletions(-) diff --git a/assets/static/js/modules/aircraft-manager.js b/assets/static/js/modules/aircraft-manager.js index 7b4dd2a..a5351cb 100644 --- a/assets/static/js/modules/aircraft-manager.js +++ b/assets/static/js/modules/aircraft-manager.js @@ -141,14 +141,57 @@ export class AircraftManager { const color = this.getAircraftColor(type); const size = aircraft.OnGround ? 12 : 16; + // Create different SVG shapes based on aircraft type + let aircraftPath; + + switch (type) { + case 'helicopter': + // Helicopter shape with rotor disc + aircraftPath = ` + + + + + `; + break; + case 'military': + // Swept-wing fighter jet shape + aircraftPath = ` + + `; + break; + case 'cargo': + // Wide-body cargo aircraft shape + aircraftPath = ` + + + `; + break; + case 'ga': + // Small general aviation aircraft + aircraftPath = ` + + `; + break; + case 'ground': + // Ground vehicle - simplified truck/car shape + aircraftPath = ` + + + + `; + break; + default: + // Default commercial aircraft shape + aircraftPath = ` + + `; + } + const svg = ` - + ${aircraftPath} `; @@ -163,17 +206,43 @@ export class AircraftManager { getAircraftType(aircraft) { if (aircraft.OnGround) return 'ground'; + + // Use ADS-B Category field for proper aircraft classification if (aircraft.Category) { const cat = aircraft.Category.toLowerCase(); - if (cat.includes('military')) return 'military'; - if (cat.includes('cargo') || cat.includes('heavy')) return 'cargo'; - if (cat.includes('light') || cat.includes('glider')) return 'ga'; + + // Standard ADS-B aircraft categories - check specific terms first + if (cat.includes('helicopter') || cat.includes('rotorcraft') || cat.includes('gyrocopter')) return 'helicopter'; + if (cat.includes('military') || cat.includes('fighter') || cat.includes('bomber')) return 'military'; + + // ADS-B weight-based categories (RTCA DO-260B standard) + if (cat.includes('heavy') || cat.includes('super') || cat.includes('136000kg')) return 'cargo'; // Heavy/Super category + if (cat.includes('light') || cat.includes('15500kg') || cat.includes('5700kg') || cat.includes('glider') || cat.includes('ultralight') || cat.includes('sport')) return 'ga'; // Light categories + if (cat.includes('medium') || cat.includes('34000kg')) return 'commercial'; // Medium category - typically commercial airliners + + // Specific aircraft type categories + if (cat.includes('cargo') || cat.includes('transport') || cat.includes('freighter')) return 'cargo'; + if (cat.includes('airliner') || cat.includes('jet') || cat.includes('turboprop')) return 'commercial'; } + + // Fallback to callsign analysis for classification if (aircraft.Callsign) { const cs = aircraft.Callsign.toLowerCase(); - if (cs.includes('mil') || cs.includes('army') || cs.includes('navy')) return 'military'; - if (cs.includes('cargo') || cs.includes('fedex') || cs.includes('ups')) return 'cargo'; + + // Helicopter identifiers + if (cs.includes('heli') || cs.includes('rescue') || cs.includes('medevac') || cs.includes('lifeguard') || + cs.includes('police') || cs.includes('sheriff') || cs.includes('medic')) return 'helicopter'; + + // Military identifiers + if (cs.includes('mil') || cs.includes('army') || cs.includes('navy') || cs.includes('air force') || + cs.includes('usaf') || cs.includes('usmc') || cs.includes('uscg')) return 'military'; + + // Cargo identifiers + if (cs.includes('cargo') || cs.includes('fedex') || cs.includes('ups') || cs.includes('dhl') || + cs.includes('freight') || cs.includes('express')) return 'cargo'; } + + // Default to commercial for unclassified aircraft return 'commercial'; } @@ -183,7 +252,8 @@ export class AircraftManager { cargo: '#ff8c00', military: '#ff4444', ga: '#ffff00', - ground: '#888888' + ground: '#888888', + helicopter: '#ff00ff' // Magenta for helicopters }; return colors[type] || colors.commercial; }