reverse geocoding full address issue

bsaggarwal6 years ago

HI Anton
I am using Google reverse geocoding and i do not see complete address ( i see only city,state and country) being populated.. Somehow i suspect that server is not sending the full lat/long request to geocoder.
as an example i see below in logs where only 7 digits are used for lat long
also refer to attached screenshot for decoding seen on traccar vs decoding done using same lat/long using another site.
https://www.dropbox.com/s/4lmr5ts2baso7yd/Atribute-%20address%20display.JPG?dl=0
Can you suggest what could be issue?

Below logs from traccar server.

2018-10-19 10:58:49 DEBUG: [56586fee: 5013 > 42.111.11.90] HEX: 2a48512c363137303737343230302c56342c56312c323031383130313930353238343923
2018-10-19 10:58:49  INFO: [56586fee] id: 6170774200, time: 2018-10-19 10:54:58, lat: 28.50746, lon: 77.40906, speed: 14.2, course: 98.0
Anton Tananaev6 years ago

Seven digits should be more than enough. As for address, you need to check address format configuration.

bsaggarwal6 years ago

i have below in my config
<entry key='geocoder.format'>%h %r, %t, %s, %c</entry> still nothing.

Also one more observation..for osmand protocol , it shows automatic reverse geocode ( though only country, state and city only)
for H02 protocol i always get "show Address" and when i click on it i again get country, state and city only.

any suggestion?

Turbovix6 years ago

I suggest you see this case here, I have modified the sources for my need and it works perfectly.

https://github.com/traccar/traccar/pull/3689

Another thing, test with this URL + your Google api key to see what address information you need to actually show.

https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key="YOU API KEY"

bsaggarwal6 years ago
{
   "plus_code" : {
      "compound_code" : "GC45+XJ Noida, Uttar Pradesh, India",
      "global_code" : "7JWVGC45+XJ"
   },
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Noida",
               "short_name" : "Noida",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Uttar Pradesh",
               "short_name" : "UP",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "India",
               "short_name" : "IN",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "201306",
               "short_name" : "201306",
               "types" : [ "postal_code" ]
            }
         ],
         "formatted_address" : "GH -07 B Sector - 137, Noida, Uttar Pradesh 201306, India",
         "geometry" : {
            "location" : {
               "lat" : 28.5075563,
               "lng" : 77.4088472
            },
            "location_type" : "GEOMETRIC_CENTER",
            "viewport" : {
               "northeast" : {
                  "lat" : 28.5089052802915,
                  "lng" : 77.41019618029151
               },
               "southwest" : {
                  "lat" : 28.50620731970849,
                  "lng" : 77.40749821970849
               }
            }
         },
         "place_id" : "ChIJGyQv7PboDDkRk7WCV_rXmnk",
         "plus_code" : {
            "compound_code" : "GC55+2G Noida, Uttar Pradesh, India",
            "global_code" : "7JWVGC55+2G"
         },
         "types" : [ "establishment", "general_contractor", "point_of_interest" ]
      },
      ...
   ],
   "status" : "OK"
}
bsaggarwal6 years ago

i am not sure how to handle this but when i use your provide google api ..above is what i get ..however traccar only stores below info

"address_components" : [
{
"long_name" : "Noida",
"short_name" : "Noida",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Uttar Pradesh",
"short_name" : "UP",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "India",
"short_name" : "IN",
"types" : [ "country", "political" ]
},
{
"long_name" : "201306",
"short_name" : "201306",
"types" : [ "postal_code" ]
bsaggarwal6 years ago

i could work it around by using %f in geocoder format and removing all other arguments. but the issue is ..
it also list other addresses returned by google. is their a way to truncate the others?

Anton Tananaev6 years ago

Not as far as I know.

bsaggarwal6 years ago

Can google geocoder be improved to send more latlong digits to get better result?

Anton Tananaev6 years ago

Traccar already uses all available accuracy. There is no limit on number of digits.

bsaggarwal6 years ago

but then do you know whats the issue in my case?
as i see only below

 "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Noida",
               "short_name" : "Noida",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Uttar Pradesh",
               "short_name" : "UP",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "India",
               "short_name" : "IN",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "201306",
               "short_name" : "201306",
               "types" : [ "postal_code" ]
            }
Anton Tananaev6 years ago

It's something you should be asking your geocoding provider.

bsaggarwal6 years ago

i have other formatted address as well in the response.. can traccar not use them incase road and house info is not available in response.
like in example of "turbovix" to use ROOFTTOP.

"formatted_address" : "GH -07 B Sector - 137, Noida, Uttar Pradesh 201306, India","