-
Notifications
You must be signed in to change notification settings - Fork 519
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
Nominatim geocoder - returns different results for postalcode before vs after city name #1114
Comments
Nominatim hasn't closed the issue, we locked further comments. |
It is not good to lock further comments. So people see you are not interested in solving it. |
We have received all information needed to investigate the issue. We will update the issue when there is progress. |
Hello @webprogrammierer, thanks for your "issue" but we do not tweak or change results returned by external APIs ; we just process the result returned by the API. You will need to wait for this "issue" to be "fixed" in Nominatim API itself. |
That being said address parsing is indeed REALLY difficult. In |
House number 9400? 9400 is the right postal code for Wolfsberg. So there is no reason to doubt, no reason for the software to do a second query. |
I think you did not understand the problem and how it could be solved. There is NO NEED to change results! The only thing to be done is to make correct queries: You can use the right syntax for the query. Instead of the free-form queries you can also use "Alternative query string format split into several parameters for structured requests", see here: So you have 2 ways to solve this. That is done in a few minutes and thousands of users will have a solution for a huge problem! Otherwise if you do not solve the problem, users will use Google API geocoder or other geocoders instead. So PLEASE rewrite the code and use the correct syntax for Nominatim search queries! So that it will work in all cases not only in some case as it does now. |
Maybe not in Austria but the goal of Nominatim is to work globally ...
You know that because you're a human with knowledge of postal code in Autria.
Where does this assessment come from ?
I'm well aware of the structured requests.
Even though at a personal level (as OSM contributor) I do understand what you're saying, the goal of this project is to provide an easy way to use ANY geocoding API (including Google's API). |
https://nominatim.org/release-docs/develop/api/Search/
Postalcode is the last value in the list! You have to keep the order if using a simple query q?=. I takes less than 5 minutes to find that out (order is important if the search is used for geocoding! or use structured query). Test it out and you will be convinced.
The changes in code should be done only here: If you make the changes in Nominatim this will not concern Google API. Why do you write such things if everyone can see how it is. If there is a problem that concerns millions of people in the world you should be able to find somebody to do this adaptions. |
In the Nominatim API documentation those are names of URL parameters. They can be in any order. Postalcode being last in the list has no significance. In the value "housenumber streetname" the order can be "streetname housenumber", too.
The issue is Nominatim software not interpreting the free form text (address) correctly. I think the git issue here can be closed, it's filed in osm-search/Nominatim#2167 and it will be solved eventually. But not within the 3 days you mentioned you need a solution. If you see another geocoder API interpreting the address better, every software uses different approaches, complexity and data, it's a good approach to use that geocoder API instead in the meantime. |
Thanks @mtmail for confirming what I thought. 👍 @webprogrammierer You can also use any other provider ; if you need to use OSM data, there are other providers based on OSM data (Geocode Earth, GraphHopper, Mapbox, OpenCage, Photon, ...). On a more personal note, using a tone in your message that is a bit less aggressive will probably make people more eager to help you. |
It would be great if YOU could tell the programmers of Nomnatim API to adapt the documentation, because we all (you and I) found out, the order of postalcode and city must be city -> postalcode. I do not understand, why you do not tell all people here, that you will solve the problem within 20 days instead of 3 days. This would be a great beginning and a great outlook for all who want correct coordinates using Nomnatim. |
There are about a dozons reactions and comments on this problem till now in two issue. The only thing that has been written is rejection. Please let us look further and tell us where and when this huge problem will be solved OR who from all the programmers will feel responsible to pursue the problem until it is resolved. Rejection is not the thing that should be posted here in such a case. Both, Nominatim and Nomanitim geocoder are not usable until this problem is solved. If that is know a solution is indispensible. A quick and every working solution could be to use the structured search. Please answer positive. |
The code of the Nominatim provider is located here : https://github.com/geocoder-php/Geocoder/tree/master/src/Provider/Nominatim and the main file is |
Thank you. On 84: public function geocodeQuery(GeocodeQuery $query): Collection { in the $query object the private $data value is empty ($query->__toString() or ->getAllData() ). So it is not possible to get the values of postalcode, city and the other address parts. $query only contains the search string in the private $text variable (->getText() ). But we need all the parts of the address in separate variables to rewrite search and us the structured search. Why do these address parts not exist in the query object? So we need to look for places in the code where we have access to all parts of address in separate variables. |
Please dive in our code a little bit more (or check how it's done in other providers), we have the |
Maybe you can write the patch for structured Nominatim search. You know the code very well. |
Maybe this is not an issue of geocode-php/nominatim-provider , it maybe an issue of Nominatim itself:
osm-search/Nominatim#2167
But Nominativ has closed the issue instead of solving the problem.
Please check the problem and example on osm-search/Nominatim#2167 and help to solve this problem.
Thank you.
The text was updated successfully, but these errors were encountered: