所以我制作了一个访问用户位置的应用程序,然后像这样使用Geocoder对其进行解释(反向地理编码):Geocodergc=newGeocoder(ctx,Locale.getDefault());Listaddresses=gc.getFromLocation(latitude,longitude,maxResults);Addressaddress=addresses.get(0);town=address.getLocality();countryCd=address.getCountryCode();但是我发现地理编码器服务确实不可靠,因为IOException和服务经常不可用。
我正在以相反的方式使用Geocoder从给定的纬度和经度获取地址。你知道如何从Address只获取街道名称吗?Geocodergeocoder=newGeocoder(AutoFinderMapActivity.this);try{ListaddressList=geocoder.getFromLocation(latitude,longitude,1);if(addressList!=null&&addressList.size()>0){//HelpheretogetonlythestreetnameStringadress=addressList.get(0).get...;}}
到目前为止,我已经搜索了很多,但运气不佳。AndroidGeocoder返回android.location.Address对象。据我了解,城市应该在getLocality()中返回。这似乎在美国国内运作良好,但在国外则不然。我正在编写一个国际应用程序,并努力寻找一种解决方案来找出地理位置所在的城市。这里是捷克共和国/布拉格的输出:Address[addressLines=[0:"Psohlavců1764/2",1:"14700Prague-Prague4",2:"CzechRepublic"],feature=2,admin=HlavníměstoPraha,sub-admin=P
我能够获取经度和纬度,但获取地址时出现错误。publicbooleanonTouchEvent(MotionEvent事件,MapViewmapView){if(event.getAction()==0){GeoPointp=mapView.getProjection().fromPixels((int)event.getX(),(int)event.getY());GeocodergeoCoder=newGeocoder(getBaseContext(),Locale.getDefault());try{Listaddress=geoCoder.getFromLocation(p.g
使用Android模拟器2.2api8我不断收到IOException03-0519:42:11.073:DEBUG/SntpClient(58):requesttimefailed:java.net.SocketException:Addressfamilynotsupportedbyprotocol03-0519:42:15.505:WARN/System.err(1823):java.io.IOException:ServicenotAvailable那是我的代码:privateLocationManagermanager=null;LocationListenerlocatio
我根据经度和纬度值得到了当前位置然后我还使用注释在谷歌地图上找到了多个地方现在我想根据邮政编码获取经度和纬度值我不知道如何根据邮政编码获取经度和纬度值 最佳答案 这是调用googlemapapi进行地理编码的方法,如果你传递邮政编码,你会得到结果-(void)ViewDidLoad{NSMutableURLRequest*request=[[NSMutableURLRequestalloc]initWithURL:[NSURLURLWithString:[NSStringstringWithFormat:@"http://maps.
https://developer.apple.com/library/prerelease/mac/releasenotes/General/APIDiffsMacOSX10_11/Swift/CoreLocation.html显示有一些变化funcgeocodeAddressString(_addressString:String!,completionHandlercompletionHandler:CLGeocodeCompletionHandler!)到:funcgeocodeAddressString(_addressString:String,completionHand
我根据经度和纬度值获得了当前位置,然后我还使用注释在谷歌地图上获得了多个位置。现在我想根据地址(即街道、城市和县)获取经度和纬度值。需要一些关于如何实现这一点的指导。到目前为止,这是我尝试过的:-#import"ViewController.h"@interfaceViewController()@end@implementationViewController@synthesizestreetField=_streetField,cityField=_cityField,countryField=_countryField,fetchCoordinatesButton=_fetchC
我有一个C#类库。从那里我必须调用Google服务并获取纬度和经度。我知道如何在页面上使用AJAX,但我想直接从我的C#类文件调用Google地理编码服务。有什么方法可以做到这一点,或者是否有任何其他服务可供我使用。 最佳答案 你可以这样做:stringaddress="123somethingst,somewhere";stringrequestUri=string.Format("https://maps.googleapis.com/maps/api/geocode/xml?key={1}&address={0}&sensor
已结束。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。此问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭5年前。Improvethisquestion我有一个推出市场超过6个月的Android应用程序,它使用geocoder.getFromLocation()到"translate"latitude和经度到人类可读的地址:Geocodergeocoder=newGeocoder(this,Locale.getDefault());Listaddr