Issue when inserting address data in mysql

Parth5 years ago

Hello Anton,

We are using nominatim reverse geocoding deployed on out server and for some position we are getting the error regarding address insert for some device position.

Error in tracker log:

290942552:2019-06-25 07:37:08  INFO: [78fd7d3e] id: 358735070824619, time: 2019-06-25 07:03:58, lat: 26.95621, lon: 79.04813, speed: 8.1, course: 324.0
290942694-2019-06-25 07:37:08  INFO: [78fd7d3e: gt06 > 27.97.137.17] HEX: 787805120000a2a40d0a
290942779-2019-06-25 07:37:08  WARN: Failed to store position - Incorrect string value: '\xC4\x81o, U...' for column 'address' at row 1 - SQLException (... < QueryBuilder:480 < DataManager:458 < DefaultDataHandler:40 < ...)

Data of reverse geo-coding extracted from browser:

<reversegeocode timestamp="Tue, 25 Jun 19 07:57:30 +0000" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" querystring="&lat=26.95680&lon=79.04763">
<result place_id="2005249" osm_type="way" osm_id="457921312" ref="Agra - Lucknow Expressway" lat="26.9587052936401" lon="79.0482149371535" boundingbox="26.9498775,26.9997809,78.9825029,79.0771195">
Agra - Lucknow Expressway, Saifai, Etāwah, Etawah, Uttar Pradesh, 205264, India
</result>
<addressparts>
<road>Agra - Lucknow Expressway</road>
<village>Saifai</village>
<county>Etāwah</county>
<state_district>Etawah</state_district>
<state>Uttar Pradesh</state>
<postcode>205264</postcode>
<country>India</country>
<country_code>in</country_code>
</addressparts>
</reversegeocode>

My server SQL settings:

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost:3306/traccar?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>root</entry>
    <entry key='database.password'>*********</entry>

I know you have suggested me to search through but i didn't find any solution that solve my issue.

Can you help me to resolve the issue?

Thank you.

Tony Shelver5 years ago

Totally off the top of my head, and probably not the answer, but I recently saw a post re Nominatim geocoding where it was necessary to supply the geocoder format to return the expected data. Look at https://www.traccar.org/configuration-file/ for the options

Also, maybe try another geocoder to see if you are getting the same results.

Parth5 years ago

Hello Tony,

I have configured the geocoder format as below,

    <entry key='geocoder.type'>nominatim</entry>
    <entry key="geocoder.format">%f</entry>

The issue is not with all the position data. For some lat-long, the nominatim return some of the non UTF8 as mentioned above. On that instant the mysql position insert fails. So for that i am looking for the changes that i need to manage the scenario.

Thanks for the help.

Regards.

Tony Shelver5 years ago

Parth, not sure where that goes. Are you wedded to MySQL and Nominatim, or is trying another DB like Postgres or another geocoder a possibility?
Also, does the default format return data incorrectly for your purposes?