Reputation: 1731
I'm trying to replicate the Reverse Geocoding section in this article: https://developer.here.com/blog/getting-started-with-geocoding-exif-image-metadata-in-python3
I've tried with creds for both Javascript and Rest. For the Javascript creds, I've copy-pasted the app_id
. For app_code
I'm using the "API KEY". For the REST creds, I've tried pairing the app_id
with both the "API KEY" and the "ACCESS KEY ID".
Both produce a `KeyError: 'xxxxxxxxxxxxxxxx'
Upvotes: 1
Views: 121
Reputation: 28349
There is a bit of trickiness involved, due to the fact that app_id and app_code pair have been deprecated in favor of apiKey. The blog post was written before that change.
So if you created your HERE project recently and have an api key instead of an app_id and app_code pair, you need to:
See below:
#uri = 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json'
uri = 'https://reverse.geocoder.ls.hereapi.com/6.2/reversegeocode.json'
headers = {}
params = {
#'app_id': os.environ['APP_ID_HERE'],
#'app_code': os.environ['APP_CODE_HERE'],
'apiKey': os.environ['API_KEY_HERE'],
'prox': "%s,%s" % coords,
'gen': 9,
'mode': 'retrieveAddresses',
'maxresults': 1,
}
See also the documentation examples for reverse geocode
Upvotes: 1