Tag: 反向地理编码

使用Geocoder更新属性来获取用户实际地址EXC_BAD_ACCESS

我相对是一个新的iOS开发人员,即时通讯处理地理编码器完成处理程序 ,我不明白如何更新地址parsing器的地址find一个variables,并做一些与它的东西。 总之, 我希望geocoder块在某些方法中完成使用信息 。 – (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"didUpdateToLocation: %@", newLocation); CLLocation *currentLocation = newLocation; if (currentLocation != nil) { longitudeLabel = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.longitude]; latitudeLabel = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.latitude]; } [locationManager stopUpdatingLocation]; // Reverse Geocoding NSLog(@"Resolving the Address"); __block NSString * **annotation**; [geocoder reverseGeocodeLocation:currentLocation completionHandler:^(NSArray *placemarks, NSError *error) { […]

在iPhone中使用地图视图读取当前位置名称

我读取当前位置的经度和纬度值,然后在iPhone中成功locking位置。 现在我想使用这个经度和纬度值来读取地名。 我用下面的代码来读取当前位置: – (void)mapView:(MKMapView *)mapView1 didUpdateUserLocation:(MKUserLocation *)userLocation{ CLLocation *whereIAm = userLocation.location; NSLog(@"I'm at %@", whereIAm.description); latitude = whereIAm.coordinate.latitude; longitude = whereIAm.coordinate.longitude; NSLog(@"LAT : %f",latitude); NSLog(@"LONG : %f",longitude); mapView.mapType=MKMapTypeStandard; [mapView setMapType:MKMapTypeStandard]; [mapView setZoomEnabled:YES]; [mapView setScrollEnabled:YES]; MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } }; region.center.latitude =latitude; //22.569722 ; region.center.longitude = longitude; //88.369722; […]

目标c如何获得给定坐标的地标

我有一个有关反向地理编码的问题。 在我的应用程序中,我有一些坐标(不是我当前的坐标),我想将它们转换为地标。 我挖了很多网站和代码,但他们都是关于当前位置的反向地理编码… 有没有办法获得指定坐标(不是当前位置)的地标? 如果有,请帮我一些代码或参考。

谷歌反向地理编码并不总是返回一个street_address

我正在做一个非常基本的谷歌反向地理编码调用,如: http://maps.googleapis.com/maps/api/geocode/json?latlng=37.785546,-122.406551&sensor=true …最近(我觉得最近这个事情开始了)我没有回到街头地址。 例如,我总是使用这样的东西: { "results": [ { "address_components": … , "formatted_address": "1 Stockton St, San Francisco, CA 94102, USA", "geometry": …, "types": [ "street_address" ] }, … 现在我经常没有得到一个street_address,而是得到这样的最精确的反向地理编码结果: { "results": [ { "address_components": …, "formatted_address": "4th St & Market St, San Francisco, CA 94103, USA", "geometry": …, "types": [ "transit_station" ] }, 我总是想要最近的街道地址。 有谁知道强制谷歌地图API的方式总是返回一个?

在iOS上进行离线反向地理编码

现在有很多关于这个问题的问题,但是我已经看过尽可能多的问题,没有得到答案。 我正在尝试在iOS上执行基于经度和纬度的离线反向地理编码查找。 我希望能够提供一个经纬度,并提供这个点所在的国家。 我可以使用Geonames(例如: http ://api.geonames.org/countryCode?lat=45.03&lng=8.2&username=demo)执行此操作,但是我需要离线执行类似的function,而不需要设备上的Internetfunction。 CLLocation不提供可以为我所做的工作足够可靠的离线服务,它依赖于您以前在线时所做的caching等。凌乱。 我试过这个: https : //github.com/drodriguez/reversegeocoding,但没有任何运气,它需要一些稍微复杂/令人困惑的terminal安装使用我从来没有听说过的Thor的东西,并呕吐各种各样的错误,所以我保释。 我发现了一些可下载的地图,但是这似乎更加复杂,令人担忧的是,数百兆甚至千兆字节的大小 – 远远超出了iOS应用程序的范围。 我只需要国家,没有比这个更小的(城市,街道,地点等),所以我想我应该能够得到一个更小的文件。 所以我的关键问题是:是否有一些预先存在的数据库或工具,最好有iOS支持,我可以提供一个纬度/经度,并获得一个国家? 而且,如果不是,我应该采取什么措施来获得这样的function? 提前致谢。

离线反向地理编码在国家一级

似乎有很多关于这个,但每个人似乎都想要街道级别的数据。 我正在编写一个iOS应用程序,需要为您所在的国家/地区获取国际拨号代码(即将发出) – 所以我需要的是国家。 由于这主要是在国外使用,一个在线解决scheme并不真正起作用! 惠斯特search我发现了梦幻般的openstreetmap.org,但他们的出口function似乎只是提供街道级别,并不会一气呵成走遍全世界! 一旦我有数据,我可能也需要帮助algorithm….但多数民众赞成在以后! 🙂 谢谢 本。

CLGeocoder reverseGeocodeLocation返回“kCLErrorDomain错误9”

我正在根据这篇文章开发一个具有反向地理编码function的iOS应用程序: 地理编码教程 但是,当我在模拟器上这样testing,我得到'kCLErrorDomain错误9'。 我搜查了很多,只有错误0或1不是9。 这是我在viewDidLoad代码: self.locationManager = [[CLLocationManager alloc]init]; self.locationManager.delegate = self; self.locationManager.distanceFilter = 80.0; [self.locationManager startUpdatingLocation]; CLGeocoder *geocoder = [[[CLGeocoder alloc] init] autorelease]; [geocoder reverseGeocodeLocation:self.locationManager.location completionHandler:^(NSArray *placemarks, NSError *error) { NSLog(@"reverseGeocodeLocation:completionHandler: Completion Handler called!"); if (error){ NSLog(@"Geocode failed with error: %@", error); return; } if(placemarks && placemarks.count > 0) { //do something CLPlacemark *topResult […]

从iOS获取反向地理编码当前位置的最简单方法

我在这里看到另一个问题: 确定iPhone用户的国家 ,可以得到iPhone的用户所在的国家 。 这对于许多用途来说相当方便。 然而,是否有可能更深入地从iOS推断出(如果有信息的话)用户所在的州或城市呢? 如果事情不可能,我认为反向地理编码服务将是下一个步骤。是否有甚至可以为您的应用程序聘用的反向地理编码服务?

从iOS的经纬度获取位置名称

我想从经纬度中find当前的位置名称, 这是我尝试的代码片段,但我的日志显示空值除了在placemark , placemark.ISOcountryCode和placemark.country 我想要placemark.locality和placemark.subLocality值,但它显示空值。 – (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // this creates the CCLocationManager that will find your current location locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; [locationManager startUpdatingLocation]; } // this delegate is called when the app successfully finds your current location – (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation […]

在Swift中反转地理编码位置

我的input是一个经纬度。 我需要使用swift的reverseGeocodeLocation函数,给我地方的输出。 我试过的代码是 println(geopoint.longitude) println(geopoint.latitude) var manager : CLLocationManager! var longitude :CLLocationDegrees = geopoint.longitude var latitude :CLLocationDegrees = geopoint.latitude var location: CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, longitude) println(location) CLGeocoder().reverseGeocodeLocation(manager.location, completionHandler: {(placemarks, error) -> Void in println(manager.location) if error != nil { println("Reverse geocoder failed with error" + error.localizedDescription) return } if placemarks.count > 0 { let pm […]