Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def generate_lat_long(location):
- coordinates = {}
- coordinates_blank = {"latitude": None,
- "longitude": None}
- if location:
- geolocator = GoogleV3(botsetting.GOOGLE_API_KEY)
- location_raw = geolocator.geocode(location, language='en')
- if location_raw:
- coordinates['latitude'] = location.latitude
- coordinates['longitude'] = location.longitude
- print("printing coordinated from google ap1", coordinates)
- return coordinates
- else:
- return coordinates_blank
- else:
- return coordinates_blank
Add Comment
Please, Sign In to add comment