Guest User

Untitled

a guest
Nov 14th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. def generate_lat_long(location):
  2. coordinates = {}
  3. coordinates_blank = {"latitude": None,
  4. "longitude": None}
  5. if location:
  6. geolocator = GoogleV3(botsetting.GOOGLE_API_KEY)
  7. location_raw = geolocator.geocode(location, language='en')
  8. if location_raw:
  9. coordinates['latitude'] = location.latitude
  10. coordinates['longitude'] = location.longitude
  11.  
  12. print("printing coordinated from google ap1", coordinates)
  13. return coordinates
  14. else:
  15. return coordinates_blank
  16.  
  17. else:
  18.  
  19. return coordinates_blank
Add Comment
Please, Sign In to add comment