reverse: avoid interpolation lookup when result is already perfect

This commit is contained in:
Sarah Hoffmann
2025-12-04 21:21:47 +01:00
parent 6b12501c7a
commit b366b9df6f

View File

@@ -340,7 +340,9 @@ class ReverseGeocoder:
# Check for an interpolation that is either closer than our result
# or belongs to a close street found.
if self.max_rank > 27 and self.layer_enabled(DataLayer.ADDRESS):
# No point in doing this when the result is already inside a building,
# i.e. when the distance is already 0.
if self.max_rank > 27 and self.layer_enabled(DataLayer.ADDRESS) and distance > 0:
log().comment('Find interpolation for street')
addr_row = await self._find_interpolation_for_street(parent_place_id,
distance)