Last active
August 27, 2017 05:09
-
-
Save AgustinPelaez/5bb98fff0a3165b92de1ab92db56549a to your computer and use it in GitHub Desktop.
A Dockerfile compatible Python script to be used with Openwhisk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from geopy.geocoders import Nominatim | |
import sys | |
import json | |
def main(): | |
geolocator = Nominatim() | |
params = json.loads(sys.argv[1]) | |
location = geolocator.reverse((params['lat'],params['lng'])) | |
print(json.dumps({ 'address' : location.address})) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment