Reverse Geocoding issue

Carl6 years ago

Reverse geocoding is automatically being used in Reports -> Trips despite I set this configuration in traccar.xml:

        <entry key='geocoder.type'>google</entry>
        <entry key='geocoder.key'>key</entry> -->
        <entry key='geocoder.onRequest'>true</entry>
        <entry key='geocoder.ignorePositions'>true</entry>
        <entry key='geocoder.reuseDistance'>100</entry>

I can see the Google API being used despite that configuration. The same happens with the Stops report.

To temporarily and locally fix this, I've commented the function onGeocode function (positionId) of ReportController.js line 445 if I remember properly, but I can still see the API being called and returning results...

Is there a way to fix this?

Thanks!

Anton Tananaev6 years ago

That's expected behavior.

Carl6 years ago

What code change should I do for it not to query that automatically?

Ernesto Vallejo6 years ago

Check within both config xml diles if you are not overriding properties.

If you made changes to web app, are you in debug mode? If not, Did you minify the web app?

Carl6 years ago

Thanks Ernesto.

I am probably overriding properties as I can see server changes when I modify them and restart service. Also, I'm in release mode and after I modify JS files I run minify.sh and restart service.

Carl6 years ago

Any ideas on how to disable that? I understand you don't want to implement that in the official release but any help here would be appreciate it so that I can disable it in my instance. I'm already hiding the startAddress and the endAddress attributes and I have commented the code under onGeocode function in line 445 but every time I query for trips or stops, Traccar still reverse geocodes the locations... If you could tell me what to modify to disable reverse geocoding I'd appreciate it a lot. Of course I don't want to disable it from conf file traccar.xml as I still want to be able to use it when pressing the Show Address button.

Carl6 years ago

Is there no way to achieve this?

Ernesto Vallejo6 years ago

try with this configuration

<!-- GEOCODER CONFIG -->
<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.type'>google</entry>
<entry key='geocoder.key'>YOUR_API_KEY</entry>
<entry key='geocoder.ignorePositions'>true</entry>
<entry key='geocoder.reuseDistance'>20</entry>
Carl6 years ago

It works!!! I missread the documentation for the onRequest option... I thought onRequest was specifically when the user is manually requesting position. My bad for not reading the documentation carefully... Thanks! :D