The closest object for reverse lookups is determined via the distance between query point and object. This automatically makes area POIs win when the lookup point is inside because then the distance is 0.
This PR tries to somewhat improve the situation by looking for the two closest objects and returning the second if the first is an area and the second is a POI node that is reasonably close.
There are some corner cases that this hack doesn't cover, for example when another street happens to be closer than the point POI. These cases are anyways tricky and probably better solved by returning multiple results. The generic case of a large POI area like a shopping mall should work better with this change.
The closest object for reverse lookups is determined via the distance between query point and object. This automatically makes area POIs win when the lookup point is inside because then the distance is 0.
This PR tries to somewhat improve the situation by looking for the two closest objects and returning the second if the first is an area and the second is a POI node that is reasonably close.
There are some corner cases that this hack doesn't cover, for example when another street happens to be closer than the point POI. These cases are anyways tricky and probably better solved by returning multiple results. The generic case of a large POI area like a shopping mall should work better with this change.
See also #2785 and #3387.