javajava-melatitude-longitudejsr179

How to get Latitude and Longitude for particular city or street without using google map?


How to get Latitude and Longitude for particular city or street or location without using google map? For example user entered city name is "Chennai" and i need to show only Latitude and Longitude for that city. How to do this?


Solution

  • This is called Geocoding, and requires matching a place name up to a latitude and longitude.

    You can either code a known list of place name/lat-lons into your app, read them in at runtime and search through them when required, or you can use an online Geocoding service such as this one from Yahoo, or this one from Google.