【问题标题】:Google Reverse Geocode Multiple Coordinates with one API call?谷歌通过一个 API 调用反向地理编码多个坐标?
【发布时间】:2018-10-12 05:36:28
【问题描述】:

我读过这个反向地理编码查找:

https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY

在这里找到:https://developers.google.com/maps/documentation/geocoding/intro 一次只能使用一组坐标。

Google 是否有允许对反向地理编码查找进行批处理的解决方案或 API?

如果 Google 不提供此功能,是否有可比较的第三方选项?

我有数千个坐标要在很短的时间内解析,这些坐标无法缓存在本地数据库中,我不希望我的应用程序发出那么多 HTTP 请求或达到谷歌在查找一个时施加的任何查询限制一个时间点。

【问题讨论】:

标签: google-maps google-api


【解决方案1】:

Michael P. Bazos 留下的评论让我找到了最好的解决方案,HERE Batch Reverse Geocoding。这是他们文档中提供的示例:

curl \
  -X POST \
  -H 'Content-Type: *' \
  -d 'recId|prox
0001|52.505308,13.327739,250
0002|49.917257,8.486488,250
0003|51.119593,7.399356,250
0004|49.20012,8.12326,250
0005|51.116845,7.397318,250
0006|52.265938,7.976922,250
0007|48.143131,10.829233,250
0008|51.770237,7.442682,250
0009|51.511877,7.461382,250
0010|52.53,13.391389,250' \
  'http://batch.geocoder.api.here.com/6.2/jobs?gen=8&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ&action=run&mailto=%3Cmy_email%3E&header=true&indelim=%7C&outdelim=%7C&outcols=displayLatitude%2CdisplayLongitude%2ClocationLabel%2ChouseNumber%2Cstreet%2Cdistrict%2Ccity%2CpostalCode%2Ccounty%2Cstate%2Ccountry&outputCombined=false&mode=retrieveAddresses'

由于 Google 本身不提供类似服务,因此这是最佳解决方案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-29
    • 2015-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-30
    • 1970-01-01
    相关资源
    最近更新 更多