Download the PHP package maxh/php-nominatim without Composer
On this page you can find all versions of the php package maxh/php-nominatim. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maxh/php-nominatim
More information about maxh/php-nominatim
Files in maxh/php-nominatim
Package php-nominatim
Short Description Wrapper for Nominatim API
License MIT
Homepage https://github.com/maxhelias/php-nominatim
Informations about the package php-nominatim
Wrapper Nominatim API
A simple interface to OSM Nominatim.
See Nominatim documentation for info on the service.
Installation
Install the package through composer:
Make sure, that you include the composer autoloader somewhere in your codebase.
Basic usage
Create a new instance of Nominatim.
Searching by query :
Or break it down by address :
Or do a reverse query :
Or do a lookup query :
Or do a details query (by place_id):
Or do a details query (by osm type and osm id):
By default, the output format of the request is json and the wrapper return a array of results. It can be also xml, but the wrapper return a object SimpleXMLElement
How to override request header ?
There are two possibilities :
-
By
Nominatim
instance, for all request : - By
find
method, for a request : ``
How to customize HTTP client configuration ?
You can inject your own HTTP client with your specific configuration. For instance, you can edit user-agent and timeout for all your requests
Note
This projet was inpired by the Opendi/nominatim project with more features like reverse query, support of the xml format, customize HTTP client and more on which i work.
Recall Usage Policy Nominatim
If you use the service : http://nominatim.openstreetmap.org/, please see Nominatim usage policy.