D
D
Dmitry2015-12-02 12:12:56
Google
Dmitry, 2015-12-02 12:12:56

What's wrong with Google's geocoder?

We encountered a problem in the operation of the Google geocoder:
Making a request to the geocoder:
Request: Vienna
Answer:

"address_components" : [
            {
               "long_name" : "Vienna",
               "short_name" : "Vienna",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Vienna",
               "short_name" : "Vienna",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "Austria",
               "short_name" : "AT",
               "types" : [ "country", "political" ]
            }
         ]

Request: Vienna, Stephansplatz 3
Reply:
"address_components" : [
            {
               "long_name" : "Saint Stephen's Cathedral",
               "short_name" : "Saint Stephen's Cathedral",
               "types" : [ "premise" ]
            },
            {
               "long_name" : "3",
               "short_name" : "3",
               "types" : [ "street_number" ]
            },
            {
               "long_name" : "Stephansplatz",
               "short_name" : "Stephansplatz",
               "types" : [ "route" ]
            },
            {
               "long_name" : "Innere Stadt",
               "short_name" : "Innere Stadt",
               "types" : [ "sublocality_level_1", "sublocality", "political" ]
            },
            {
               "long_name" : "Wien",
               "short_name" : "Wien",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Wien",
               "short_name" : "Wien",
               "types" : [ "postal_town" ]
            },
            {
               "long_name" : "Wien",
               "short_name" : "Wien",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "Austria",
               "short_name" : "AT",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "1010",
               "short_name" : "1010",
               "types" : [ "postal_code" ]
            }
         ]

Both requests are with language=en, and if you pay attention to locality, then when you request a city, one value, and when you request with a refinement to the address, then the locality is already different.
We have a multilingual application and we parse the answer from the Google geocoder. And the problem is, when a user adds a city to the system, the fields are added on the first request, and when an object is added in this city, the fields from the second response and, of course, they do not pass the test. Who faced and how did you solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2015-12-02
@freeExec

Everything is very simple, it seems to me. They just don't have localization for addresses. Therefore, the address is given in the local language. This can be seen if you replace the language with ru, then only country comes in Russian, everything else is as it is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question