Geocoder onRequest doesn't seem to take effect

Victor Butler4 days ago

Due to slowly running reports, I had to change the reverse geocoding provider. Now I run into a strange issue, where the geocoder.onRequest = true setting is not being taken into account - the coordinates are being decoded every time both in the web api and reports.

I tired setting both geocoder.onRequest and geocoder.ignorePositions to true and false, no difference whatsoever.
I also cleared cache and tried different providers like tomtom and locationiq, no difference.

Here are my settings:

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.url'>https://us1.locationiq.com/v1/reverse.php</entry>
    <<entry key='geocoder.key'>api key here</entry>
    
    <entry key='geocoder.onRequest'>true</entry>
    <entry key='geocoder.ignorePositions'>true</entry>
    <entry key='geocoder.reuseDistance'>10</entry>

The XML is valid, so it's not a schema error.

Any ideas what could be wrong?

Anton Tananaev4 days ago

the coordinates are being decoded every time both in the web api and reports

What does this mean exactly? It seems like it's exactly how it should work.

Victor Butler4 days ago

I need the web API to display "Show Address".
The reports should display the decoded address.

My understanding is that this is the default behavior as well, according to the documentation:

Additional parameters

By default reverse geocoding is only done when user requests reports or explicitly clicks "show address" button in the app. You can disable this behavior using the following parameters:

<entry key='geocoder.onRequest'>false</entry>
<entry key='geocoder.ignorePositions'>false</entry>

Still, by setting those two keys to true or even removing them from the config, the coordinates are always being decoded both in the web api and the reports as well.

Anton Tananaev4 days ago

Disabling these parameters will enable old behavior, which is do geocoding automatically when you receive locations.

Victor Butler4 days ago

Yes, this is what the documentation says as well.

However, this is not working and all records are being decoded both in the API and the Reports:

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

Anton Tananaev4 days ago

You have not provided enough context to say whether it's correct or not. It depends on the API. It depends what the configuration was at the given period of time. etc

Victor Butler4 days ago

I am testing right now, with the settings below:

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

Expected behavior:

  1. "Show Address" in web api
  2. "Check on Map" in reports

Actual behavior:

  1. Decoded address in web api
  2. decoded address in reports

So setting those two settings to true works incorrectly and I wonder why.

Anton Tananaev4 days ago

You still didn't say which API and which report. They will work differently depending on the type.

Victor Butler4 days ago

Trips report.
Tested with TomTom, LocationIQ and Nominatim with Openstreetmap.

Same results.

Anton Tananaev4 days ago

This is expected. geocoder.onRequest set to true will automatically do geocoding on the trips report request.

Victor Butler4 days ago

So for trips report, what setting should I set so that:

Trips in web API to display "Show Address".
Trips excel report display the decoded address.

Anton Tananaev4 days ago

No, both should have the address.

Victor Butler4 days ago

And the same for the positions?

This setting
<entry key='geocoder.ignorePositions'>false</entry>

will NOT decode positions automatically?

Anton Tananaev4 days ago

It's the opposite. If you set ignorePositions to true, it will NOT do geocoding for positions automatically. If you set it to false, it will.

Victor Butler4 days ago

got it, thanks Anton! Maybe worth fixing on the Geocoding page:

tomtm.PNG