1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSX METAR Format Decoder

Discussion in 'SimConnect' started by AndyWoz, 2/4/11.

  1. AndyWoz

    AndyWoz

    Joined:
    31/1/10
    Messages:
    9
    Country:
    unitedstates
    This question pops up with regularity on various sub-fora here and, as far as I can see, has never received a satisfactory response. Since hope springs eternal, I thought I'd give it new life by asking it again: Does anyone have an FSX METAR decoder class/function that they are willing to share? (Notice the emphasis on FSX METAR; standard FAA METARs - while not trivial - are simpler.)

    I am building one right now and it causes me to want to pull all my hair out in frustration. :banghead: Not only is FSX METAR a METAR - i.e. something inherently hard to parse - but it features all kinds of extensions and optional parts that make it even harder, without employing some Artificial Intelligence, it seems. Why does it have to be so complicated?

    Anyway, I would appreciate any and all help in finding/developing a viable FSX METAR parser/decoder. I will publish the results for all to see, if I ever get to the point of being able to fully parse and interpret an FSX-generated METAR.

    AW
  2. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    I asked the same about 5 months ago :)

    I friend, who is a METAR Decoder Software GURU, was starting to work on it, and was unfortunally taken ill, so the project is on hold.

    Yes, it's a Challenge ... :)

    Geoff
  3. JardY

    JardY

    Joined:
    20/8/10
    Messages:
    45
    Country:
    france
    To decode FSX real weather, I'm using the following function made be me (so sorry for the ugly code and for the french variables & comments).

    There are still many cases I'm not taking in account, so it will be great to develop a class or function very reliable and complete

    DecodeMeteo.cs
  4. AndyWoz

    AndyWoz

    Joined:
    31/1/10
    Messages:
    9
    Country:
    unitedstates
    Thanks. I wish I had waited for your reply. :) As it were, I ended up writing a 650+ line class, and I am not even done yet.


    My class is not complete by any means, but so far it has proven quite reliable. I'll publish it soon.

    Meanwhile, I discovered that FSX lies about the weather. It reports clear skies when there are scattered or even broken clouds visible...

    AW
  5. AndyWoz

    AndyWoz

    Joined:
    31/1/10
    Messages:
    9
    Country:
    unitedstates
    So here is my take on the task of parsing an FSX METAR. You can download the result of my attempts at http://navsim.org/files/ParseMetar.0.1.0.zip. It's a Pascal (Delphi 7) project, containing a simple command-line harness, and the parser class (TMetarParser).

    The parser is a Finite State Machine with 15 states currently. I realize that it is still inadequate in many ways, as it is unfinished, but it works most of the time. :) I will be very interested in seeing examples of FSX-generated METARs that are not parsed correctly.

    -AW
  6. Vitus

    Vitus

    Joined:
    29/11/06
    Messages:
    699
    Country:
    newzealand
    I'm interested in a Metar parser for C++. I can get the metar string with simConnect but I am completely stuck. Started to look at regex, but it's horrible to implement in C++. So I'd be grateful if someone could share their solution or at least give some clues how to proceed.

    Cheers,
    Vitus
  7. ddawson

    ddawson Resource contributor

    Joined:
    27/9/06
    Messages:
    370
    Country:
    canada
    I'm starting from scratch here, but I'll take a kick at it.

    Doug
  8. Vitus

    Vitus

    Joined:
    29/11/06
    Messages:
    699
    Country:
    newzealand
    Hey Doug,

    coooooool! I'd love to read about your experience! :cool:

Share This Page