wantell/arcgis-geocode-addresses

此包已被废弃且不再维护。作者建议使用 geocoder-php/arcgis-online-provider 包。

Token 和 ArcGIS 提供商 geocodeAddresses 集成

4.0.2 2020-10-29 18:02 UTC

This package is auto-updated.

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


README

此包是 PHP Geocoder 的 ArcGIS Online 提供商的重新编写。有关信息和文档,请参阅 主仓库

这是如何不同的?

而不是使用 find,它使用 geocodeAddresses 端点。

使用此重写的原因如下

  • find 对于 findAddressCandidates 已弃用
  • ArcGIS World 地理编码服务禁止在不使用有效的 ArcGIS Online Token 的情况下存储结果。
    • 结合 Token,findAddressCandidates 还需要 forStorage 参数,该参数在 ArcGIS Online 提供商包中不可配置。
    • 此包要求您提供 有效的 Token

关于端点的说明

虽然 geocodeAddresses 可以在一次请求中地理编码多个地址(findAddressCandidates 只能在一次请求中地理编码一个位置),但这没有实现,因为 Geocoder 库没有提供向 geocodeQuery 函数发送多个地址的方法。

此包不提供独特的反向查询机制,因此需要依赖 ArcGIS Online 提供商,以便利用该包中的功能。

使用方法

$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'));

安装

composer require wantell/arcgis-geocode-addresses

注意

可以指定一个 sourceCountry 来限制结果仅为此特定国家,从而减少请求时间。