Closed guitoon closed 1 year ago
A PR (#1174) is ready that should solve this issue!
{
"results" : [
{
"address_components" : [
...
{
"long_name" : "Wayaux",
"short_name" : "Wayaux",
"types" : [ "political", "sublocality", "sublocality_level_1" ]
},
{
"long_name" : "Les Bons Villers",
"short_name" : "Les Bons Villers",
"types" : [ "political", "sublocality", "sublocality_level_1" ]
},,
...
],
"formatted_address" : "Rue de Pont-à-Migneloux, 6210 Les Bons Villers, Belgique",
...
}
],
"status" : "OK"
}
In this case, it will combine the 2 sublocality_level_1
and return Wayaux / Les Bons Villers
as SubLocality Level 1 (see tests).
Nice, thank you
hey guys this bug is still hapenning.
Just try to reverse these coordinates:
$lat = 22.63376;
$lng = 88.4147;
It will throw Geocoder\Exception\InvalidArgument
"Administrative level 3 is defined twice".
Because the address JSON contains:
{
"long_name" : "NDDM Ward No - 26",
"short_name" : "NDDM Ward No - 26",
"types" :
[
"administrative_area_level_3",
"political"
]
},
{
"long_name" : "North 24 Parganas",
"short_name" : "North 24 Parganas",
"types" :
[
"administrative_area_level_3",
"political"
]
},
And your fix doesn't help. Because the exception is thrown before withSubLocalityLevels()
call.
Any ideas how to fix it?
UPD in my local fork I've just removed this exception: https://github.com/lumiform/geocoder-php-common/commit/2ce26bd2465211bfceaf264fee998fc98b3c8a3b
It causes that the duplicate levels are ignored.
Hello, this fix remove double administrative area if they are the same. But I found an address on which Google give 2 different level 1 sublocality:
I this case, the geocoder give me the same error Administrative level 1 is defined twice
How can I solve this issue?