标签: reverse-geocoding

如何从谷歌地图中的纬度和经度坐标获取城市名称?

如果我有城镇或地区的纬度和经度坐标,我如何在Google地图中获取城市名称?

我尝试使用纬度,经度和我有国家,但我不知道如何获得城市名称.

android google-maps reverse-geocoding

118
推荐指数
5
解决办法
16万
查看次数

没有谷歌如何反转地理编码?

除了谷歌地图API之外,是否有任何网络服务(付费或免费)允许您反转地理编码?

我的特定应用程序将可以访问经度和纬度,我需要能够获得美国邮政编码或州.

我无法使用Google的原因是,服务条款似乎表明,如果您使用Google Maps API,则需要使用这些数据来显示Google地图.

我正在使用C#.Net框架,以防相关.

reverse-geocoding

51
推荐指数
5
解决办法
5万
查看次数

Android:反向地理编码 - getFromLocation

我想基于long/lat得到一个地址.似乎这样的事情应该有效吗?

Geocoder myLocation = Geocoder(Locale.getDefault());
    List myList = myLocation.getFromLocation(latPoint,lngPoint,1);
Run Code Online (Sandbox Code Playgroud)

问题是我不断得到:方法Geocoder(Locale)未定义类型savemaplocation

任何帮助都会有所帮助.谢谢.


谢谢,我尝试了上下文,首先是locale,然后失败并且正在查看其他一些构造函数(我曾经看过一个只提到locale).而不管,

它没有用,因为我仍然得到:方法Geocoder(Context,Locale)未定义类型savemaplocation

我有:import android.location.Geocoder;

android reverse-geocoding street-address

50
推荐指数
5
解决办法
12万
查看次数

使用OpenStreetMap反转地理位置

我在我正在进行的网站中使用了OpenStreetMap.我用PHP开发了网站.我的要求是根据地理位置(纬度和经度)获取地址.是否有任何OpenStreetMap API可用于获取基于Lat/Lon的位置信息?

谢谢,Vishal Parmar

openstreetmap reverse-geocoding

43
推荐指数
1
解决办法
4万
查看次数

地理编码IP地址?

有没有人知道我可以调用任何开放的RESTful API来将用户的IP地理编码为纬度和经度?

理想情况下,它将类似于:http://google.com/geocode_api/? IP = 1.2.3.4,它将返回纬度和经度.

geocoding ip-address reverse-geocoding

31
推荐指数
4
解决办法
5万
查看次数

确定iPhone用户的国家/地区

对于iPhone应用程序,我需要在启动时确定用户所在的国家/地区.据推测,我将不得不打开位置服务并进行某种反向地理编码.如果可能的话,我真的不想使用第三方网络服务,是否有任何其他建议来确定服务提供的位置?

最初,我只需要检查用户是否在美国境内,但是将来可能会更改以添加更多国家/地区.我知道无法始终确定位置或用户可能已关闭位置服务.基本上,我只需要知道用户是否被检测到是在美国境内,以便关闭特定功能.

编辑:进一步阅读,它看起来像MKReverseGeocoder,除了我不希望在我的应用程序中显示任何地图,这意味着我不允许使用它.

iphone geolocation reverse-geocoding

26
推荐指数
3
解决办法
2万
查看次数

如何从reverseGeocodeCoordinate获得国家,州,城市?

GMSReverseGeocodeResponse 包含

- (GMSReverseGeocodeResult *)firstResult;
Run Code Online (Sandbox Code Playgroud)

其定义如下:

@interface GMSReverseGeocodeResult : NSObject<NSCopying>

/** Returns the first line of the address. */
- (NSString *)addressLine1;

/** Returns the second line of the address. */
- (NSString *)addressLine2;

@end
Run Code Online (Sandbox Code Playgroud)

有没有办法从这两个字符串中获取国家,ISO国家代码,州(administrative_area_1或相应的一个)(对所有国家所有地址都有效)?

注意:我试图执行这段代码

[[GMSGeocoder geocoder] reverseGeocodeCoordinate:CLLocationCoordinate2DMake(40.4375, -3.6818) completionHandler:^(GMSReverseGeocodeResponse *resp, NSError *error)
 {
    NSLog( @"Error is %@", error) ;
    NSLog( @"%@" , resp.firstResult.addressLine1 ) ;
    NSLog( @"%@" , resp.firstResult.addressLine2 ) ;
 } ] ;
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,处理程序从未被调用过.我确实添加了应用密钥,并且还将iOS捆绑包ID添加到了应用密钥.控制台中未打印错误.有了这个,我的意思是我不知道线条的内容.

reverse-geocoding ios google-maps-sdk-ios

24
推荐指数
2
解决办法
3万
查看次数

Swift中的反向地理编码位置

我的输入是纬度和经度.我需要使用reverseGeocodeLocationswift 的功能,给我一个本地的输出.我尝试使用的代码是

            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 = placemarks[0] as CLPlacemark


                    println(pm.locality)
                }


                else {
                    println("Problem with the data received from geocoder")
                }
Run Code Online (Sandbox Code Playgroud)

在我得到的日志中

//-122.0312186
//37.33233141
//C.CLLocationCoordinate2D
//fatal error: unexpectedly found …
Run Code Online (Sandbox Code Playgroud)

reverse-geocoding cllocationmanager ios swift

24
推荐指数
1
解决办法
4万
查看次数

Swift - 从反向地理编码生成地址格式

我试图使用Swift 3中的CLGeocoder生成格式化的完整地址.我引用了这个SO线程来获取下面给出的代码.

但是,有时应用程序崩溃时会出现"nil"错误:

//Address dictionary
print(placeMark.addressDictionary ?? "")
Run Code Online (Sandbox Code Playgroud)

问题:

  1. 如何连接从GeoCoder检索到的这些值以形成完整地址?(街+城+等)
  2. 当func无法找到地址时,如何处理我得到的nil错误?

完整代码:

func getAddress() -> String {
        var address: String = ""

        let geoCoder = CLGeocoder()
        let location = CLLocation(latitude: selectedLat, longitude: selectedLon)
        //selectedLat and selectedLon are double values set by the app in a previous process

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

            // Place details
            var placeMark: CLPlacemark!
            placeMark = placemarks?[0]

            // Address dictionary
            //print(placeMark.addressDictionary ?? "")

            // Location name
            if let locationName = placeMark.addressDictionary!["Name"] …
Run Code Online (Sandbox Code Playgroud)

xcode google-maps reverse-geocoding ios swift

20
推荐指数
4
解决办法
4万
查看次数

GPS坐标的国家名称

是否有一种简单的方法可以获得特定点所在国家/地区的名称?

我不太关心准确性,也不关心政治争议带来的模棱两可.只需要一个足够好的近似值.

gis geolocation reverse-geocoding

18
推荐指数
3
解决办法
2万
查看次数