Python - Google Maps



Python provides modules which can be used to translate addresses available in google map directly to geographic coordinates. It is helpful in finding business addresses and locating the closeness of different addresses.

We use a module named pygeocoder which provides the functionalities to receive addresses and geocodes. This module is installed through pip using the following command.

Installing pygeocoder

pip install pygeocoder 

Finding Business Address

We submit a business name as input and the program gives the complete address as the output. The module uses data from google maps in the background to retrieve the result.

from pygeocoder import Geocoder

business_name = "Workafella Business Centre - Hitec city"
print "Searching %s" %business_name
results = Geocoder.geocode(business_name)
for result in results:
    print result

When we run the above program, we get the following output −

Searching Workafella Business Centre - Hitec city
Western pearl building 1st floor, Hitech City Rd, 
Opposite HDFC Bank, Kondapur, Hyderabad, Telangana 500084, India
Advertisements