osm-search / Nominatim

Open Source search based on OpenStreetMap data
https://nominatim.org
GNU General Public License v3.0
3.05k stars 712 forks source link

Hundreds of highways are not found #3164

Closed pathmapper closed 1 year ago

pathmapper commented 1 year ago

What did you search for?

https://nominatim.openstreetmap.org/ui/search.html?q=Hauptstra%C3%9Fe

What result did you get?

Only two highways in the US:

What result did you expect?

A lot more results, there are hundreds of highways with the name "Hauptstraße" in Germany.

When the result missing completely:

e.g.

Further details

https://github.com/osm-search/Nominatim/issues/3163 is maybe related.

mtmail commented 1 year ago

Returning 10.000 streets, each about as relevant to the search as the next, hardly helps the users, does it? You need to limit the search more, e.g. the viewbox or bounds. If you want to fetch a list of all streets by that name from OSM data then the Overpass API might be better here.

pathmapper commented 1 year ago

Returning 10.000 streets, each about as relevant to the search as the next, hardly helps the users, does it?

Sure, the sample query was made as simple as possible to show the issue, however https://nominatim.openstreetmap.org/ui/search.html?q=Hauptstra%C3%9Fe should return 10 Features, because the default for limit=10: -> https://nominatim.org/release-docs/latest/api/Search/#result-limitation

You need to limit the search more, e.g. the viewbox or bounds.

This doesn't help - this returns also only the two results from US:

https://nominatim.qgis.org/search?format=json&addressdetails=1&viewbox=6.29727,51.22255,6.7224,51.2762&q=hauptstraße

Expected is e.g. https://www.openstreetmap.org/way/144321199#map=18/51.25409/6.39238

If you want to fetch a list of all streets by that name from OSM data then the Overpass API might be better here.

Sure, but usecase here is a simple search for a streetname within a certain area.

lonvia commented 1 year ago

When holding talks about geocoding, I like to use the example of searching for 'Hauptstr' or 'main st' in the section of the talk that warns about nonsense queries with the potential to kill your service. When you don't get many results when searching for 'hauptstr', then this is the code that protects the geocoder from the user. It works as intended. If you do get results for 'Grefrath Dorfstr', then that is unexpected collateral damage of the same code and needs fixing.

Closing here.

pathmapper commented 1 year ago

Thanks for clarifying!

Sorry, bad sample query from my side. As mentioned above

usecase here is a simple search for a streetname within a certain area

e.g. a query for Hauptstraße Mönchengladbach returns no results (should return https://www.openstreetmap.org/way/1110548095).

https://nominatim.openstreetmap.org/ui/search.html?q=Hauptstra%C3%9Fe+M%C3%B6nchengladbach&countrycodes=de

but I guess this is also the mentioned "unexpected collateral damage".