Metar Bulletin

Aug 8, 2013 at 6:53 PM
Hi
thanks for this excellent project for decode METAR
I want decode METAR Bulletin and save into DB, I Created RegEX of this but find your project, if I can use your project for this reason?

(METAR Bulletin sample:
GG OIZZYRYR
060020 OIIIYMYX
SAIR91 OIII 060000 RRA
METAR UBBB 060000Z 33009KT CAVOK 23/21 Q1011 88CLRD70
NOSIG=
METAR UTAA 060000Z 08004MPS 9999 SKC 25/01 Q1013 NOSIG=
METAR UTAK 060000Z 00000MPS CAVOK 24/13 Q1010 NOSIG=
METAR UTAT 060000Z 03003MPS 4000 FEW200 20/12 Q1013 NOSIG=
METAR UTAV 060000Z 02002MPS 7000 SKC 19/08 Q1010 NOSIG=

)
Developer
Aug 17, 2013 at 5:01 PM
Hello!

Thank you for your feedback. It is always nice to hear that people like METAR.NET!

I am not quite sure if I understand your question correctly, but you can you can use METAR.NET for decoding the mentioned METARs. To use the decoder correctly you have to forward the METARs one by one. This means: you can only decode one METAR at one time - your bulletin has several METARs in it, which is not supported.

Greetings
Stefan
Aug 18, 2013 at 6:19 AM
Dear Friend ,

Many thanks for your kind reply. I should say that your project was fabulous.
BTW I did some changes & and now I can decode some of METARs.
private void btnLongInfo_Click(object sender, EventArgs e)
    {
        int i = 0;
        string MetarRegEX = @"((?:METAR|METAR\s+COR|SPECI\s+COR|SPECI)\s+(?:[A-Z]{4}\s+|NIL)(?:(\d{6}Z\s+)?NIL|(\d{6}Z\s+)(AUTO\s+)?(((?:\d{3}|VRB)P?\d{2,3}(GP?\d{2,3})?(?:MPS|KT|KMH|KTS)\s+)(\d{3}V\d{3}\s+)?)" +
                            @"(?:CAVOK\s+|(?:/\s*|\d{4}(\s\d{4}[A-Z]{1,2})*\s+)(?:/\s|(R\d{2}(?:R|L|C)?/(?:(?:M|P)?\d{4}(?:U|N|D)?|(?:M|P)?\d{4}V(?:M|P)?\d{4}(?:U|N|D)?)\s+))*" +
                            @"(?:/\+|(((?:\+|-|VC)?([A-Z]{2,4}))\s+))*" +
                            @"(?:(?:/\s*|([A-Z]{3}\d{3}(?:CB|TCU)?\s+)|([A-Z]{2}\d{3})\s+)+|SKC\s+|NSD\s+|NSC\s+|NCD\s+)*)" +
                            @"(M?\d{2}M?/M?\d{2}M?\s+)" +
                            @"(Q\d{4}(A\d{4})?)" +
                            @"([(?:\w|\s|\+.|\-)-[=]])*)?=" +
                            @")+";

      AddInfo("Performing long-info print...");

      foreach (Match match in Regex.Matches(txtMetar.Text,MetarRegEX))
      {
          ENG.WMOCodes.Codes.Metar mtr = GetMetar(match.ToString());

          if (mtr != null)
          {

              ENG.WMOCodes.Formatters.InfoFormatter.MetarFormatter formatter =
                new ENG.WMOCodes.Formatters.InfoFormatter.MetarFormatter();

              string str = formatter.ToString(mtr);

              i++;
              AddInfo(" === METAR " + i.ToString()+ "===");
              AddInfo(str);
          }
      }

      ENG.WMOCodes.Codes.Taf taf = GetTaf();
      if (taf != null)
      {
      ENG.WMOCodes.Formatters.InfoFormatter.TafFormatter tafFormatter =
        new ENG.WMOCodes.Formatters.InfoFormatter.TafFormatter();

      string str = tafFormatter.ToString(taf);

      AddInfo(" === TAF ===");
      AddInfo(str);
      }

      AddInfo("...done");
    }
With Best regards
Hamid
Coordinator
Sep 6, 2013 at 8:33 PM
Hi, of course you can use it in your updated code, however I'm not going to support decoding multiple metars at once. I still think that its easy to do the cycle above the METAR.NET project.

But, again, you are welcome and you can use your changed code ;-)