Google Reverse Geocoding from 11 June

hairydog6 years ago

I've had an email from Google telling me that starting on 11 June, an API key will be needed to be able to use reverse geocoding through them. And to get this new key, you have to provide payment details.
They say you can have $200 worth of lookups per month, then you have to pay.
The pricing table says it is 40,000 API calls per month for free, then it is $5 per 1000 calls.
Assuming each tracker reports its position once every 30 seconds, that's 120 times an hour, or 87,667 times a month. So it will cost around $238.33 per month for the first tracker. Then each extra tracker will be $438,34 per month.
I am not keen to pay that much!
I assume there is some way to get traccar to only fire off a geocoding API request on demand, but I'm not clear how to configure that.
Can anyone help?

Anton Tananaev6 years ago

Yes, there is. Check documentation here:

https://www.traccar.org/configuration-file/

hairydog6 years ago

I was looking at that file, and I've put in :

<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.onRequest'>true</entry>
<entry key='geocoder.ignorePositions'>false</entry>
<entry key='geocoder.reuseDistance'>200</entry>
<entry key='filter.enable'>true</entry>
<entry key='filter.skipLimit'>25</entry>
<entry key='filter.duplicate'>true</entry>
<entry key='filter.distance'>10</entry>
<entry key='filter.maxSpeed'>1000</entry>
<entry key='filter.zero'>true</entry>

I'm hoping that
<entry key='geocoder.onRequest'>true</entry> means that Traccar will only do a lookup if asked to, but I honestly don't quite understand the explanation of what it does.
I have found the Google lookups to be the best in terms of quality of result returned, but don't want to risk paying them a fortune by mistake!

Anton Tananaev6 years ago

You need to set ignorePositions to true.

hairydog6 years ago

Thanks! Now changed.

hairydog6 years ago

Is there a command to get Traccar to re-read the traccar.xml without having to restart it?

Anton Tananaev6 years ago

No, you have to restart service.

Nick6 years ago

Continuing on this topic, but on the last two comments, is there a restart script or do we have to run stopDaemon.sh and then startDaemon.sh? I'm keen to have a restart script, but I'm not a programmer. If I create a new script with the copy-pasted contents of stop and start scripts, will it work as a restartDaemon.sh script?

Anton Tananaev6 years ago

You can run both script like this:

/opt/traccar/bin/stopDaemon.sh ; /opt/traccar/bin/startDaemon.sh
Nick6 years ago

Okay, that easy trick described above worked - for those who want a restart script. Finally I just added chmod +x restartDaemon.sh and it became an executable

Sean Hay6 years ago

Hi

Turned on the Geocoding using Google API and got 10'000 plus hits in the first 3 days on 5 test GPS's. Almost had a heart attack.
The only thing I want the Google Gecoding for is when a person clicks on the device on the left hand side and then clicks on "Show Address" further down on the left to see the address of where that device is right now.

(I also noticed when you click on show address it does it for all devices not just the one you clicked on)

I put the following in but i am still getting over 300 requests an hour on 5 devices.

   <entry key='geocoder.enable'>true</entry>
   <entry key='geocoder.onRequest'>true</entry>
   <entry key='geocoder.ignorePositions'>true</entry>
   <entry key='geocoder.reuseDistance'>200</entry>
   <entry key='filter.enable'>true</entry>
   <entry key='filter.skipLimit'>25</entry>
   <entry key='filter.duplicate'>true</entry>
   <entry key='filter.distance'>10</entry>
   <entry key='filter.maxSpeed'>1000</entry>
   <entry key='filter.zero'>true</entry>
   <entry key='geocoder.type'>google</entry>
   <entry key='geocoder.key'>123456789</entry>

How do I restrict it, so that it is only using the Google Geocoding api when "show address" is clicked only. Thank you.

hairydog6 years ago

I have ended up with

<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.onRequest'>true</entry>
<entry key='geocoder.ignorePositions'>true</entry>
<entry key='geocoder.reuseDistance'>200</entry>

and that works for me.
Your config looks correct to me. I don't understand why it works for me and nor for you. Are you sure you restarted Traccar to make it re-read the config?

Anton Tananaev6 years ago

Make sure you are using latest release and service has been restarted after changing config.

Sean Hay6 years ago

Hi HairyDog,

Thank you, did the same as yours, stopped the service and restarted with:
sudo systemctl stop traccar.service
sudo systemctl start traccar.service

Has come down to a few per hour.
Thank you, very much.

Tom Priscel5 years ago

Do you support Geocode.xyz ? I don't see it here: https://www.traccar.org/reverse-geocoding/