如何使用地理codeR的Andr​​oid应用程序,以找到在大陆特定位置 [英] how to find continent in particular location using Geocoder in android app

查看:217
本文介绍了如何使用地理codeR的Andr​​oid应用程序,以找到在大陆特定位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

   i am developing android application using Geocoder services,
   I have an application where I try to get address of a location based on 
   the  latitude,longitude coordinates its working fine.  
   my problem is how to get continent of particular address.

例如:双纬度= 17;双LON = 78.49;

example : double lat=17; double lon=78.49;

地址列表=新的地缘codeR(Shout.this,Locale.getDefault())getFromLocation(纬度,经度,1);

List addresses = new Geocoder(Shout.this,Locale.getDefault()).getFromLocation(lat, lon, 1);

我用这code输出是印度,海得拉巴 这个地址与如何找到大陆,请帮我一些有价值的解决方案。

i am using this code output is India,Hyderabad this address related how to find continent ,please help me some valuable solution.

我是动态获取国家名称使用地理codeR是他们任何机会,以获得在大陆的名称以及country.it很难保持静态动态地需要 任何免费服务发现大陆基础的服务

i am getting country name dynamically using geocoder is their any chance to get in continent name along with country.it is difficult to maintain statically i need dynamically any free services find continent based services

在此先感谢

推荐答案

我不认为这是谷歌的API给出了这样的信息。唯一的解决办法我能想到的是有某种静态的数据结构映射国名,以大陆的名字(你会presumably要发现自己不知何故,例如通过刮的这个网页...)。然后,你可以搜索文本字符串的地理codeR给你,并返回相应的最匹配的国名(这将是您的字符串映射的键)的大陆。 (你也必须把我们地址的特殊情况当中,烦人,刚刚结束与国家code)

I don't think there is such information given by Google's API. The only solution I can think of is to have some kind of static data structure mapping country names to continent names (which you would presumably have to find yourself somehow, for instance by scraping this web page... ). Then you could text search the string that GeoCoder gives you and return the continent corresponding to the closest matching country name (which would be the key in your String mapping). (You would also have to treat the special case of US addresses which, annoyingly, end just with the state code)

这篇关于如何使用地理codeR的Andr​​oid应用程序,以找到在大陆特定位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆