geocoder-php / yandex-provider
Geocoder Yandex adapter
Installs: 243 681
Dependents: 4
Suggesters: 1
Security: 0
Stars: 7
Watchers: 1
Forks: 1
pkg:composer/geocoder-php/yandex-provider
Requires
- php: ^8.0
- geocoder-php/common-http: ^4.0
- willdurand/geocoder: ^4.0|^5.0
Requires (Dev)
- geocoder-php/provider-integration-tests: ^1.6.3
- php-http/message: ^1.0
- phpunit/phpunit: ^9.5
Provides
README
This is the Yandex provider from the PHP Geocoder. This is a READ ONLY repository. See the main repo for information and documentation.
Install
composer require geocoder-php/yandex-provider
Usage
The API now requires an API key. See here for more information.
$httpClient = new \Http\Discovery\Psr18Client(); $provider = new \Geocoder\Provider\Yandex\Yandex($httpClient, null, '<your-api-key>); $result = $geocoder->geocodeQuery(GeocodeQuery::create('ул.Ленина, 19, Минск 220030, Республика Беларусь')); $result = $geocoder->reverseQuery(ReverseQuery::fromCoordinates(...));
Note
The default language-locale is ru-RU, you can choose between uk-UA, be-BY,
en-US, en-BR and tr-TR.
It's possible to precise the toponym to get more accurate result for reverse geocoding:
house, street, metro, district and locality.
Contribute
Contributions are very welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.