Fix reverse geocoding issue

Previously, reverse geocoding queries in the Photon lookup did not properly
limit results within a specified search radius, leading to inaccurate or
unexpected locations being returned. This fix ensures that the :radius
parameter is passed directly, just like :limit and :distance_sort, instead
of being nested under :params.
By aligning with the Photon lookup implementation in Geocoder, this change
improves accuracy and ensures that results are correctly filtered based on
proximity, resolving issues where points were incorrectly matched due to
missing radius constraints.

Resolves: Reverse geocoding mismatch for close proximity queries
This commit is contained in:
Arne Schwarck 2025-01-25 22:11:35 +01:00 committed by GitHub
parent e5ee29617e
commit 908232d397
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,7 +96,7 @@ class ReverseGeocoding::Places::FetchData
end
def reverse_geocoded_places
data = Geocoder.search([place.latitude, place.longitude], limit: 10, distance_sort: true, params: { radius: 10 })
data = Geocoder.search([place.latitude, place.longitude], limit: 10, distance_sort: true, radius: 10)
data.reject do |place|
place.data['properties']['osm_value'].in?(IGNORED_OSM_VALUES) ||