cvs: pear /Services_Weather/Weather Metar.php
| From: | Alexander Wirtz | Date: | Sun, 05 Oct 2003 23:44:15 +0000 |
| Subject: | cvs: pear /Services_Weather/Weather Metar.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-13409@lists.php.net to get a copy of this message | ||
eru Sun Oct 5 19:44:15 2003 EDT
Modified files:
/pear/Services_Weather/Weather Metar.php
Log:
*Changed some representation in visibility and clouds
Index: pear/Services_Weather/Weather/Metar.php
diff -u pear/Services_Weather/Weather/Metar.php:1.10 pear/Services_Weather/Weather/Metar.php:1.11
--- pear/Services_Weather/Weather/Metar.php:1.10 Sun Oct 5 19:21:39 2003
+++ pear/Services_Weather/Weather/Metar.php Sun Oct 5 19:44:15 2003
@@ -16,7 +16,7 @@
// | Authors: Alexander Wirtz <alex@pc4p.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Metar.php,v 1.10 2003/10/05 23:21:39 eru Exp $
+// $Id: Metar.php,v 1.11 2003/10/05 23:44:15 eru Exp $
require_once "Services/Weather/Common.php";
@@ -311,7 +311,10 @@
unset($metarCode["visibility1"]);
break;
case "visibility2":
- if (is_numeric($result[1])) {
+ if (is_numeric($result[1]) && ($result[1] == 9999)) {
+ // Upper limit of visibility range
+ $visibility = "greater than
".$this->convertDistance(10, "km",
$this->_units["vis"]).$this->_units["vis"];
+ } elseif (is_numeric($result[1])) {
// 4-digit visibility in m
$visibility = $this->convertDistance(($result[1]/1000),
"km", $this->_units["vis"]);
} elseif ($result[7] != "CAVOK") {
@@ -327,7 +330,7 @@
}
} else {
$visibility = "greater than
".$this->convertDistance(10, "km",
$this->_units["vis"]).$this->_units["vis"];
- $weatherData["clouds"] = array("amount"
=> "none below 5000ft");
+ $weatherData["clouds"] = array("amount"
=> "none", "height" => "below 5000ft");
$weatherData["condition"] = "no significant
weather";
}
$weatherData["visibility"] = $visibility;