vitalidze / traccar-web

Traccar Web UI mod
http://traccar.litvak.su/
151 stars 145 forks source link

Nominatim Help #1070

Open wolfbgn opened 7 years ago

wolfbgn commented 7 years ago

Hi, Vitalidze. 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. It is 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. Original http://nominatim.openstreetmap.org/reverse Well I tried different addresses but I can not get it working with my Nominatim server. http://192.168.1.100/nominatim/reverse.php? http://localhost/nominatim/reverse.php? http://192.168.1.100/nominatim/ http://localhost/nominatim and many more. I am lost. Please help.

vitalidze commented 7 years ago

This URL should work: http://localhost/nominatim/reverse.php

Have you loaded mapping data to your nominatim instance?

To check the correct work you may perform some test query like this:

http://localhost/nominatim/reverse.php?format=json&lat=55.751244&lon=37.618423&zoom=18&addressdetails=1

This is the exact format traccar uses for querying nominatim services. You can put your own lat/lon pair instead of mine.

wolfbgn commented 7 years ago
<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.type'>nominatim</entry>
<entry key='geocoder.url'>http://localhost/nominatim/reverse.php</entry>

It is not working.

http://192.168.1.100/nominatim/reverse.php?format=json&lat=43&lon=28&zoom=18&addressdetails=1 Output: 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"}} I have Bulgaria only.

vitalidze commented 7 years ago

Looks like your set up is performed correctly. This address will appear for new positions only, have you checked new positions? Have you restarted service after making these changes? Also it makes sense to check tracker-server.log for error messages.

wolfbgn commented 7 years ago

With these settings I get: 2017-02-21 08:47:51 DEBUG: [74ABE881: 5055 -> 192.168.1.6] - HEX: 485454502f312e3120323030204f4b0d0a0d0a 2017-02-21 08:47:51 INFO: Closing connection by disconnect 2017-02-21 08:47:51 WARN: Content is not allowed in prolog. - org.xml.sax.SAXParseException (DOMParser.java:257) 2017-02-21 08:47:51 INFO: device: 1, time: Tue Feb 21 08:47:55 EET 2017, lat: 43.223483, lon: 27.944801

wolfbgn commented 7 years ago

If I put http://localhost/nominatim/reverse I get 2017-02-21 09:06:33 DEBUG: [F9634D45: 5055 -> 192.168.1.6] - HEX: 485454502f312e3120323030204f4b0d0a0d0a 2017-02-21 09:06:33 INFO: Closing connection by disconnect 2017-02-21 09:06:33 WARN: http://localhost/nominatim/reverse?format=xml&lat=43.223517&lon=27.944761&zoom=18&addressdetails=0 - java.io.FileNotFoundException (HttpURLConnection.java:1872) 2017-02-21 09:06:33 INFO: device: 1, time: Tue Feb 21 09:06:37 EET 2017, lat: 43.223517, lon: 27.944761

vitalidze commented 7 years ago

Hold on, you are using 2.12, which expects response to be in XML format. So the request must be something like this: http://localhost/nominatim/reverse.php?format=xml&lat=43.223517&lon=27.944761&zoom=18&addressdetails=0 (please note that URL must end with .php, like .../reverse.php). However, your version of nominatim seems to not support the XML format. Probably you need to install older version, or upgrade your traccar to the 3.0 version, which is working with JSON.

wolfbgn commented 7 years ago

I will install latest version of Traccar and update you. Thank you very much.

wolfbgn commented 7 years ago

Traccar 3.9 with traccar-web - still no address 2017-02-21 09:51:00 DEBUG: [AEFB5A78: 5055 < 192.168.1.6] HEX: 474554202f3f69643d3434343434342674696d657374616d703d31343837363633343635266c61743d34332e323233353333266c6f6e3d32372e3934343636382673706565643d302662656172696e673d3026616c7469747564653d3131382e303426626174743d383920485454502f312e310d0a486f73743a203139322e3136382e312e38313a353035350d0a4163636570743a202a2f2a0d0a4163636570742d4c616e67756167653a2062672d62670d0a436f6e6e656374696f6e3a206b6565702d616c6976650d0a4163636570742d456e636f64696e673a20677a69702c206465666c6174650d0a557365722d4167656e743a2054726163636172436c69656e742f342e302043464e6574776f726b2f3830382e332044617277696e2f31362e332e300d0a0d0a 2017-02-21 09:51:00 DEBUG: [AEFB5A78: 5055 > 192.168.1.6] HEX: 485454502f312e3120323030204f4b0d0a436f6e74656e742d4c656e6774683a20300d0a0d0a 2017-02-21 09:51:01 INFO: [AEFB5A78] id: 444444, time: 2017-02-21 09:51:05, lat: 43.22353, lon: 27.94467, speed: 0.0, course: 0.0

vitalidze commented 7 years ago

Well, you need to check your configuration parameters. It should be working with the request from my first reply.

wolfbgn commented 7 years ago

With google it works. With my server - no. 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.

vitalidze commented 7 years ago

I am out of ideas. Have you tried plain traccar installation without Traccar Web UI Mod? If yes, then please try asking same question on "backend" issue tracker https://github.com/tananaev/traccar/issues

wolfbgn commented 7 years ago

Thank you

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$

vitalidze commented 7 years ago

Probably the reason is that your server prints EOF line in response as said in https://github.com/tananaev/traccar/issues/2940. You should try figuring out why the response looks like this, ask nominatim support, or maybe upgrade/downgrade your nominatim server.