Download the PHP package lase-peco/geocoder without Composer
On this page you can find all versions of the php package lase-peco/geocoder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lase-peco/geocoder
More information about lase-peco/geocoder
Files in lase-peco/geocoder
Package geocoder
Short Description A small geocoder library for laravel.
License MIT
Informations about the package geocoder
geocoder
A small geocoder library for laravel.
Notes
This whole package is depending on the API nominatim.org.
Installation
You can install the package via composer:
Then publish the config file with the following command:
The API from nominatim has a request limit of an absolute maximum of 1 request per second. this is defined in th config file, which you can change at your on risk. you can read about it under operations.osmfoundation.org/policies.
Also in the config file you can define how long should this library cache the results of your searches. The default is one Month.
Usage
With the help of the facade you can call two main functions and .
The search function
You can call the function on the facade and provide it directly with the address.
this kind of search 'Free-form query' process the provided (string) address first left-to-right and then right-to-left if that fails. So you may search for as well as for .
Commas are optional, but improve performance by reducing the complexity of the search.
You can also provide the search function with a part of the address,but the result might not be accurate.
It will return a default json response with the results for the provided address which is accessible as a collection:
Furthermore, you can provide the function with a new object of the class, through which you can construct the address:
This method is preferred to enable the API to find the address better and faster.
The reverse function
With the function you can reverse search the address with the help of its latitude and longitude:
It will return the same default json response which is accessible as a collection.
Further functions
All the following functions are able to be used with the and functions.
withAddressDetails()
If you call the ` on the facade you will get the address detailed:
withExtraTags()
If you call the ` on the facade you will get extra tag for the address:
language()
Call the function on the facade with the language as a parameter to translate the result of the search.
withNameDetails()
Call the function on the facade with the language as a parameter to translate the result of the search.
format()
This package supports the following formats: ,,,,.
Call the function on the facade with the desired format as a parameter.
For the formats and there is two functions that you can call and .
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Ahmed Dabak
- Abdulsalam Emesh
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of geocoder with dependencies
guzzlehttp/guzzle Version ^7.3
illuminate/config Version ^8.0||^9.0
illuminate/support Version ^8.0||^9.0