SMWDIGeoCoord Class Reference

Inherits SMWDataItem.

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 getDIType ()
 (non-PHPdoc)
 getCoordinateSet ()
 Returns the coordinate set as an array with lat and long (and alt) keys pointing to float values.
 getSortKey ()
 (non-PHPdoc)
 getSerialization ()
 (non-PHPdoc)
 getLatitude ()
 Returns the latitude.
 getLongitude ()
 Returns the longitude.
 getAltitude ()
 Returns the altitude if set, null otherwise.

Static Public Member Functions

static doUnserialize ($serialization)
 Create a data item from the provided serialization string and type ID.

Protected Attributes

 $latitude
 $longitude
 $altitude = null


Detailed Description

Definition at line 14 of file SMW_DI_GeoCoord.php.


Constructor & Destructor Documentation

SMWDIGeoCoord::__construct (  ) 

Constructor.

Takes a latitude and longitude, and optionally an altitude. These can be provided in 2 forms: * An associative array with lat, lon and alt keys * Lat, lon and alt arguments

The second way to provide the arguments, as well as the altitude argument, where introduced in SMW 1.7.

Definition at line 48 of file SMW_DI_GeoCoord.php.


Member Function Documentation

SMWDIGeoCoord::getDIType (  ) 

(non-PHPdoc)

See also:
SMWDataItem::getDIType()

Reimplemented from SMWDataItem.

Definition at line 83 of file SMW_DI_GeoCoord.php.

References SMWDataItem::TYPE_GEO.

SMWDIGeoCoord::getCoordinateSet (  ) 

Returns the coordinate set as an array with lat and long (and alt) keys pointing to float values.

Since:
1.6
Returns:
array

Definition at line 95 of file SMW_DI_GeoCoord.php.

Referenced by getSerialization().

SMWDIGeoCoord::getSortKey (  ) 

(non-PHPdoc)

See also:
SMWDataItem::getSortKey()

Reimplemented from SMWDataItem.

Definition at line 109 of file SMW_DI_GeoCoord.php.

SMWDIGeoCoord::getSerialization (  ) 

(non-PHPdoc)

See also:
SMWDataItem::getSerialization()

Reimplemented from SMWDataItem.

Definition at line 118 of file SMW_DI_GeoCoord.php.

References getCoordinateSet().

static SMWDIGeoCoord::doUnserialize ( serialization  )  [static]

Create a data item from the provided serialization string and type ID.

Note:
PHP can convert any string to some number, so we do not do validation here (because this would require less efficient parsing).
Since:
1.6
Parameters:
string $serialization
Returns:
SMWDIGeoCoord

Definition at line 134 of file SMW_DI_GeoCoord.php.

SMWDIGeoCoord::getLatitude (  ) 

Returns the latitude.

Since:
1.6
Returns:
float

Definition at line 158 of file SMW_DI_GeoCoord.php.

SMWDIGeoCoord::getLongitude (  ) 

Returns the longitude.

Since:
1.6
Returns:
float

Definition at line 169 of file SMW_DI_GeoCoord.php.

SMWDIGeoCoord::getAltitude (  ) 

Returns the altitude if set, null otherwise.

Since:
1.7
Returns:
float|null

Definition at line 180 of file SMW_DI_GeoCoord.php.


Member Data Documentation

SMWDIGeoCoord::$latitude [protected]

Definition at line 22 of file SMW_DI_GeoCoord.php.

SMWDIGeoCoord::$longitude [protected]

Definition at line 30 of file SMW_DI_GeoCoord.php.

SMWDIGeoCoord::$altitude = null [protected]

Definition at line 38 of file SMW_DI_GeoCoord.php.


The documentation for this class was generated from the following file:

Generated on Sun Mar 18 07:15:43 2012 for Semantic MediaWiki by  doxygen 1.5.6