7.7 Converting Meaningful Addresses to Longitude and Latitude
来源:互联网 发布:软件可靠性分配付 编辑:程序博客网 时间:2024/04/29 21:46
通过地址获取经纬度
- (void)viewDidLoad
{
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// NSString *oreillyAddress = @"1005 Gravenstein Highway North, Sebastopol, CA 95472, USA";
NSString *oreillyAddress = @"北京";
self.myGeocoder = [[CLGeocoderalloc] init];
[self.myGeocodergeocodeAddressString:oreillyAddress completionHandler:^(NSArray *placemarks,NSError *error)
{
if ([placemarks count] >0 && error == nil){
NSLog(@"Found %lu placemark(s).", (unsignedlong)[placemarks count]);
CLPlacemark *firstPlacemark = [placemarks objectAtIndex:0];
NSLog(@"Longitude = %f", firstPlacemark.location.coordinate.longitude);
NSLog(@"Latitude = %f", firstPlacemark.location.coordinate.latitude);
}
else if ([placemarkscount] == 0 && error ==nil){
NSLog(@"Found no placemarks.");
}
else if (error !=nil){
NSLog(@"An error occurred = %@", error);
}
}];
}
输出:
2014-04-08 13:53:28.415 cookbook[504:c07] Found 1 placemark(s).
2014-04-08 13:53:28.416 cookbook[504:c07] Longitude = 116.405285
2014-04-08 13:53:28.416 cookbook[504:c07] Latitude = 39.904989
- 7.7 Converting Meaningful Addresses to Longitude and Latitude
- 7.8 Converting Longitude and Latitude to a Meaningful Address
- Latitude And Longitude
- Calculate distance based on GPS data (latitude and longitude)
- Calculate distance, bearing and more between Latitude/Longitude points
- Latitude, Longitude, PHP and the Yahoo Geocoder PHP 通过 Yahoo Geocoder 获得地理经纬度
- GPS经纬度和距离计算Calculate distance, bearing and more between Latitude/Longitude points
- Google Map,Baidu Map,latitude,longitude
- Calculate distance, bearing and more between Latitude/Longitude points——根据两点经纬度计算距离,角度及其他
- 用windbg实现虚拟地址到物理地址转换(Converting Virtual Addresses to Physical Addresses)
- Converting numbers to strings and strings to numbers
- Converting numbers to strings and strings to numbers
- Finding Points Within a Distance of a Latitude/Longitude Using Bounding Coordinates
- portable Executable: Converting RVA to File Offset and Back
- How to get meaningful backtraces in Gentoo
- Converting and transferring data
- Converting DIB to DDB
- Converting DDB to DIB
- 也太多天惹他认识人员投入推移
- Android providers 解析之telephony
- 大学生求职中应该清楚的心里障碍
- 第七周——深复制体验
- java多态理解
- 7.7 Converting Meaningful Addresses to Longitude and Latitude
- 高性能JAVA代码之_内存管理
- 成员函数、友元函数和一般函数
- php从mysql数据库中取出数据后生成xls文件
- Dubbo入门实例
- 微软:我们正在人工智能的春天
- 项目1-深复制体验
- Oracle学习笔记 2 --简单查询语句(select)
- 【PHP内核学习】SAPI