I am using Google Geocoding API. I sent this request https://maps.googleapis.com/maps/api/geocode/json?language=IT&sensor=false&address=Laives+via+Aldo+Moro&components=locality%3ALaives%7Ccountry:IT&key= and I got this response
{
"results" :
[
{
"address_components" :
[
{
"long_name" : "Via Aldo Moro",
"short_name" : "Via A. Moro",
"types" :
[
"route"
]
},
{
"long_name" : "Laives",
"short_name" : "Laives",
"types" :
[
"administrative_area_level_3",
"political"
]
},
{
"long_name" : "Provincia autonoma di Bolzano - Alto Adige",
"short_name" : "BZ",
"types" :
[
"administrative_area_level_2",
"political"
]
},
{
"long_name" : "Trentino-Alto Adige",
"short_name" : "Trentino-Alto Adige",
"types" :
[
"administrative_area_level_1",
"political"
]
},
{
"long_name" : "Italia",
"short_name" : "IT",
"types" :
[
"country",
"political"
]
},
{
"long_name" : "39055",
"short_name" : "39055",
"types" :
[
"postal_code"
]
}
],
"formatted_address" : "Via Aldo Moro, 39055 Laives BZ, Italia",
"geometry" :
{
"bounds" :
{
"northeast" :
{
"lat" : 46.4439301,
"lng" : 11.3481094
},
"southwest" :
{
"lat" : 46.4417517,
"lng" : 11.3474415
}
},
"location" :
{
"lat" : 46.4428577,
"lng" : 11.3478116
},
"location_type" : "GEOMETRIC_CENTER",
"viewport" :
{
"northeast" :
{
"lat" : 46.4441898802915,
"lng" : 11.3491244302915
},
"southwest" :
{
"lat" : 46.4414919197085,
"lng" : 11.3464264697085
}
}
},
"place_id" : "ChIJIbPfKm2dgkcRAfEP8m_OV7M",
"types" :
[
"route"
]
}
],
"status" : "OK"
}
But if I add the street address to the request the response is
{
"results" :
[
{
"address_components" :
[
{
"long_name" : "7",
"short_name" : "7",
"types" :
[
"street_number"
]
},
{
"long_name" : "A.-Moro-Straße",
"short_name" : "Via A. Moro",
"types" :
[
"route"
]
},
{
"long_name" : "Steinmannwald",
"short_name" : "Steinmannwald",
"types" :
[
"locality",
"political"
]
},
{
"long_name" : "Leifers",
"short_name" : "Leifers",
"types" :
[
"administrative_area_level_3",
"political"
]
},
{
"long_name" : "Autonome Provinz Bozen - Südtirol",
"short_name" : "BZ",
"types" :
[
"administrative_area_level_2",
"political"
]
},
{
"long_name" : "Trentino-Alto Adige",
"short_name" : "Trentino-Alto Adige",
"types" :
[
"administrative_area_level_1",
"political"
]
},
{
"long_name" : "Italia",
"short_name" : "IT",
"types" :
[
"country",
"political"
]
},
{
"long_name" : "39055",
"short_name" : "39055",
"types" :
[
"postal_code"
]
}
],
"formatted_address" : "A.-Moro-Straße, 7, 39055 Leifers, Autonome Provinz Bozen - Südtirol, Italia",
"geometry" :
{
"location" :
{
"lat" : 46.4422716,
"lng" : 11.3480794
},
"location_type" : "ROOFTOP",
"viewport" :
{
"northeast" :
{
"lat" : 46.44362238029149,
"lng" : 11.3493138302915
},
"southwest" :
{
"lat" : 46.44092441970849,
"lng" : 11.3466158697085
}
}
},
"navigation_points" :
[
{
"location" :
{
"latitude" : 46.4422735,
"longitude" : 11.3479417
}
}
],
"place_id" : "ChIJL7W80WydgkcRmjvzvuqFE70",
"plus_code" :
{
"compound_code" : "C8RX+W6 Laives BZ, Italia",
"global_code" : "8FRHC8RX+W6"
},
"types" :
[
"street_address"
]
}
],
"status" : "OK"
}
Why this difference even if the parameter language is set to IT? Why adding the street number changes the language returned?
Thanks.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4