Geocoding problems

Thomas Svanelind4 years ago

When I click on Show Adress in the web gui there is no result.

Settings in my config.

entry key='geocoder.enable'>true</entry>
entry key='geocoder.onRequest'>false</entry>
entry key='geocoder.ignorePositions'>true</entry>
entry key='geocoder'>nominatim</entry>
entry key='geocoder.url'>https://eu1.locationiq.com/v1/reverse.php</entry>
entry key='geocoder.key'>MY KEY</entry>

I get this in the log file.

2020-01-05 22:11:32  WARN: Empty address. Error: The provided API key is invalid.

But if use this link I get a result.

https://eu1.locationiq.com/v1/reverse.php?key=MY KEY&&lat=59.129027&lon=12.892395&format=json

What am I doing wrong?

Anton Tananaev4 years ago

If the key has some special characters, make sure it's encoded correctly in the XML. Otherwise I would recommend to check with provider. Maybe you just have a typo?

Thomas Svanelind4 years ago

The key starts with pk. can that be a problem?

Macan4 years ago

The key must start with pk.
Try to generate another key and paste it in the traccar config file and restart traccar.

Thomas Svanelind4 years ago

Generated a new key but same response.

Macan4 years ago

Did you try to contact locationiq support? Please contact them and they will help you for sure, they helped me for some problems.

Anton Tananaev4 years ago

None of our LocationIQ keys start with pk. Ours just HEX numbers. Where did you get the key from?

Thomas Svanelind4 years ago

I created access tokens from my dashboard on https://my.locationiq.com/dashboard/ and they all looks like this.
pk.21a625addf044ab3abee????????????

Anton Tananaev4 years ago

That's weird. We have quite a few accounts and none of them have pk. prefix. Most of them are free plan though, so not sure if it makes any difference.

Thomas Svanelind4 years ago

Strange! I can use the API token I got when I created my account at locationiq.com in this url https://eu1.locationiq.com/v1/reverse.php?key=API TOKEN&&lat=59.129027&lon=12.892395&format=json
But not in the config file for TRACCAR. This API token has not pk. in beginning.

Thomas Svanelind4 years ago

Answer from LocationIQ!

Hi Svanelind,
This seems to be a known issue with Traccar. I suggest you reach out to the team at Traccar regarding this.
Thanks!

Regards,
Swati Reddy
Cell + WiFi geolocation | Addresses | Routing | Maps

Slawek4 years ago

try

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.url'>https://locationiq.org/v1/reverse.php</entry>
    <entry key='geocoder.key'>your_key</entry>
Anton Tananaev4 years ago

What is the known issue? The error message says that the key is invalid.

Slawek4 years ago

When did you do account they send you token via email, this token start from pk??????

Thomas Svanelind4 years ago

These are my keys. You can test them.
pk.26c58f24d33c61f2885687c4a5e1e576
pk.21a625addf044ab3abeedddd59348202

https://eu1.locationiq.com/v1/reverse.php?key=pk.26c58f24d33c61f2885687c4a5e1e576&&lat=59.129027&lon=12.892395&format=json