Services_Weather
[ class tree: Services_Weather ] [ index: Services_Weather ] [ all elements ]

Class: Services_Weather_Common

Source Location: /Services_Weather-1.3.1/Weather/Common.php

Class Overview


PEAR::Services_Weather_Common


Author(s):

Version:

  • 1.3

Methods


Child classes:

Services_Weather_Globalweather
PEAR::Services_Weather_Globalweather
Services_Weather_Ejse
PEAR::Services_Weather_Ejse
Services_Weather_Weatherdotcom
PEAR::Services_Weather_Weatherdotcom
Services_Weather_Metar
PEAR::Services_Weather_Metar

Inherited Variables

Inherited Methods


Class Details

[line 49]
PEAR::Services_Weather_Common

Parent class for weather-services. Defines common functions for unit conversions, checks for cache enabling and does other miscellaneous things.



[ Top ]


Method Detail

calculateDewPoint   [line 567]

float calculateDewPoint( float $temperature, float $humidity)

Calculate dewpoint from temperature and humidity This is only an approximation, there is no exact formula, this one here is called Magnus-Formula

Temperature has to be entered in deg C!


Parameters:

float   $temperature   — 
float   $humidity   — 

[ Top ]

calculateHumidity   [line 528]

float calculateHumidity( float $temperature, float $dewPoint)

Calculate humidity from temperature and dewpoint This is only an approximation, there is no exact formula, this one here is called Magnus-Formula

Temperature and dewpoint have to be entered in deg C!


Parameters:

float   $temperature   — 
float   $dewPoint   — 

[ Top ]

calculateWindChill   [line 508]

float calculateWindChill( float $temperature, float $speed)

Calculate windchill from temperature and windspeed (enhanced formula)

Temperature has to be entered in deg F, speed in mph!


Parameters:

float   $temperature   — 
float   $speed   — 

[ Top ]

convertDistance   [line 469]

float convertDistance( float $distance, string $from, string $to)

Convert distance between km, ft and sm
  • Access: public

Parameters:

float   $distance   — 
string   $from   — 
string   $to   — 

[ Top ]

convertPressure   [line 429]

float convertPressure( float $pressure, string $from, string $to)

Convert pressure between in, hpa, mb, mm and atm
  • Access: public

Parameters:

float   $pressure   — 
string   $from   — 
string   $to   — 

[ Top ]

convertSpeed   [line 369]

float|int|bool convertSpeed( float $speed, string $from, string $to)

Convert speed between mph, kmh, kt, mps, fps and bft

Function will return "false" when trying to convert from Beaufort, as it is a scale and not a true measurement


Parameters:

float   $speed   — 
string   $from   — 
string   $to   — 

[ Top ]

convertTemperature   [line 337]

float convertTemperature( float $temperature, string $from, string $to)

Convert temperature between f and c
  • Access: public

Parameters:

float   $temperature   — 
string   $from   — 
string   $to   — 

[ Top ]

getUnitsFormat   [line 277]

array getUnitsFormat( [string $unitsFormat = ""])

Returns the selected units format
  • Access: public

Parameters:

string   $unitsFormat   — 

[ Top ]

polar2cartesian   [line 598]

array polar2cartesian( float $latitude, float $longitude)

Convert polar coordinates to cartesian coordinates
  • Access: public

Parameters:

float   $latitude   — 
float   $longitude   — 

[ Top ]

setCache   [line 198]

PEAR_Error|bool setCache( [string $cacheType = "file"], [array $cacheOptions = array()])

Enables caching the data, usage strongly recommended

Requires Cache to be installed

  • Throws: PEAR_Error::SERVICES_WEATHER_ERROR_CACHE_INIT_FAILED
  • Access: public

Parameters:

string   $cacheType   — 
array   $cacheOptions   — 

[ Top ]

setDateTimeFormat   [line 316]

void setDateTimeFormat( [string $dateFormat = ""], [string $timeFormat = ""])

Changes the representation of time and dates (see http://www.php.net/date)
  • Access: public

Parameters:

string   $dateFormat   — 
string   $timeFormat   — 

[ Top ]

setHttpTimeout   [line 261]

void setHttpTimeout( int $httpTimeout)

Sets the timeout in seconds for HTTP requests
  • Access: public

Parameters:

int   $httpTimeout   — 

[ Top ]

setUnitsFormat   [line 225]

void setUnitsFormat( string $unitsFormat, [array $customUnitsFormat = array()])

Changes the representation of the units (standard/metric)
  • Access: public

Parameters:

string   $unitsFormat   — 
array   $customUnitsFormat   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:56:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.