Skip to content

Commit

Permalink
Merge pull request #4 from Jnguye84/neo4j
Browse files Browse the repository at this point in the history
Add geolocation parser with lat and lon
  • Loading branch information
hammad93 committed Mar 3, 2024
2 parents 773de14 + f64c906 commit 4641713
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Empty file added geocoder/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions geocoder/parse.py
@@ -0,0 +1,18 @@
import googlemaps

API_KEY='AIzaSyDKNEVpcm4209xjTIvifzjmva8qKsJQe4s'

def getLatLng(place):
'''
References
----------
https://github.com/googlemaps/google-maps-services-python
'''
gmaps = googlemaps.Client(key=API_KEY)
geocode_result = gmaps.geocode('1600 Amphitheatre Parkway, Mountain View, CA')

return {
'lat': geocode_result[0]['geometry']['location']['lat'],
'lng': geocode_result[0]['geometry']['location']['lng'],
'metadata': geocode_result
}

0 comments on commit 4641713

Please sign in to comment.