Ndfd
extends Plugin
in package
Table of Contents
- $elementMap : mixed
- $baseUrl : mixed
- $properties : mixed
- __construct() : mixed
- fetch() : object
- Fetches data from the NDFD REST service based on set properties. Note that the full processing API may not yet be supported by \tsn\ndfd\response.
- setEnd() : self
- Set the end time
- setProperty() : mixed
- Set a query property
- setStart() : self
- Set the start time
- setZip() : self
- Set the zipcode for the local forecast
Properties
$elementMap
protected
mixed
$elementMap
= [
'maxTemp' => 'maxt',
// Maximum Temperature
'minTemp' => 'mint',
// Minimum Temperature
'currentTemp' => 'temp',
// 3 Hourly Temperature
'temp' => 'temp',
// Same as above
'dewpoint' => 'dew',
// Dewpoint Temperature
'apparentTemp' => 'appt',
// Apparent Temperature
'precipProbability' => 'pop12',
// 12 Hour Probability of Precipitation
'rainAmount' => 'qpf',
// Liquid Precipitation Amount
'snowAmount' => 'snow',
// Snowfall Amount
'cloudAmount' => 'sky',
// Cloud Cover Amount
'cover' => 'sky',
// Same as above
'humidity' => 'rh',
// Relative Humidity
'windSpeed' => 'wspd',
// Wind Speed
'windDirection' => 'wdir',
// Wind Direction
'weather' => 'wx',
// Weather Conditions
'icons' => 'icons',
// Weather Icons
'waveHeight' => 'waveh',
// Wave Height,
'sky' => 'sky',
]
$baseUrl
private
mixed
$baseUrl
= 'https://graphical.weather.gov/xml/SOAP_server/ndfdXMLclient.php'
$properties
private
mixed
$properties
= []
Methods
__construct()
public
__construct([string $url = false ]) : mixed
Parameters
- $url : string = false
-
optional alternate base url
Return values
mixed —fetch()
Fetches data from the NDFD REST service based on set properties. Note that the full processing API may not yet be supported by \tsn\ndfd\response.
public
fetch() : object
Return values
object —instance of \Ceo\Plugins\Weather\Services\NdfdResponse
setEnd()
Set the end time
public
setEnd(int $ts) : self
Parameters
- $ts : int
-
unix timestamp
Return values
self —setProperty()
Set a query property
public
setProperty(string $k, string $v) : mixed
Parameters
- $k : string
-
key
- $v : string
-
value
Return values
mixed —setStart()
Set the start time
public
setStart(int $ts) : self
Parameters
- $ts : int
-
unix timestamp
Return values
self —setZip()
Set the zipcode for the local forecast
public
setZip(int $zip) : self
Parameters
- $zip : int