PHP Class Geocoder\Provider\Nominatim

Author: Niklas Närhinen ([email protected])
Inheritance: extends AbstractHttpProvider, implements Geocoder\Provider\LocaleAwareProvider, use trait Geocoder\Provider\LocaleTrait
显示文件 Open project: willdurand/geocoder Class Usage Examples

Public Methods

Method Description
__construct ( Http\Client\HttpClient $client, string $rootUrl, string $locale = null )
geocode ( $address ) {@inheritDoc}
getName ( ) {@inheritDoc}
reverse ( $latitude, $longitude ) {@inheritDoc}
withOpenStreetMapServer ( Http\Client\HttpClient $client, string | null $locale = null ) : Nominatim

Private Methods

Method Description
executeQuery ( string $query )
getGeocodeEndpointUrl ( )
getNodeValue ( DOMNodeList $element )
getReverseEndpointUrl ( )
xmlResultToArray ( DOMElement $resultNode, DOMElement $addressNode )

Method Details

__construct() public method

public __construct ( Http\Client\HttpClient $client, string $rootUrl, string $locale = null )
$client Http\Client\HttpClient An HTTP adapter.
$rootUrl string Root URL of the nominatim server
$locale string A locale (optional).

geocode() public method

{@inheritDoc}
public geocode ( $address )

getName() public method

{@inheritDoc}
public getName ( )

reverse() public method

{@inheritDoc}
public reverse ( $latitude, $longitude )

withOpenStreetMapServer() public static method

public static withOpenStreetMapServer ( Http\Client\HttpClient $client, string | null $locale = null ) : Nominatim
$client Http\Client\HttpClient
$locale string | null
return Nominatim