-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
292e6dc
commit 6c84fc7
Showing
19 changed files
with
837 additions
and
134 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import json | ||
import urllib | ||
|
||
import geopy | ||
from geopy.geocoders import Nominatim | ||
from geopy.extra.rate_limiter import RateLimiter | ||
|
||
class GeoCodeUtils: | ||
|
||
@staticmethod | ||
def reverse_latlong(lat,long): | ||
"""Function that having a lat and long translates it to a posiblea ddress" | ||
""" | ||
locator = Nominatim(user_agent="openmapquest") | ||
coordinates = "{0}, {1}".format(lat, long) | ||
location = locator.reverse(coordinates) | ||
|
||
return location.address | ||
|
||
@staticmethod | ||
def reverse_adress(adress): | ||
"""Function that having an adress translates it to a lat and long values" | ||
""" | ||
locator = Nominatim(user_agent="openmapquest") | ||
location = locator.geocode(adress) | ||
print(location) | ||
return location.latitude, location.longitude |
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.