谷歌地图找到它的API没有的位置 [英] Google maps finds locations that its API doesn't
本文介绍了谷歌地图找到它的API没有的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下网址失败:
结果这个程序失败:
#!/ usr / bin / env perl
use strict;
使用警告;
使用Geo :: Coder :: Google;
使用Data :: Dumper;
my $ gcg = Geo :: Coder :: Google-> new(apiver => 3);
my @l = $ gcg-> geocode(location =>'Wisdom Hospice,High Bank,Rochester,Kent,England');
print Data :: Dumper-> new([@ l]) - > Dump();
然而,如果我在谷歌地图上搜索智慧疗养院高银行罗切斯特肯特英国给出这个:
想法?
解决方案
您应该知道地理编码API仅适用于街道地址,任何业务结果都不在范围内。
在您的例子中,'智慧临终关怀'是商业场所。在这种情况下,Places API是正确的API。
您可以执行以下Places API请求来获取此地点:
The following URL fails:
As a result this program fails:
#!/usr/bin/env perl
use strict;
use warnings;
use Geo::Coder::Google;
use Data::Dumper;
my $gcg = Geo::Coder::Google->new(apiver => 3);
my @l = $gcg->geocode(location => 'Wisdom Hospice, High Bank, Rochester, Kent, England');
print Data::Dumper->new([@l])->Dump();
And yet, if I search for "wisdom hospice high bank rochester kent england" at google maps it works giving this:
Thoughts?
解决方案
You should be aware that Geocoding API works only with street addresses, any business results are out of the scope.
In your example 'Wisdom Hospice' is the business place. In such situation Places API is the right API to use.
You can execute the following Places API request to get this place:
这篇关于谷歌地图找到它的API没有的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文