I'm using Geocoder
in reverse way to get an address from a given lat & lon.
Do you know how to get from Address
only the street name?
Geocoder geocoder = new Geocoder(AutoFinderMapActivity.this);
try {
List<Address> addressList = geocoder.getFromLocation(latitude, longitude, 1);
if (addressList != null && addressList.size() > 0) {
// Help here to get only the street name
String adress = addressList.get(0).get...;
}
} catch (IOException e) {
e.printStackTrace();
}
Thanks in advance,
Use getLocality() and getCountryName() instead. @Shubh - Try this url - "http://maps.googleapis.com/maps/api/geocode/json?latlng=" + latitude + ","+ longitude + "&sensor=true" . It will return Json response. You don't need to specify Locale.
The Geocoding toolbar provides a quick way to search for an address and display the corresponding location on a map. If the Geocoding toolbar has not been added to ArcMap, click Customize > Toolbars > Geocoding to add it. Click the first drop-down arrow and choose an address locator.
Geocoding is the process of transforming a street address or other description of a location into a (latitude, longitude) coordinate. Reverse geocoding is the process of transforming a (latitude, longitude) coordinate into a (partial) address.
Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers on a map, or position the map.
I was searching up the very same thing. I disagree with the answer that was marked as correct. I could be wrong but it would appear that "Thoroughfare" (what a quaint old English term!) is the field that provides the street name. so for example:
get the addresses:
List<Address> addresses = null;
addresses = geocoder.getFromLocation(latitude, longitude,1);
if(addresses != null && addresses.size() > 0 ){
Address address = addresses.get(0);
// Thoroughfare seems to be the street name without numbers
String street = address.getThoroughfare();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With