Hello,
I would like to know why some request with CLGeocoder().reverseGeocodeLocation succeeded, but do not give us the right information and enough information as far as the address, zipcode...are concerned ?
Exemple :
Search zipCode of Pointe-à-Pitre in Guadeloupe
1-
give us the "place_id": "ChIJBRWixeNFE4wRY2Ax28N7gRE"
2 - with the given place_id get details
give us latitude and longitude
let loc: CLLocation = CLLocation(latitude: -16.237687, longitude: -61.534042)
3 -
let loc: CLLocation = CLLocation(latitude: -16.237687, longitude: -61.534042)
CLGeocoder().reverseGeocodeLocation(loc, completionHandler: {(placemarks, error)->Void in
if (error != nil) {
print("Reverse geocoder failed with error" + (error?.localizedDescription)!)
return
}
if (placemarks?.count)! > 0 {
let pm = placemarks?[0]
self.displayLocationInfo(pm)
} else {
print("Problem with the data received from geocoder")
}
})
Error is nil, we got one placemark but :
First the (pm as! CLPlacemark).addressDictionary["Country"] = "Bolivie" wich is wrong
Then we do not have any information about
(pm as! CLPlacemark).locality, (pm as! CLPlacemark).postalCode wich are nil
Is there restriction or limit with using CLGeocoder().reverseGeocodeLocation ? Do we have any other solution or free APIs in this case ?
Thank you very much for any response.