You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot parse METARs with both COR and AUTO modifiers #15
ICAO-format METARs commonly have both correction (COR) and automation (AUTO) modifiers together, but SwiftMETAR's Observer enum can only represent one state:
publicenumObserver:String,Codable{case human =""case automated ="AUTO"case corrected ="COR"}
Current Behavior:
// ✅ Works
tryawaitMETAR.from(string:"EGLL 172050Z AUTO 08005KT 9999 NCD 03/M03 Q1016")
// observer = .automated
// ✅ Works
tryawaitMETAR.from(string:"EGLL 172050Z COR 08005KT 9999 NCD 03/M03 Q1016")
// observer = .corrected
// ❌ Fails with badFormat error
tryawaitMETAR.from(string:"EGLL 172050Z COR AUTO 08005KT 9999 NCD 03/M03 Q1016")
Expected Behavior:
Should parse successfully and preserve both pieces of information. The actual weather data (wind, temperature, QNH, etc.) is valid - the parser shouldn't fail entirely just because both modifiers are present.
Real-World Impact:
Many European automated weather stations issue corrected reports with this format. Currently, all such METARs fail to parse even though the weather data itself is perfectly valid.
Graceful degradation (quickest fix):
Parse either modifier and succeed, even if we can only store one. Parsing COR AUTO and only capturing .automated is better than failing completely.
References:
ICAO Annex 3 / Doc 8896 allows multiple modifiers
Example: Many UK automated stations (EGLL, EGKK, EGGD) regularly issue COR AUTO reports
Activity
varyamereon commentedon Feb 18, 2026
Actually I wonder if corrected belongs as an observer at all, would it fit better to issuance?