Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Maps\Geocoder Class Reference

Public Member Functions

 __construct ($identifier)
 
 getAliases ()
 
 hasAlias ($alias)
 
 geocode ($address)
 
 hasGlobalCacheSupport ()
 

Static Public Member Functions

static getName ()
 
static getOverrides ()
 

Protected Member Functions

 getRequestUrl ($address)
 
 parseResponse ($response)
 

Static Protected Member Functions

static getXmlElementValue ($xml, $tagName)
 

Protected Attributes

 $aliases
 

Static Protected Attributes

static $name
 

Detailed Description

Base geocoder class to be inherited by classes with a specific geocoding implementation.

Since
0.7

GNU GPL v2+

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Constructor & Destructor Documentation

Maps\Geocoder::__construct (   $identifier)

Constructor.

Since
0.7
Parameters
string$identifier

Member Function Documentation

Maps\Geocoder::geocode (   $address)

Returns an array containing the geocoded latitude (lat) and longitude (lon) of the provided address, or false in case the geocoding fails.

Since
0.2
Parameters
$addressString: the address to be geocoded
Returns
array or false
Maps\Geocoder::getAliases ( )

Returns the geocoders aliases.

Since
0.7
Returns
array
static Maps\Geocoder::getName ( )
static

Returns the geocoders identifier.

Since
0.7
Returns
string
static Maps\Geocoder::getOverrides ( )
static

Returns the mapping service overrides for this geocoder, allowing it to be used instead of the default geocoder when none is provided for certain mapping services.

Returns an empty array by default. Override to add overrides.

Since
0.7
Returns
array
Maps\Geocoder::getRequestUrl (   $address)
abstractprotected

Returns the url to which to make the geocoding request.

Since
0.7
Parameters
string$address
Returns
string
static Maps\Geocoder::getXmlElementValue (   $xml,
  $tagName 
)
staticprotected

Gets the contents of the first XML tag with the provided name, returns false when no matching element is found.

Parameters
string$xml
string$tagName
Returns
string or false
Maps\Geocoder::hasAlias (   $alias)

Returns if the geocoder has a certain alias.

Since
0.7
Parameters
string$alias
Returns
boolean
Maps\Geocoder::hasGlobalCacheSupport ( )

Returns if the global geocoder cache should be used or not. By default it should be, but overriding this function allows for making a geocoder ignore it and implement it's own solution.

Since
0.7
Returns
boolean
Maps\Geocoder::parseResponse (   $response)
abstractprotected

Parses the response and returns it as an array with lat and lon keys.

Since
0.7
Parameters
string$response
Returns
array

Member Data Documentation

Maps\Geocoder::$aliases
protected
Maps\Geocoder::$name
staticprotected

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