Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from googleplaces import GooglePlaces, types, lang
- YOUR_API_KEY = 'AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI'
- google_places = GooglePlaces(YOUR_API_KEY)
- #Using Google Places API we can find names associated with nearby places. (Assuming this is what you wanted)
- def locationMatch(locArray):
- matchedLocation = []
- for i in locArray:
- #Iterates through each location object i and queries Google Places using the location object
- query_result = google_places.nearby_search(
- location=i,
- radius=20000)
- matchedLocation.append(query_result.place.name)
- #returns the list of names of nearby places which are associated.
- return matchedLocation
Add Comment
Please, Sign In to add comment