diff --git a/lib/Horde/Service/Weather/Parser/Base.php b/lib/Horde/Service/Weather/Parser/Base.php index f673c25..001adcb 100644 --- a/lib/Horde/Service/Weather/Parser/Base.php +++ b/lib/Horde/Service/Weather/Parser/Base.php @@ -30,6 +30,7 @@ abstract class Horde_Service_Weather_Parser_Base const UNIT_KEY_SPEED = 'speed'; const UNIT_KEY_PRESSURE = 'pressure'; const UNIT_KEY_DISTANCE = 'distance'; + const UNIT_KEY_HEIGHT = 'height'; /** * The type of units to convert to. diff --git a/lib/Horde/Service/Weather/Parser/Metar.php b/lib/Horde/Service/Weather/Parser/Metar.php index 909fc7c..8e15771 100644 --- a/lib/Horde/Service/Weather/Parser/Metar.php +++ b/lib/Horde/Service/Weather/Parser/Metar.php @@ -290,7 +290,7 @@ protected function _parse(array $data) $cloud['height'] = Horde_Service_Weather::convertDistance( $result[4] * 100, 'ft', - $this->_unitMap[self::UNIT_KEY_DISTANCE] + $this->_unitMap[self::UNIT_KEY_HEIGHT] ); } } elseif (sizeof($result) == 6) { @@ -302,7 +302,11 @@ protected function _parse(array $data) if ($result[4] == '///') { $cloud['height'] = Horde_Service_Weather_Translation::t('station level or below'); } else { - $cloud['height'] = $result[4] * 100; + $cloud['height'] = Horde_Service_Weather::convertDistance( + $result[4] * 100, + 'ft', + $this->_unitMap[self::UNIT_KEY_HEIGHT] + ); } } else { // SKC or CLR or NSC