In this article, we are going to write a python script to find the address of a specified latitude and longitude using the geopy module. The geopy module makes it easier to locate the coordinates of addresses, cities, countries, landmarks, and zipcode.
To install GeoPy module, run the following command in your terminal.
pip install geopy
- Import the geopy module.
- Initialize Nominatim API to get location from the input string.
- Get location with geolocator.geocode() method.
Below is the program based on the above approach:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.