Skip to content

Commit

Permalink
Merge pull request DenisCarriere#139 from singabhi/master
Browse files Browse the repository at this point in the history
Modified Here code to accept custom URL and Qualifed Address.
  • Loading branch information
DenisCarriere committed Jun 29, 2015
2 parents a40d6af + 6a1901a commit 787f0c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion geocoder/here.py
Expand Up @@ -20,9 +20,10 @@ class Here(Base):
"""
provider = 'here'
method = 'geocode'
qualified_address = ['city', 'district', 'postal', 'state', 'country']

def __init__(self, location, **kwargs):
self.url = 'http://geocoder.api.here.com/6.2/geocode.json'
self.url = kwargs.get('url','http://geocoder.api.here.com/6.2/geocode.json')
self.location = location
self.params = {
'searchtext': location,
Expand All @@ -31,6 +32,9 @@ def __init__(self, location, **kwargs):
'gen': 8,
'language': kwargs.get('language', 'en')
}
for value in Here.qualified_address:
if kwargs.get(value) is not None:
self.params[value] = kwargs.get(value)
self._initialize(**kwargs)

def _exceptions(self):
Expand Down

0 comments on commit 787f0c4

Please sign in to comment.