Format address in Geocoding

brm7 years ago

Hello, I using traccar 3.12-SNAPSHOT (but i downloaded the last zip 3.13) and I have my own Nominatim server, in my traccar.xml I have this:

 <entry key='geocoder.enable'>true</entry>
 <entry key='geocoder.type'>nominatim</entry>
 <entry key='geocoder.url'>http://my_ip/reverse.php</entry>

So, I don't know if traccar is using my server, but I getting addresses, my question is, if exist any way of get complete address?
Actually I only receive partial string of my address, only road and state.

How to know if traccar is using my own Nominatim server? in logs I can't see nothing and the Nominatim Logs nothings appear.

thank you!

Anton Tananaev7 years ago

You can customise address using geocoder.format config parameter:

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

brm7 years ago

thank you so much.

Why traccar is not using my own nominatim server? , I should put the config in default.xml or in another file ?

Thank you!

Anton Tananaev7 years ago

If you configured it correctly it should be using your one.

brm7 years ago

thank you and Sorry for almost question..

My last question is geocoded works in reports? when I get report from api, geocoding not get my config changes.

Anton Tananaev7 years ago

Geocoding works for reports, but address is resolved at the time data is saved, so old data won't get updated with addresses.

brm7 years ago

Ok, thank you for your explanation.
I don't understand I already deleted config geocoding in default.xml and keep my config in traccar.xml, any request is sending to my nominatim server but address works fine.

Anton Tananaev7 years ago

What exactly is the problem? Have you restarted after changing config?

brm7 years ago

My problem is, traccar is not using my own nominatim server, yes I restart using sudo /opt/traccar/bin/stopDaemon.sh and then sudo /opt/traccar/bin/startDaemon.sh after change config file.

Anton Tananaev7 years ago

One other thing I can think about is that "invalid" positions are not used for reverse geocoding by default.

brm7 years ago

But, if I deleted default geocoder google from default.xml, where the system is getting the geocoding info.. ??

Anton Tananaev7 years ago

Depending on the configuration it might be using last address. There is clearly something you missing, but there is no way to tell what because you haven't provided enough information to tell that.

brm7 years ago

this is part of my default.xml

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!-- SERVER CONFIG -->

    <entry key='web.enable'>true</entry>
    <entry key='web.port'>8082</entry>
    <entry key='web.path'>./web</entry>

    <entry key='logger.enable'>true</entry>
    <entry key='logger.level'>all</entry>
    <entry key='logger.file'>./logs/tracker-server.log</entry>

    <entry key='event.enable'>true</entry>
    <entry key='processing.computedAttributes.enable'>true</entry>

    <entry key='media.path'>./media</entry>

    <entry key='server.statistics'>https://www.traccar.org/analytics/</entry>

And this is my traccar.xml config

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!--

    This is the main configuration file. All your configuration parameters should be placed in this file.

    Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
    with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.

    For list of available parameters see following page: https://www.traccar.org/configuration-file/

    -->

    <entry key="config.default">./conf/default.xml</entry>

    <entry key='database.driver'>org.postgresql.Driver</entry>
    <entry key='database.url'>jdbc:postgresql://127.0.0.1:5432/xxx</entry>
    <entry key='database.user'>xxx</entry>
    <entry key='database.password'>xxxx</entry>

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.url'>http://my_ip/reverse.php</entry>

</properties>
Anton Tananaev7 years ago

Looks fine to me. This is what I have on one of my servers:

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.url'>http://***/nominatim/reverse.php</entry>
brm7 years ago

I will continue to do more tests, thanks for your help.