Reverese GeoCoding

samaidha10 months ago

Hi, I'm using Traccar API on a custom front end, everything works perfectly,
The thing is when I try using "Reverse Geocoding" as the documents states : API call to 'http://{my_host}:{my_port}/api/positions`.
My address is always set to null ("address": null,).

following is the setting I am using right now:

<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.type'>opencage</entry>
<entry key='geocoder.url'>http://api.opencagedata.com/geocode/v1</entry>
<entry key='geocoder.key'>{my_api_key}</entry>

*NOTE: I have tried using other "Reverse Geocoding" providers, listed in the docs, with the same results.

Am I missing something?

Anton Tananaev10 months ago

The thing is when I try using "Reverse Geocoding" as the documents states

Which document is that?

Anton Tananaev10 months ago

Have you enabled geocoding for every position?

samaidha10 months ago

Hi, sorry I did not make myself clear.

The document I was referring was: https://www.traccar.org/api-reference/.
Where I call: http://{my_host}:{my_port}/api/positions.
And I do get all the info needed. however the address is coming as null.

So I followed : https://www.traccar.org/reverse-geocoding/, and did my configurations.
As you can see my code above. After the configurations,
and restarting the server, my result is "address": null.

I did omit Additional parameters in the https://www.traccar.org/reverse-geocoding/ page.

As you said "Have you enabled geocoding for every position?"

Is "geocoding for every position" included in the Additional parameters?
If so, it is not an optional parameter?

Anton Tananaev10 months ago

If you want to get address automatically, you have to make sure you set geocoder.ignorePositions to false in the configuration. By default it's set to true.

samaidha10 months ago

Thanks.