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

Class: Services_OpenStreetMap_Nominatim

Source Location: /Services_OpenStreetMap-1.0.0RC2/Services/OpenStreetMap/Nominatim.php

Class Overview


Services_OpenStreetMap_Nominatim


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 26]
Services_OpenStreetMap_Nominatim


[ Top ]


Class Variables

$accept_language =  'en'

[line 57]

Preferred language order. Standard rfc2616 string or a simple comma separated list of language codes.
  • Access: protected

Type:   string


[ Top ]

$addressdetails =  0

[line 49]

If 1, include a breakdown of the address into elements.
  • Access: protected

Type:   int


[ Top ]

$bounded =

[line 87]

If true, restrict results to those within the bounding box/view box.
  • Access: protected

Type:   null|boolean


[ Top ]

$countryCodes =

[line 108]

CSVs of valid country codes to restrict search to.
  • Access: protected

Type:   string|null


[ Top ]

$dedupe =

[line 94]

Remove duplicates?
  • Access: protected

Type:   null|boolean


[ Top ]

$email_address =

[line 65]

Email address to be sent as a part of the query string, recommended to be set if sending large numbers of requests/searches.
  • Access: protected

Type:   string


[ Top ]

$format =  'xml'

[line 42]

Format to perform queries in (xml|json|html). Defaults to 'xml'
  • Access: protected

Type:   string


[ Top ]

$limit =

[line 101]

Maximum number of entries to retrieve.
  • Access: protected

Type:   int


[ Top ]

$polygon =

[line 72]

Output polygon outlines for items found.
  • Access: protected

Type:   null|boolean


[ Top ]

$server =  'https://nominatim.openstreetmap.org/'

[line 35]

The server to connect to
  • Access: protected

Type:   string


[ Top ]

$transport =

[line 115]

The transport to use
  • Access: protected



[ Top ]

$viewbox =

[line 80]

The preferred area to find search results <left>,<top>,<right>,<bottom>
  • Access: protected

Type:   null|string


[ Top ]



Method Detail

__construct (Constructor)   [line 124]

Services_OpenStreetMap_Nominatim __construct( Services_OpenStreetMap_Transport $transport)

Constructor
  • Access: public

Parameters:

Services_OpenStreetMap_Transport   $transport   —  Transport instance.

[ Top ]

getAddressdetails   [line 446]

int getAddressdetails( )

Retrieve addressdetails setting.
  • Access: public

[ Top ]

getEmailAddress   [line 436]

string|null getEmailAddress( )

Retrieve set email address.

From OSM documentation: If you are making large numbers of request please include a valid email address or alternatively include your email address as part of the User-Agent string. This information will be kept confidential and only used to contact you in the event of a problem, see Usage Policy for more details.

  • Access: public

[ Top ]

getFormat   [line 274]

string getFormat( )

Get which format is set for this instance (xml, json, html)
  • Access: public

[ Top ]

getLimit   [line 297]

integer getLimit( )

Get Limit
  • Access: public

[ Top ]

getServer   [line 387]

string getServer( )

Retrieve server endpoint.
  • Access: public

[ Top ]

getTransport   [line 321]

Services_OpenStreetMap_Transport getTransport( )

Get current Transport object.
  • Access: public

[ Top ]

reverseGeocode   [line 175]

object|string reverseGeocode( string $lat, string $lon, [int $addressdetails = 1], [int $zoom = 18])

Reverse geocode a lat/lon pair.

Perform a reverse search/geoencoding.


Parameters:

string   $lat   —  Latitude
string   $lon   —  Longitude
int   $addressdetails   —  Include address details, defaults to 1.
int   $zoom   —  Zoom level, defaults to 18.

[ Top ]

search   [line 220]

mixed search( string $place, [int $limit = null])

Search
  • Access: public

Parameters:

string   $place   —  Name of place to geocode
integer   $limit   —  Maximum number of results to retrieve (optional)

[ Top ]

setAcceptLanguage   [line 375]

Services_OpenStreetMap_Nominatim setAcceptLanguage( string $language)

Set referred language order for showing search results.

This overrides the browser value. Either uses standard rfc2616 accept-language string or a simple comma separated list of language codes.

  • Access: public

Parameters:

string   $language   —  language code

[ Top ]

setAddressdetails   [line 458]

Services_OpenStreetMap_Nominatim setAddressdetails( int $addressdetails)

Signal that addressdetails are to be broken down into elements.
  • Access: public

Parameters:

int   $addressdetails   —  Whether to get address details as elements.

[ Top ]

setCountryCodes   [line 418]

Services_OpenStreetMap_Nominatim setCountryCodes( string $codes)

Set country codes to limit search results to.
  • Access: public

Parameters:

string   $codes   —  CSV list of country codes.

[ Top ]

setEmailAddress   [line 400]

Services_OpenStreetMap_Nominatim setEmailAddress( string $email)

Set email address.
  • Throws: Services_OpenStreetMap_RuntimeException If email address invalid
  • Access: public

Parameters:

string   $email   —  Valid email address

[ Top ]

setFormat   [line 252]

Services_OpenStreetMap_Nominatim setFormat( string $format)

Set format for data to be received in.

Format may be one of: html, json, jsonv2, xml

  • Throws: Services_OpenStreetMap_RuntimeException If the specified format is not supported.
  • Access: public

Parameters:

string   $format   —  Format for data.

[ Top ]

setLimit   [line 286]

Services_OpenStreetMap_Nominatim setLimit( int $limit)

Set limit of entries to retrieve.
  • Access: public

Parameters:

integer   $limit   —  Maximum number of entries to retrieve

[ Top ]

setServer   [line 337]

Services_OpenStreetMap_Nominatim setServer( string $server)

Set which server to connect to.

Possible values are 'nominatim', 'mapquest' and any other valid endpoint specified as an URL.

  • Throws: Services_OpenStreetMap_RuntimeException
  • Access: public

Parameters:

string   $server   —  Server URL or shorthand (nominatim / mapquest)

[ Top ]

setTransport   [line 309]

Services_OpenStreetMap_Nominatim setTransport( Services_OpenStreetMap_Transport $transport)

Set Transport object.
  • Access: public

Parameters:

Services_OpenStreetMap_Transport   $transport   —  transport object

[ Top ]


Documentation generated on Tue, 28 May 2019 19:19:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.