-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneric_geocoder.py
More file actions
29 lines (24 loc) · 938 Bytes
/
Copy pathgeneric_geocoder.py
File metadata and controls
29 lines (24 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
'''
GenericGeocoder is used as an interface for the Google/Here geocoders
'''
class GenericGeocoder(object):
def __init__(self, unformattedAddress):
self.unformattedAddress = unformattedAddress
self.formattedAddress = ""
self.url = ""
self.urlBase = ""
self.lat = 0
self.lon = 0
def formatAddress(self):
# Spaces -> '+'
# Commas -> '%2C'
logging.debug("Inputted address is: {}".format(self.unformattedAddress))
self.formattedAddress = self.unformattedAddress.replace(" ", "+")
self.formattedAddress = self.formattedAddress.replace(",", "%2C")
logging.debug("Formatted address is: {}".format(self.formattedAddress))
def formatRequest(self):
return None
def getLatLon(self):
return None