开发者

Determine the State given a Lat/Long using Google API in android

开发者 https://www.devze.com 2022-12-26 06:27 出处:网络
Is there a way to determine the State in which a given Lat/Long resides using the Google Api in开发者_Python百科 Android?

Is there a way to determine the State in which a given Lat/Long resides using the Google Api in开发者_Python百科 Android?

thx


As quoo mentionned, you can use reverse geocoding. From quoo's link,

Geocoder myLocation = new Geocoder(getApplicationContext(), Locale.getDefault());   
List<Address> myList = myLocation.getFromLocation(latPoint, lngPoint, 1);

You can get then the state by using the getAdminArea() method from the Address object.

myList.get(0).getAdminArea()

See more info here of what information you can get from the Address object


I assume you could use reverse geocoding to figure out the state. There was a similar question for android asked here: Android: Reverse geocoding - getFromLocation

0

精彩评论

暂无评论...
验证码 换一张
取 消