我尝试通过提供静态地理坐标来获取特定位置的地址。我无法获取地址。有人可以帮忙吗?我只需要检查这个功能是否适合我。
这是我的片段。
Geocoder geocoder = new Geocoder(AddressSimulator.this, Locale.getDefault());
List<Address> addresses = geocoder.getFromLocation(1.352566007, 103.78921587, 1);
System.out.println("Addresses size"+addresses.size());
获得的地址大小为零。我也尝试了一些其他地理坐标,但地址大小始终返回为 0。专家,请帮我解决这个问题。
期待您的宝贵帮助/建议,
此致,
罗尼
尝试使用 google 或 rpc geocoder 中的一个。对于谷歌地图,您必须从谷歌获取密钥。
对于地理编码器,它们每 15 秒仅响应来自同一 IP 的一个请求。
string geocoderUri = String.Format("http://maps.google.com/maps/geo?q={0},{1},{2}&output=csv"
+ "&key= < Your Key > ", street, city, state);
or
string geocoderUri = string.Format("http://rpc.geocoder.us/service/rest?address={0},{1},{2}", street, city, state);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)