Improved location name reverse geocoding function