wantell / arcgis-geocode-addresses
Token and geocodeAddresses integration for ArcGIS provider
Requires
- php: ^7.2
- geocoder-php/arcgis-online-provider: ^4.1
- geocoder-php/common-http: ^4.0
- willdurand/geocoder: ^4.0
Requires (Dev)
- geocoder-php/provider-integration-tests: ^1.0
- php-http/curl-client: ^1.7
- php-http/message: ^1.0
- phpunit/phpunit: ^7.5
Provides
README
This package is a rewrite of the ArcGIS Online provider for PHP Geocoder. See the main repo for information and documentation.
How is this different?
Instead of find
this uses the geocodeAddresses
endpoint.
The reason for using this rewrite are as follows:
find
is deprecated forfindAddressCandidates
- ArcGIS World Geocoding Service prohibits storing the results without the use
of a valid ArcGIS Online token.
- In conjunction with the token,
findAddressCandidates
also requires theforStorage
parameter, which is not configurable in the ArcGIS Online provider package. - This package requires that you provide a valid token
- In conjunction with the token,
Note on endpoints
While geocodeAddresses
can geocode multiple addresses per request
(findAddressCandidates
only geocodes one location per request) this is not
implemented as the Geocoder library
does not provide a means of sending multiple addresses to the geocodeQuery
function.
This package does not provide a unique reverseQuery mechanism, so a composer dependency exists on ArcGIS Online provider in order to leverage the function in that package.
Usage
$httpClient = new \Http\Adapter\Guzzle6\Client(); // You must provide a token. $provider = new \Geocoder\Provider\ArcGISList\ArcGISList::token($httpClient, 'your-token'); $result = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'));
Install
composer require wantell/arcgis-geocode-addresses
Note
It is possible to specify a sourceCountry
to restrict results to this specific
country thus reducing request time.