wantell/arcgis-geocode-addresses

This package is abandoned and no longer maintained. The author suggests using the geocoder-php/arcgis-online-provider package instead.

Token and geocodeAddresses integration for ArcGIS provider

4.0.2 2020-10-29 18:02 UTC

This package is auto-updated.

Last update: 2020-11-03 15:53:58 UTC


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 for findAddressCandidates
  • 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 the forStorage parameter, which is not configurable in the ArcGIS Online provider package.
    • This package requires that you provide a valid 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.