photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: jmsantos on October 19, 2023, 09:34:40 AM

Title: HERE reverse geocoding problem
Post by: jmsantos on October 19, 2023, 09:34:40 AM
Hello.

I'm trying reverse geocoding with HERE, but it always gives the same error:

IMatch could not establish a connection with the geocoding service at HERE.
The server may be unavailable or too busy. Please try again later.

I followed the steps to register in HERE and activate an REST API KEY (I think I did it right, it is more complex than the instructions say). I've been trying it for a while now at different times, but I've never gotten any results.

Title: Re: HERE reverse geocoding problem
Post by: Mario on October 19, 2023, 09:47:03 AM
HERE returns the status code 406 which means "Not Acceptable". I assume something with your credentials is not in order.
See HERE Maps API Key (https://www.photools.com/help/imatch/api-keys-for-maps-and-reverse-geocoding.htm?dl=hid-30) for more information about how to input your key.
Title: Re: HERE reverse geocoding problem
Post by: jmsantos on October 19, 2023, 11:00:04 AM
I have read that help many times and followed the steps over and over again.

In case I had done something wrong, I created the API KEY again. The result is always the same.
Title: Re: HERE reverse geocoding problem
Post by: Mario on October 19, 2023, 12:11:06 PM
Things that come to mind:
Have you set any access restrictions or trusted domains?
You need a REST API key, not a JavaScript API key when I recall correctly.
HERE now uses a single API key, no longer the app-id:app-code schema.
Title: Re: HERE reverse geocoding problem
Post by: jmsantos on October 19, 2023, 01:01:33 PM
I have checked and I don't see any restrictions nor is Trusted Domain activated.
I have created a single REST API KEY, not JavaScript.

I have also tried the Jingo's Super GeoLocator app
https://www.photools.com/community/index.php/topic,9093.msg68650.html#msg68650

This message appears in the Output panel:

H.service.GeocodingService is deprecated and will be removed soon. Use HERE Geocoding and Search API v7 instead.
done
Error

Maybe IMatch needs an update to the Reverse Geocoding service with HERE?
Title: Re: HERE reverse geocoding problem
Post by: Mario on October 19, 2023, 01:17:35 PM
Reverse geocoding works fine here, just tried.
No deprecation messages, no warnings in the result, just plain geocoding response data.

HERE is the least used service (by a wide margin) in the IMatch user base. Over 95% use either Google or GeoNames.
HERE is also the least used map provider. I'm always pondering to drop support for HERE completely.

IMatch uses the geocoder API, not something called "H.service.GeocodingService"...?
Title: Re: HERE reverse geocoding problem
Post by: Jingo on October 19, 2023, 05:35:02 PM
I just tried this as well using the standard reverse Geocode and my app and both provide correct info.  I do see in the output panel a deprecation message.. but actually it is for google.maps:

google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead: https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener

The feature will continue to work and there is no plan to decommission it.

Title: Re: HERE reverse geocoding problem
Post by: Mario on October 19, 2023, 07:04:21 PM
The code running in the map panel comes from Google.
The Map panel loads the sources directly from the Google Servers and should just get the "latest" all the time.
From time to time I migrate everything to their latest API versions and map code, if there is new stuff.
Then it takes usually just a few weeks before the next warning / migration message appears.
Google is changing their stuff all the time, abandoning older things faster than you can say "abandon" ;)
See the Google Cemetery (https://gcemetery.co/) for more info.
Title: Re: HERE reverse geocoding problem
Post by: jmsantos on October 19, 2023, 08:00:16 PM
I was trying to use HERE service because Geonames does not provide satisfactory results for me.
Although HERE has few users on IMatch, I have read in this community several good comments.
However, no matter how hard I try, it still doesn't work.

The error I mentioned above appeared in the Output Panel when using the Jingo's app Super GeoLocator:
H.service.GeocodingService is deprecated and will be removed soon. Use HERE Geocoding and Search API v7 instead.

HERE is migrating registrations in Developer to Platform. I don't know if it has anything to do with it.
Title: Re: HERE reverse geocoding problem
Post by: Mario on October 19, 2023, 08:11:30 PM
I have no idea.
I tried HERE on two systems and it works fine. The most recent API version is 7 and IMatch is currently using 6.2, I believe. But that is a fully supported version.

I've also tried the queries IMatch builds and sends to HERE with the Windows command line tool curl, and they also work. No deprecation warnings, no errors, just proper location data.

No problem reports from other users using HERE, although there are only a few...
Title: Re: HERE reverse geocoding problem
Post by: jch2103 on October 19, 2023, 10:09:27 PM
I seem to be one of the few who sometimes uses HERE maps. (I use HERE more w/ a computer mapping program, QGIS.)

I hadn't updated my HERE API in IM until today, but I'm having a problem w/ the Map window: The Map window only shows black now instead of a map view, w/ all the HERE map options (no error messages). But the Map window shows that HERE map tile is being used. 

Log attached, in case it's useful. At 10.19 13:50:20, there's mention of GetLocations.
Title: Re: HERE reverse geocoding problem
Post by: Mario on October 19, 2023, 10:24:49 PM
The log is clean.
Anything in the App Output Panel?

Open your web browser and press <F12> to open the developer tools.
Make sure the "Console" tab is enabled.
IMatch must be running.
Now navigate to this URL: http://127.0.0.1:50519/imatch/apps/FEATURES/mapapp/index.html
This will open the map panel in your browser.
Look at the console tab for error messages from HERE.
Title: Re: HERE reverse geocoding problem
Post by: jch2103 on October 19, 2023, 10:29:34 PM
Here's a screenshot of the console messages. 
Title: Re: HERE reverse geocoding problem
Post by: Mario on October 19, 2023, 11:48:11 PM
That's not the Console tab. The Console tab is two tabs left of the tab in your screen shot.
Title: Re: HERE reverse geocoding problem
Post by: jch2103 on October 20, 2023, 12:39:48 AM
Oops! Here are two screenshots showing the top and bottom of the console error messages. (Is there a better way to capture this info?)

The error message link says:
{"error":"Unauthorized","error_description":"apiKey invalid. apiKey not found."}



So apparently there's an issue w/ the API key, or at least how I recorded it in IM. Not sure why this is happening, given that it apparently works with my other (GIS) software.

Here's the 'sanitized' version of the information HERE sent me after migrating me to the new API:

Resolution Notes: Conversion succeeded.Current state of converted apps:

Src. AppId Src. AppName Dest. AppHrn Dest. AppName Dest. Description
[New code nmnmnmmmnn] Freemium 2019-06-09 hrn:here:account::org[org ID #]:app/[New code nmnmnmmmnn] Freemium 2019-06-09 REST


Title: Re: HERE reverse geocoding problem
Post by: Mario on October 20, 2023, 08:28:15 AM
Try to create a new API key and enter it.
Note that new (for a few years) API keys are a single key, not longer using the "app-id:key" format.
Title: Re: HERE reverse geocoding problem
Post by: zematima on October 20, 2023, 10:15:01 AM
Hi all:
I had the same problem. Switched to google maps. Today I give Here a try...
This is what I did:
Went here :  platform.here.com (https://platform.here.com/)
After logging, click on Goto Access Manager
Click in one of your name's app. Opens a new page where you can see in front of enabled 3 dots. Click and choose Delete.
Do the same for all your name's app. ( I had four...)
After that, choose one of your apps click on it and on the the new page choose Create Credentials.
It will create your new API key. 
I did this only for one app, all the others don't have any API key.
Copy it to IMatch.
Now I can see the maps insted of the black screen...


Title: Re: HERE reverse geocoding problem
Post by: Mario on October 20, 2023, 01:00:37 PM
Thanks. Hopefully this helps the other users with the same problem.
Title: Re: HERE reverse geocoding problem
Post by: jch2103 on October 20, 2023, 11:43:11 PM
@zematima - thank you for sharing this. Unfortunately, after I created a new HERE access key and pasted it into IMatch, I'm still seeing the same black screen (and same 404 error messages in the console).

I'm not sure how to proceed next...

I got the following in my HERE credential for my IMatch key:
here.user.id = aaa
here.client.id = bbb
here.access.key.id = ccc
here.access.key.secret = ddd
here.token.endpoint.url = https://account.api.here.com/oauth2/token

I used the here.access.key.id in IM preferences...
Title: Re: HERE reverse geocoding problem
Post by: zematima on October 21, 2023, 02:38:21 PM
Hi:
Now with some pictures:
Go to the provided link on the picture 1.jpg. (https://platform....) and click on the Go To Access Manager.
On picture 2.jpg click on the app you want to create the key.
On picture 3.jpg first delete the existing key (the 3 dots at your right, not shown in the picture) and all the other keys in other apps (if you have them).
I had 4 apps (2.jpg) and deleted all the keys they had and then choosed one app to create the new key.
The key IMatch needs is the one under ACCESS KEY ID
Paste it to IMatch and the result is in picture 4.jpg
Watch the slide of the zoom.
Best regards,
JRosa