ios - 是否有可能获得更精确的反向地理编码?

标签 ios swift geolocation geocoding

我发现一些反向地理编码方法比其他方法效果更好,因此我选择了当前方法。

 func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {

    locationManager.stopUpdatingLocation()

    if(locations.count > 0){

        let location = locations[0] as! CLLocation

        println(location.coordinate)

        currLocation = location.coordinate


        CLGeocoder().reverseGeocodeLocation(location, completionHandler: {(placemarks, error) -> Void in
            println(location)

            if error != nil {
                println("Reverse geocoder failed with error" + error.localizedDescription)
                return
            }

            if placemarks.count > 0 {
                let pm = placemarks[0] as! CLPlacemark
                self.lbutton.text="\(pm.locality)"
            }
            else {
                println("Problem with the data received from geocoder")
            }
        })



    } else {

        alert("Cannot fetch your location")

    }


}

就像一个魅力一样,不会失败(但是有时位置更新需要几分钟,但这很公平),但是,我很好奇是否有可能让它精确定位城镇,而不仅仅是整个州?例如,它会说 Bushwick 而不仅仅是 New York?

我知道最近反向地理编码获取数据的方式发生了变化,但我想我应该问一些更熟悉这个主题的人。

最佳答案

关于ios - 是否有可能获得更精确的反向地理编码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31763880/

相关文章:

http - 生成组织 IP 地址范围数据

后台服务中的 Android Geo Location 总是报告相同的经纬度?

html - 动态调整html textarea的属性?

IOS 从以编程方式制作的标签和步进器中减去

ios - 日期(timeIntervalSince1970 :) returns 2 different results

ios - swift:以编程方式创建 UILabel 固定宽度,根据文本长度垂直调整大小

android - Geopoint Long 和 Lat 表示为 int,但 MediaStore 中的 Long 和 Lat 字段表示为 doubles?

ios - 从 firebase 检索到 swift 3 中的多个按钮

ios - xcode 核心数据类中的数据类型不匹配

ios - 使用 UIImage 滚动时 TableView 单元格滞后