Horde_Service_Weather_Parser_Metar
extends Horde_Service_Weather_Parser_Base
in package
Horde_Service_Weather_Parser_Metar
Responsible for parsing encoded METAR data.
Parsing code adapted from PEAR's Services_Weather_Metar class. Original phpdoc attributes as follows:
Tags
Table of Contents
- UNIT_KEY_DISTANCE = 'distance'
- UNIT_KEY_PRESSURE = 'pressure'
- UNIT_KEY_SPEED = 'speed'
- UNIT_KEY_TEMP = 'temp'
- $_clouds : array<string|int, mixed>
- Cloud cover code map.
- $_cloudTypes : array<string|int, mixed>
- CloudType map
- $_conditions : array<string|int, mixed>
- Conditions map
- $_hours : array<string|int, mixed>
- Map of hours descriptors.
- $_sensors : array<string|int, mixed>
- Sensors map
- $_unitMap : array<string|int, mixed>
- Mapping of what units to use for each type of value.
- $_units : int
- The type of units to convert to.
- __construct() : mixed
- constructor
- parse() : array<string|int, mixed>
- Parse the raw data.
- _getMetarCodes() : array<string|int, mixed>
- Return the array of regexps used to parse METAR text. We don't define this in the declaration since we unset the entries as they are parsed.
- _getRemarks() : array<string|int, mixed>
- Return the array of regexps used to parse METAR remarks section.
- _parse() : array<string|int, mixed>
- Parses METAR
Constants
UNIT_KEY_DISTANCE
public
mixed
UNIT_KEY_DISTANCE
= 'distance'
UNIT_KEY_PRESSURE
public
mixed
UNIT_KEY_PRESSURE
= 'pressure'
UNIT_KEY_SPEED
public
mixed
UNIT_KEY_SPEED
= 'speed'
UNIT_KEY_TEMP
public
mixed
UNIT_KEY_TEMP
= 'temp'
Properties
$_clouds
Cloud cover code map.
protected
array<string|int, mixed>
$_clouds
= array()
$_cloudTypes
CloudType map
protected
array<string|int, mixed>
$_cloudTypes
= array()
$_conditions
Conditions map
protected
array<string|int, mixed>
$_conditions
= array()
$_hours
Map of hours descriptors.
protected
array<string|int, mixed>
$_hours
= array('P' => '1', '6' => '3/6', '7' => '24')
$_sensors
Sensors map
protected
array<string|int, mixed>
$_sensors
= array()
$_unitMap
Mapping of what units to use for each type of value.
protected
array<string|int, mixed>
$_unitMap
Built using self::_units
$_units
The type of units to convert to.
protected
int
$_units
A Horde_Service_Weather::UNITS_* constant.
Methods
__construct()
constructor
public
__construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $params : array<string|int, mixed> = array()
-
Parameter array:
- units: (integer) The Horde_Service_Weather::UNITS_* constant.
Return values
mixed —parse()
Parse the raw data.
public
parse(string $data) : array<string|int, mixed>
Parameters
- $data : string
-
The raw TAF or METAR data.
Return values
array<string|int, mixed> —The parsed data array.
_getMetarCodes()
Return the array of regexps used to parse METAR text. We don't define this in the declaration since we unset the entries as they are parsed.
protected
_getMetarCodes() : array<string|int, mixed>
Return values
array<string|int, mixed> —_getRemarks()
Return the array of regexps used to parse METAR remarks section.
protected
_getRemarks() : array<string|int, mixed>
Return values
array<string|int, mixed> —_parse()
Parses METAR
protected
_parse(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
-
An array of METAR data lines.
Return values
array<string|int, mixed> —An array of weather data. Possible keys include:
- station:
- dataRaw:
- update:
- updateRaw:
- wind:
- windDegrees:
- windDirection:
- windGust:
- windVariability:
- visibility:
- visQualifier:
- clouds:
- amount
- height
- type
- temperature
- dewpoint
- humidity
- felttemperature
- pressure
- trend
- type
- from
- to
- at
- remark
- autostation
- seapressure
- presschg
- snowdepth
- snowequiv
- cloudtypes
- sunduration
- 1hrtemp
- 1hrdew
- 6hmaxtemp
- 6hmintemp
- 24hmaxtemp
- 24hmintemp
- 3hpresstrend
- nospeci
- sensors
- maintain
- precipitation
- amount
- hours