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

Classes

interface  Geocoder
 
class  InMemoryGeocoder
 
class  NominatimGeocoder
 

Static Public Member Functions

static canGeocode ()
 
static getAvailableGeocoders ()
 
static init ()
 
static attemptToGeocode ($coordsOrAddress, $geoService= '', $checkForCoords=true)
 
static geocode ($address, $geoService= '')
 
static registerGeocoder ($geocoderIdentifier, $geocoder)
 

Static Public Attributes

static $registeredGeocoders = []
 

Static Protected Attributes

static $geocoders = []
 
static $canGeocode = false
 

Detailed Description

Class for geocoder functionality of the Maps extension.

FIXME: this is procedural spaghetti

Since
0.4

GNU GPL v2+

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

Member Function Documentation

static Maps\Geocoders::attemptToGeocode (   $coordsOrAddress,
  $geoService = '',
  $checkForCoords = true 
)
static

This function first determines whether the provided string is a pair or coordinates or an address. If it's the later, an attempt to geocode will be made. The function will return the coordinates or false, in case a geocoding attempt was made but failed.

Since
0.7
Parameters
string$coordsOrAddress
string$geoService
boolean$checkForCoords
Returns
LatLongValue|false
static Maps\Geocoders::canGeocode ( )
static

Returns if this class can do geocoding operations. Ie. if there are any geocoders available.

Since
0.7
Returns
boolean
static Maps\Geocoders::geocode (   $address,
  $geoService = '' 
)
static

Geocodes an address with the provided geocoding service and returns the result as an array, or false when the geocoding failed.

Since
0.7
Parameters
string$address
string$geoService
Returns
LatLongValue|false
Exceptions
MWException
static Maps\Geocoders::getAvailableGeocoders ( )
static

Gets a list of available geocoders.

Since
1.0.3
Returns
array
static Maps\Geocoders::init ( )
static

Initiate the geocoding functionality.

Since
1.0.3
Returns
boolean Indicates if init happened
static Maps\Geocoders::registerGeocoder (   $geocoderIdentifier,
  $geocoder 
)
static

Registers a geocoder linked to an identifier.

Since
0.7
Parameters
string$geocoderIdentifier
string | \Maps\Geocoders\Geocoder$geocoder

Member Data Documentation

Maps\Geocoders::$canGeocode = false
staticprotected
Maps\Geocoders::$geocoders = []
staticprotected
Maps\Geocoders::$registeredGeocoders = []
static

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