如何从Lat和Long获得邮政编码?

时间:2013-07-22 18:24:20

标签: java android

我已经能够获得lat和long,但有没有办法对本地邮政编码进行粗略猜测?

我需要这个在英国工作。

如果无法做到这一点,请说出来。

1 个答案:

答案 0 :(得分:2)

Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());
addresses = geocoder.getFromLocation(latitude, longitude, 1);

邮政编码(美国的邮政编码),如果有的话,是:

final String postalCode = addresses.get(0).getPostalCode();

(找到here.

相关问题