demollc/sputnik-provider

Geocoder Sputnik adapter

v1.0.1 2021-05-10 14:28 UTC

This package is auto-updated.

Last update: 2021-06-16 20:20:54 UTC


README

Latest Stable Version Total Downloads Software License

This is the Sputnik provider from DemoLLC.

Install

composer require demollc/sputnik-provider

Usage

The API may require an API key. See here for more information.

use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
$httpClient = new \Http\Adapter\Guzzle7\Client();
$geocoder = new \Geocoder\Provider\Sputnik\Sputnik($httpClient, null, '<your-api-key>');

$result = $geocoder->geocodeQuery(GeocodeQuery::create('ул. Генерала Лизюкова, 4, Воронеж'));
$result = $geocoder->reverseQuery(ReverseQuery::fromCoordinates(...));

Note

Reverse Query endpoint is frequently down and methods are created by manual.

Contribute

Contributions are very welcome!