我想使用android应用程序的邮政编码来获取纬度和经度
发布于 2011-01-29 07:13:51
假设地理编码器服务存在,这是一个简单得多的解决方案:
final Geocoder geocoder = new Geocoder(this);
final String zip = "90210";
try {
List<Address> addresses = geocoder.getFromLocationName(zipCode, 1);
if (addresses != null && !addresses.isEmpty()) {
Address address = addresses.get(0);
// Use the address as needed
String message = String.format("Latitude: %f, Longitude: %f",
address.getLatitude(), address.getLongitude());
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
} else {
// Display appropriate message when Geocoder services are not available
Toast.makeToast(this, "Unable to geocode zipcode", Toast.LENGTH_LONG).show();
}
} catch (IOException e) {
// handle exception
}发布于 2013-10-10 17:43:04
在GeoCoding领域没有谷歌的竞争对手:)
您只需为以下链接发出一个http Get请求即可。这是a link
只需根据您的需求更改邮政编码元素即可,。尽情享受。
有关更多参考信息,请访问链接。Maps Geocoding Reference
发布于 2010-09-04 15:45:03
你可以这样使用YQL:select centroid from geo.places where text="ZIPCODE_HERE“
https://stackoverflow.com/questions/3641304
复制相似问题