现在国内有哪些免费并且可以用的可以把经纬度反编译成城市名称的接口

这个不需要接口也能做到啊,只不过是通过网络定位,实在需要通过gps百度有答案。使用定位接口的话你需要申请一个apiKey然后下载相关sdk感觉配置比较麻烦即使用起来方便,而且你仅仅需要实现定位功能的话感觉不需要用接口代码如下:class ParseAddress {public static Map\u0026lt;String, String\u0026gt; start(Context context) { NetworkInfo network = ((ConnectivityManager) context. getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo(); if (network == null || !network.isAvailable()) {//网络不可用 return null; } String networkProvider; LocationManager manager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); List\u0026lt;String\u0026gt; providers = manager.getProviders(true); if (providers.contains(LocationManager.NETWORK_PROVIDER)) networkProvider = LocationManager.NETWORK_PROVIDER; else {//获取位置失败,需要打开GPS网络定位功能 return null; }//这里IDE会报权限问题,不需理会 Location location = manager.getLastKnownLocation(networkProvider); Geocoder geocoder = new Geocoder(context); if (location == null)return null; //纬度 double x = ((double) ((int) (location.getLatitude() * 1E6))) / 1000000; //经度 double y = ((double) ((int) (location.getLongitude() * 1E6))) / 1000000; Map\u0026lt;String, String\u0026gt; address; List\u0026lt;Address\u0026gt; listAddress; try {//得到逆理编码,传入的参数分别为:纬度,经度,最大结果集 listAddress = geocoder.getFromLocation(x, y, 3); if (listAddress.size() != 0) { address = new HashMap\u0026lt;\u0026gt;(); Address a = listAddress.get(0); //省 address.put("province", a.getAdminArea()); //市 address.put("city", a.getLocality()); //县 | 区 address.put("county", a.getSubLocality()); return address; } } catch (IOException e) { Log.e("ParseAddress", "start", e); }return null; }}
■网友
这个叫反地理编码,百度高德天地图都有这个接口http://developer.baidu.com/map/index.php?title=webapi/guide/webservice-geocoding。申请一个key后直接用url请求就好了。另外用了gps定位接口后,返回的属性里面就有一个是地址。


    推荐阅读