StevenFrost / AviationWeather

A C++ library for formatting and parsing various meteorology-related data structures
Other
4 stars 1 forks source link

METAR with BR (mist) is parsed incorrectly #17

Closed ollyau closed 9 years ago

ollyau commented 9 years ago

When parsing KONP 102355Z AUTO 27003KT 1 1/2SM BR OVC003 16/14 A3000 RMK AO2 or KCHO 102353Z 16007KT 2SM BR OVC003 22/21 A2991 RMK AO2 RAE48 SLP122 P0002 60003 T02220211 10233 20222 56011 results in a weather group containing the following element: {intensity=moderate (1) descriptor=none (0) phenomena={ size=0 } }.

Expected weather group would contain no intensity, no descriptor, and a phenomena of mist (BR).

ollyau commented 9 years ago

Was just taking a look at some METARs and found some with other phenomena to check in the unit tests:

KAPC 151954Z 21007KT 170V230 5SM HZ FU CLR 31/12 A2996 RMK AO2 SLP135 SMOKE ALQDS UP TO 7500 MSL FLIGHT VIS 4-5 MI T03110117 (MVFR)

KSTS 151953Z VRB03KT 3SM HZ FU CLR 34/09 A2994 RMK AO2 SLP132 FU ALL QUADS TOPS 055 T03390094 (MVFR)

KLVK 151953Z COR 03004KT 6SM HZ FU CLR 35/03 A2995 RMK AO2 SLP138 T03500033 (VFR)

KCCR 151953Z 02005KT 5SM FU CLR 33/07 A2996 RMK AO2 SLP131 T03330067 (MVFR)

KHWD 152017Z 29010KT 3SM HZ CLR 31/10 A2995 RMK AO2 (MVFR)

I've also added the flight category based on SkyVector and ForeFlight. The current code considers 5SM visibility sufficient for VFR, but the aforementioned data sources indicate otherwise.

Edit: Just checked the documents again (reference: AIM 7−1−7. Categorical Outlooks on page 7−1−18 and ADDS - METARs Help Page (4 of 5) and it's implemented wrong. Added bug #24 and pull request #25 to resolve.