Google地理编码API无法找到地点API返回的地址 [英] Google geocode API can't find address returned by the place API

查看:172
本文介绍了Google地理编码API无法找到地点API返回的地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过Google地理编码api来识别地址:

The Squaire 12

Am Flughafen

60549美因河畔法兰克福

德国



Squaire是法兰克福机场的一座建筑。它似乎没有正常的街道地址,但在The Squaire中的一些企业的地址类似The Squaire NUMBER。例如:



但无论我做什么,我都无法获取Google地理编码API所识别的地址在:





令人生气的是,当我在机场附近搜索squaire时,places API找到了我要找的地方: p>

https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=XYZ&location=50.0509194,8.5684084&radius=1000&keyword = squaire



匹配结果为: place_id:ChIJY9ZMLL4KvUcRxZhQ3e-7ask 。当我查询详情端点时:



https://maps.googleapis.com/maps/api/place/details/json?key=XYZ&placeid=ChIJY9ZMLL4KvUcRxZhQ3e-7ask



我得到 formatted_address:The Squaire 12,Am Flughafen,60549 Frankfurt am Main,Germany,但这正是地址这在geocode api中不起作用。



当我使用带有place_id的反向地理编码api时:



https://maps.googleapis。 com / maps / api / geocode / json?key = XYZ& place_id = ChIJY9ZMLL4KvUcRxZhQ3e-7ask
$ b formatted_address:plug并在德国法兰克福60549 Am Flughafen,The Squaire 12,法兰克福SQUAIRE会议中心工作。这仍然不能在前进的地理编码api中工作:

https://maps.googleapis.com/maps/api/geocode/json?address=plug%20and%20work%20Frankfurt,%20THE%20SQUAIRE%20Conference%20Center,%20THE%20Squaire%2012,%20Am%20Flughafen,% 2060549%20Frankfurt%20am%20Main,%20Germany

解决方案

这是Geocoding API中的一个问题: Issue 11031



它已在1月下旬修复,因此Geocoding API将始终返回与Google地图相同的结果。





<这实际上是 Issue 11031的副作用已修复,并且与Geocoding API的原始行为背离。 xomena的回答在他回答时是有效的,Google Maps API文档的官方建议的确使用Places API Text Search。这种情况时间更长,因为如果您重新阅读新转发Geocoder常见问题


I can't get google's geocode api to recognize the address:

The Squaire 12
Am Flughafen
60549 Frankfurt am Main
Germany

The Squaire is a building at the airport in Frankfurt. It doesn't appear to have a normal street address, but a number of businesses in The Squaire have addresses like "The Squaire NUMBER". For example:

But no matter what I do, I can't get addresses like that recognized by the google geocode api at:

The maddening thing is that the places API finds the place I'm looking for when I search for "squaire" near the airport:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=XYZ&location=50.0509194,8.5684084&radius=1000&keyword=squaire

The matching result has: place_id: ChIJY9ZMLL4KvUcRxZhQ3e-7ask. When I query the details endpoint:

https://maps.googleapis.com/maps/api/place/details/json?key=XYZ&placeid=ChIJY9ZMLL4KvUcRxZhQ3e-7ask

I get formatted_address: "THE Squaire 12, Am Flughafen, 60549 Frankfurt am Main, Germany", but that's exactly the address that won't work in the geocode api.

And when I use the reverse geocode api with the place_id:

https://maps.googleapis.com/maps/api/geocode/json?key=XYZ&place_id=ChIJY9ZMLL4KvUcRxZhQ3e-7ask

I get formatted_address: "plug and work Frankfurt, THE SQUAIRE Conference Center, THE Squaire 12, Am Flughafen, 60549 Frankfurt am Main, Germany". Which still doesn't work in the forward geocode api:

https://maps.googleapis.com/maps/api/geocode/json?address=plug%20and%20work%20Frankfurt,%20THE%20SQUAIRE%20Conference%20Center,%20THE%20Squaire%2012,%20Am%20Flughafen,%2060549%20Frankfurt%20am%20Main,%20Germany

解决方案

This was an issue in the Geocoding API: Issue 11031.

It has been fixed in late January, so that Geocoding API will always return the same result/s as Google Maps:

This is actually a side effect of how Issue 11031 was fixed, and is a departure from the original behavior of the Geocoding API. xomena's answer was valid at the time he answered, the official recommendation from the Google Maps API documentation was indeed to use Places API Text Search. This is on longer the case, as you'll notice if you re-read the New Forward Geocoder FAQ.

这篇关于Google地理编码API无法找到地点API返回的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆