This project is read-only.


Getting AUTO as ICAO value



Using the MetarDecoderWithAllOptional

The following METAR:
METAR K2J9 231735Z AUTO 28006KT 6SM FEW031 FEW047 SCT050 30/25 A3002 RMK AO1

returns AUTO as the value for ICAO instead of K2J9 as expected.

I also get the same problem with:
  • METAR K9A1 232035Z AUTO 28005KT 10SM SCT100 30/16 A2989 RMK AO2
  • METAR K8A0 232035Z AUTO 00000KT 10SM -RA OVC004 22/ A2991 RMK AO2 LTG DSNT SW
  • METAR KE38 232035Z AUTO 21008G17KT 160V230 10SM SCT065 BKN090 BKN110 31/15 A3013 RMK AO2 T03130145
  • METAR K4A6 232035Z AUTO 00000KT 10SM BKN017 BKN060 25/22 A2990 RMK AO2 LTG DSNT N AND SW
Is this related to the fact that the names of these stations contains numerical values? Has someone also experienced the same problem? Is there a workaround for it or is this easy to fix in the source?


file attachments

Closed Sep 6, 2013 at 9:26 PM by Engin1980
Fixed in code, will be in next release.


pcotte wrote Jul 24, 2013 at 7:17 PM

I looked into the code and I found out that, the ICAO code is decoded using a regular expression which expect it to be strictly composed of letter. The reality is that ICAO codes can contain numbers.

I modified the regular expression so it can accept any alphanumerical characters and it solve the problem. I've attached the new version on the ICAODecoder class which correct the issue.

Engin1980 wrote Sep 6, 2013 at 9:25 PM

ICAO with numbers is valid only in US/Can. Therefore I added it as a new class and this approach is used only with MetarDecoderWithAllOptional (original decoder stays unchanged).

Thank you for your help!

wrote Sep 6, 2013 at 9:26 PM