traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
5.14k stars 2.56k forks source link

Nominatim Help #2940

Open wolfbgn opened 7 years ago

wolfbgn commented 7 years ago

Hello, Mr.Tananaev. I run Debian 8.7, Nginx 1.6, Traccar 2.12 with traccar-web. Every thing works perfectly with the provided url address of Nominatim server in the configuration file. I get the addresses right and displayed in Bulgarian. Recently I installed Nominatim 2.5 and Traccar 3.9. They are on the same machine. When I point my browser to 192.168.1.100/nominatim/ I am able to connect and view the page. In the upper right corner is "reverse search". When I press it I get http://192.168.1.100/nominatim/reverse.php?format=html. I assume Nominatim works. Traccar 2.12 does not display address with my instance of Nominatim. With url of nominatim server in original file provided by you it works. Traccar 3.9 does not display address with my instance of Nominatim. With google it works. With my server - no. I tried with url of nominatim server which works with 2.12 but it does not work either. Settings in default.xml

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

I do not know what other settings to check for reverse geocoding.

tananaev commented 7 years ago

If you try it on 3.10 and it doesn't work, it should print some more details about the error in the logs.

wolfbgn commented 7 years ago

Traccar 3.10 log:

2017-02-21 11:13:37  WARN: Geocoding failed - Unexpected char 69 at (line no=1, column no=1, offset=0) - JsonParsingExc$
tananaev commented 7 years ago

It means that geocoder returned an invalid response.

wolfbgn commented 7 years ago

Any suggestions what I should do?

tananaev commented 7 years ago

I'm not sure, but you can probably find out by sending a request yourself from browser.

wolfbgn commented 7 years ago

http://localhost/nominatim/reverse.php?format=html&lat=43&lon=28&zoom=18 returns:

Варна, Varna Region, 9000, България (City)
43.2166104,27.9017131

http://localhost/nominatim/reverse.php?format=json&lat=43&lon=28&zoom=18 returns:

EOF
{"place_id":"100175","licence":"Data © OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"31058194","lat":"43.2166104","lon":"27.9017131","display_name":"Варна, Varna Region, 9000, България","address":{"city":"Варна","county":"Varna Region","postcode":"9000","country":"България","country_code":"bg"}}

http://localhost/nominatim/reverse.php?format=xml&lat=43&lon=28&zoom=18 returns:

This page contains the following errors:

error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
tananaev commented 7 years ago

What does the EOF mean in JSON output?

wolfbgn commented 7 years ago

I do not know. I just copied and pasted what the page dispalays.

tananaev commented 7 years ago

Maybe that's your problem. It's not a valid JSON.