Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse geocoding does not return amenities, only adresses #2785

Closed
Juanjo-MC opened this issue Jul 31, 2022 · 6 comments
Closed

Reverse geocoding does not return amenities, only adresses #2785

Juanjo-MC opened this issue Jul 31, 2022 · 6 comments

Comments

@Juanjo-MC
Copy link

What did you search for?

https://nominatim.openstreetmap.org/reverse?lat=50.8973333&lon=4.3578048

What result did you get?

The address of those coordinates

What result did you expect?

I expected to see, in addition to the address, the name and info of the amenity located there (B Event caterer), see here: https://nominatim.openstreetmap.org/ui/search.html?q=B+Event
It seems to me that it worked that way before.

Further details

May it be related to #2683, which is now solved?

@lonvia
Copy link
Member

lonvia commented Jul 31, 2022

The house (with only the address) and the craft node are exactly the same distance from the lookup point. Which one of the two is returned is pretty much random. As soon as you are slightly away from the location of the craft node, the building polygon will always be closer.

@Juanjo-MC
Copy link
Author

The house (with only the address) and the craft node are exactly the same distance from the lookup point.

Not sure I understand.
If you look at the reverse geocoding request I made, I passed to it the exact same coordinates than the forward one gave me for that POI. In that case the distance between the craft POI and the lookup point should be zero, no?

@lonvia
Copy link
Member

lonvia commented Jul 31, 2022

In that case the distance between the craft POI and the lookup point should be zero, no?

Yes it is. But so is the distance between the lookup point and https://www.openstreetmap.org/way/252972065. They are the same, namely 0. Thus whatever PostgreSQL decides to return first wins. We only order by distance and there is nothing in the query that would help decide which result should be preferred.

@lonvia
Copy link
Member

lonvia commented Aug 7, 2022

I've given this some more thought and can't come up with any particular reason to chose one order over another. So lets approach this from another direction: @Juanjo-MC could you explain, why exactly it is a problem for you that the house is returned instead of the caterer? What were you trying to achieve?

@Juanjo-MC
Copy link
Author

What were you trying to achieve?

Nothing in particular

could you explain, why exactly it is a problem for you that the house is returned instead of the caterer?

Well, it is not really a problem. I seem to remember that, in previous versions, if there was an amenity at the same address Nominatim was returning it. But it might be that I am wrong.

@lonvia
Copy link
Member

lonvia commented Aug 7, 2022

We might have ordered by distance to the center of the building previously instead of the full building outline. But doing that comes with its own issues. One could argue that a node or a way should be preferred over an area when the distance is equal but that would only solve the case, where the location hits the amenity node exactly. Not too good either.

There are two related feature requests which could 'solve' this problem: #1469 asks to have a mode to return addresses only, which probably will be flexible enough to also have amenity-only. #1580 asks for multiple results, which would solve the issue by returning both amenity and address.

I'm closing this one as a "won't fix".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants