나는 다음과 같은 주소를 위도 LNG를 얻기 위해 노력하고 있지만, 지오 코더는 위도 LNG 찾을 수 없습니다 :지오 코더 (Geocoder)가 안드로이드의 특정 문자열에서 lat lng를 가져올 수 없습니까?
이탈리아 10046 - 스트라 Provinciale 134, POIRINO (TO) 다음과 같이Cascina에 팔라의 n.9 -
내 코드는 다음과 같습니다
public static LatLng getLocationFromAddress(Context context, String strAddress) {
Geocoder coder = new Geocoder(context);
List<Address> address;
LatLng p1 = null;
try {
address = coder.getFromLocationName(strAddress, 5);
if (address == null) {
return null;
}
Address location = address.get(0);
location.getLatitude();
location.getLongitude();
p1 = new LatLng(location.getLatitude(), location.getLongitude());
} catch (Exception ex) {
Timber.d("getLocationFromAddress(printStackTrace): " + ex);
}
return p1;
}
편집 1 : 또한
, 나는 settin으로 시도 g 지역 코더에서 이탈리아와 수동으로 로케일을하지만 여전히 결과를 얻을 수 없습니다.
그래는 REST API를 작업처럼 보이는하지만 왜 안드로이드에 모른다. http://maps.google.com/maps/api/geocode/json?address=Cascina%20Palazzetto%20n.9%20-%20Strada%20Provinciale%20134,%20POIRINO%20(TO)%20-% 2010046, % 20Italia & sensor = false –
로그를 제공 할 수 있습니까? – Cottontree
List 개체 주소는 로그에서 정보를 얻을 수없는 대신 크기가 0입니다. –