wantell / arcgis-geocode-addresses
4.0.2
2020-10-29 18:02 UTC
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
此包是 PHP Geocoder 的 ArcGIS Online 提供商的重新编写。有关信息和文档,请参阅 主仓库。
这是如何不同的?
而不是使用 find
,它使用 geocodeAddresses
端点。
使用此重写的原因如下
find
对于findAddressCandidates
已弃用- ArcGIS World 地理编码服务禁止在不使用有效的 ArcGIS Online Token 的情况下存储结果。
- 结合 Token,
findAddressCandidates
还需要forStorage
参数,该参数在 ArcGIS Online 提供商包中不可配置。 - 此包要求您提供 有效的 Token
- 结合 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
来限制结果仅为此特定国家,从而减少请求时间。