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

postalcode before vs after city name returns different results #2167

Closed
webprogrammierer opened this issue Feb 14, 2021 · 6 comments
Closed

Comments

@webprogrammierer
Copy link

webprogrammierer commented Feb 14, 2021

What did you search for?

  1. https://nominatim.openstreetmap.org/ui/search.html?q=9400+Wolfsberg+AT

wrong result
https://nominatim.openstreetmap.org/ui/details.html?osmtype=N&osmid=4518553625&class=place

  1. https://nominatim.openstreetmap.org/ui/search.html?q=Wolfsberg+9400+AT

correct result
https://nominatim.openstreetmap.org/ui/details.html?osmtype=R&osmid=105954&class=boundary

What result did you get?

If searching for a City that there is in 2 different federal states (same name, different postalcodes):
We get a wrong result with free-form queries if the postalcode is entered before the city name:

  1. results in wrong coordinates, postalcode is provided but not used correctly in search
  2. results in correct coordinates

What result did you expect?

Searching for "9400 Wolfsberg AT" or "Wolfsberg 9400 AT" should both result in the same coordinates (Wolfsberg in Carinthia).

Further details

This problem also occurs when using the PHP packages "geocoder-php/nominatim-provider". It results in wrong coordinates, because there is no chance to change the word order of the query in the PHP script that uses the "geocoder-php/nominatim-provider" package.

That's why the problem should / must be solved by Nominatim directly.

Both searches 1) and 2) must result in right coordinates because the postalcode is entered corretly in both cases.

The same problem exists for a lot of cities (all cases where city have the same name!!!!).

Can you change / repair this?

@mtmail mtmail changed the title Wrong search results and wrong coordinates for cities with the same name: free-form queries, postalcode before city name postalcode before vs after city name returns different results Feb 14, 2021
@mtmail
Copy link
Collaborator

mtmail commented Feb 14, 2021

@webprogrammierer I added links to the wrong and correct result, just in case they change over time. If you're curious what happens in the background check the 'debug output' link on top of the result pages.

@webprogrammierer
Copy link
Author

Thank you.

Who can solve this problem?

If it is not solved within a few days I will have to use Google API instead.

@mtmail
Copy link
Collaborator

mtmail commented Feb 14, 2021

It's not a trivial issue to fix. If you're on such a strict timeline, it's better to select a different software.

@webprogrammierer
Copy link
Author

webprogrammierer commented Feb 14, 2021

Your free-form queries do not recognize which part of the search query is the postalcode? If not, it maybe not trivial. The postalcode is a number, 4 oder 5 digits for the most countries.

But if so it can be easy!

A lot of European countries are using this order:
postalcode city

So millions and millions of people are used to write the addresse in this order " ... postalcode city" and NOT like this "... city postalcode".

I do not understand why this problem was not solved many years ago.

@mtmail
Copy link
Collaborator

mtmail commented Feb 14, 2021

Thanks for your feedback. It's now in our issue tracker and we will do our best to fix it in coming Nominatim releases.

@osm-search osm-search locked as too heated and limited conversation to collaborators Feb 14, 2021
@osm-search osm-search unlocked this conversation Feb 14, 2021
lonvia added a commit to lonvia/Nominatim that referenced this issue Feb 16, 2021
Results where the housenumber was dropped are an unlikely result
when they refer to something other than a street. Therefore
increase their result rank so that other matches are tried first
before choosing them as a result.

Improves osm-search#2167.
@lonvia
Copy link
Member

lonvia commented Apr 14, 2022

This is not fixable. The two queries have a different interpretation in Nominatim. The first one is "find me a postcode 9400 that has Wolfsberg as address", the second is "find me a place called Wolfsberg near postcode 9400". So different results are to be expected.

@lonvia lonvia closed this as completed Apr 14, 2022
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

3 participants