Documentation

Horde_Service_Weather_Parser_Taf extends Horde_Service_Weather_Parser_Base
in package

Horde_Service_Weather_Parser_Taf

Responsible for parsing encoded TAF data.

Parsing code adapted from PEAR's Services_Weather_Metar class. Original phpdoc attributes as follows:

Tags
author

Alexander Wirtz alex@pc4p.net

author

Michael J Rubinsky mrubinsk@horde.org

copyright

2005-2011 Alexander Wirtz

link
http://pear.php.net/package/Services_Weather
license

http://www.opensource.org/licenses/bsd-license.php BSD License

category

Horde

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
$_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.
_getTafCodes()  : array<string|int, mixed>
Return a fresh set of the regexps needed for parsing the TAF data.
_parse()  : array<string|int, mixed>
Parses TAF data.

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()

$_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.

_getTafCodes()

Return a fresh set of the regexps needed for parsing the TAF data.

protected _getTafCodes() : array<string|int, mixed>
Return values
array<string|int, mixed>

_parse()

Parses TAF data.

protected _parse(array<string|int, mixed> $data) : array<string|int, mixed>

TAF KLGA 271734Z 271818 11007KT P6SM -RA SCT020 BKN200 FM2300 14007KT P6SM SCT030 BKN150 FM0400 VRB03KT P6SM SCT035 OVC080 PROB30 0509 P6SM -RA BKN035 FM0900 VRB03KT 6SM -RA BR SCT015 OVC035 TEMPO 1215 5SM -RA BR SCT009 BKN015 BECMG 1517 16007KT P6SM NSW SCT015 BKN070

Parameters
$data : array<string|int, mixed>

The TAF encoded weather data, spilt on line endings.

Return values
array<string|int, mixed>

An array of forecast data. Keys include:

  • station: (string) The station identifier.
  • dataRaw: (string) The raw TAF data.
  • update: (timestamp) Timestamp of last update.
  • validFrom: (Horde_Date) The valid FROM time.
  • validTo: (Horde_Date) The valid TO time.
  • time: (array) An array of Horde_Service_Weather_Period objects for each available valid time provided by the TAF report.

Search results