CLGeocoder返回其他国家/地区的位置

nin*_*eer 9 objective-c ios clgeocoder

我有以下代码:

CLGeocoder *_geo = [[CLGeocoder alloc] init];
CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter: CLLocationCoordinate2DMake(37.33233141, -122.03121860) radius:100 identifier:@"San Francisco"];
[_geo geocodeAddressString:@"Starbucks" inRegion:region
             completionHandler:^(NSArray *placemarks, NSError *error)
{
    NSLog("%@", placemarks);
}];
Run Code Online (Sandbox Code Playgroud)

即使该中心位于旧金山市中心,这也将返回菲律宾的星巴克位置.

(NSArray *) $3 = 0x07cd9d10 <__NSArrayM 0x7cd9d10>(
Starbuck's, Metro Manila, Quezon City, Republic of the Philippines @ <+14.63617752,+121.03067530> +/- 100.00m, region (identifier <+14.63584900,+121.02951050> radius 166.35) <+14.63584900,+121.02951050> radius 166.35m
)
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

ins*_*r-g 2

虽然这似乎不太可能,但显然 a) Apple 无意对某个地区附近的企业名称进行正向地理编码,或者 b) 这是一个错误。

CLGeocoder参考文献在其概述中指出:

正向地理编码请求采用用户可读的地址并查找相应的纬度和经度值...

这当然意味着一个真实的物理地址作为搜索字符串(特别是“用户可读地址”部分)。但是,文档geocodeAddressString: inRegion: completionHandler:指出搜索字符串是:

...描述您要查找的位置的字符串...

这更加模糊。我尝试通过我的几个项目运行您的代码以及与它非常相似的代码,并且得到相同的结果。甚至 Apple 的 GeocoderDemo 示例也显示了该问题(尽管我住在加利福尼亚州,距您的经纬度示例仅约 150 英里),因此我们肯定没有写过任何内容。

我开始寻求帮助您/与您一起解决这个问题!但是,这一点研究就是我所拥有的一切。祝你好运。