"Funder, Johnny                  OTP" <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I have a couple of "complaints" about the decoding of the
> weathergroup(s).
> 
> Ref ver 1.55

> In the exampel below (from today) we have RA BR. This is translated
> to Moderate Rain Moderate Mist...... The prefix "Moderate" is not
> valid for Mist. The correct translation is Moderate Rain plus Mist
> (I found a metar in version 1.9.5 where BR was reported correct).
> 
> EKYT 280620Z 13004KT 5000 RA BR SCT018 BKN040 BKN060 16/15 Q1011
> TEMPO 3000 BKN005
>
> [lots of examples]

Okay - I can see that we have to work some with the weather-string...
Am I correct in thinking that this regexp should match all the
different groups:

(ereg('^(-|\+|VC)?' .                      /* Intensity or proximity */
      '(MI|PR|BC|DR|BL|SH|TS|FZ)?' .       /* Descriptor */
      '((DZ|RA|SN|SG|IC|PE|GR|GS|UP)+)?' . /* Precipitation */
      '(BR|FG|FU|VA|DU|SA|HZ|PY)?' .       /* Obscuration */
      '(PO|SQ|FC|SS)?$',                   /* Other */
      $part, $regs)

If so, then I think the general rule must be something like this:

$weather = "$description $intensity $precipitation";

like in 'Showers of heavy rain and snow'.

-- 
Best regards,
Martin Geisler

Checkout http://www.gimpster.com for:
PHP Weather => Shows the current weather on your webpages.
PHP Shell   => A telnet-connection (almost :-) in a PHP page.

Reply via email to