geo6 / geocoder-php-bpost-provider
Geocoder bpost adapter
Installs: 67 234
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 2
Requires
- php: ^7.4 || ^8.0
- geocoder-php/common-http: ^4.1
- willdurand/geocoder: ^4.0
Requires (Dev)
- geocoder-php/provider-integration-tests: ^1.0
- php-http/curl-client: ^2.0
- php-http/message: ^1.0
- phpunit/phpunit: ^9.5
Provides
README
Geocoder PHP is a PHP library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations.
This is the "bpost" provider for the Geocoder PHP.
Coverage: Belgium
API: https://www.bpost.be/site/en/webservice-address
Install
composer require geo6/geocoder-php-bpost-provider
Usage
use Geocoder\Query\GeocodeQuery; $httpClient = new \Http\Adapter\Guzzle6\Client(); $provider = new \Geocoder\Provider\bpost\bpost($httpClient); $geocoder = new \Geocoder\StatefulGeocoder($provider, 'en'); // Query with unstructured address $result = $geocoder->geocodeQuery(GeocodeQuery::create('5 Place des Palais 1000 Bruxelles')); // Query with structured address $query = GeocodeQuery::create('5 Place des Palais 1000 Bruxelles') ->withData('streetNumber', '5') ->withData('streetName', 'Place des Palais') ->withData('postalCode', '1000') ->withData('locality', 'Bruxelles'); $results = $geocoder->geocodeQuery($query);