Using Photon Geocoder with Traccar [WORKING]

Anto2 years ago

Photon is an elasticsearch based open source geocoder which I found is one of the best open-source Geocoders.
I've managed to integrate the same with Traccar server. Since the protocol is similar to BAN (Base Adresse Nationale), a slight modification to the BanGeocoder.java file could get the job done and the steps are as follows:

  1. Install Photon on your local server by following this link.

  2. Add the following parameters to traccar.xml file

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>ban</entry>
  1. Replace https://api-adresse.data.gouv.fr/reverse/?lat=%f&lon=%f from BanGeocoder.java Line 30 with http://localhost:2322/reverse/?lat=%f&lon=%f

  2. Remove line 41 address.setCountry("FR"); from BanGeocoder.java

  3. Build and assemble traccar server to create a new tracker-server.jar file

  4. Stop the traccar server

  5. Replace the tracker-server.jar file with the newly created one.

  6. Restart the traccar server

Hope this helps!