osm-search / Nominatim

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

Enhace Name parsing to take account of special characters #828

Closed pierzen closed 6 years ago

pierzen commented 6 years ago

in Issue https://github.com/openstreetmap/Nominatim/issues/413#issuecomment-338895627 @lonvia indicates that hyphens are not taken into account into for Nominatim search. The hyphen (with no spaces between two words) is part of official names for street names in french. But looking more closely, I find also hypenated names in Spain, Portugal, Switzerland, Belgium, Nederland, Germany, Malta, Egypt, Turkiye, Thailand, Indonesia, Philippines, Brazil.

It is often difficult to search names with hyphen through Nominatim.

Try to find «Rue de la Fleur-de-Lys, Saint-Jean-sur-Richelieu» without providing the exact wording. Nominatim Search for either «rue fleur-de-Lys, Saint-Jean-sur-Richelieu» or «fleur-de-lys, Saint-jean-sur-richelieu» returns no result.

No Search result for : «saint-simon, paris, france» returns everything except «Rue Saint-Simon». «Embajadores-Acacias, Madrid» do not return «Enlace Embajadores-Acacias» «Carrer d'Antoine de Saint-Exupéry, Barcelona, Spain» or «Saint-Exupéry, Barcelona, Spain» returns nothing (way id="20413488"). but Search for «Exupéry, Barcelona, Spain» returns «Carrer d'Antoine de Saint-Exupéry, Barcelona, Spain». «barthelemy-menn, geneve» returns correctly « Rue Barthélemy-Menn». «Puig-reig, Sant Gervasi» returns correctly «Carrer de Puig-reig, Sant Gervasi, Spain». «Husted-Andersen, Lisboa» returns «Rua Stig Husted-Andersen, Lisboa»

Why hyphen are excluded ? Are they simple solutions to correct this at least partially. Could we take into account names with hyphen with no spaces between words ?

For names like rue Saint-Simon, If words like «saint» are ignored, the first search step should consider keeping in this example «Saint-Simon».

lonvia commented 6 years ago

As you have already noticed, your example have little to do with special characters like the hyphen. If that was the case «Rue de la Fleur-de-Lys, Saint-Jean-sur-Richelieu» wouldn't return a result either.

All your examples have in common that they search for a partial name instead of the exact name that was noted in OSM. It is a known issue that Nominatim is notoriously bad at that. But the issue is sufficiently covered in other tickets already (e.g. #104, #753, #702, #679), so closing here.

honoref commented 6 years ago

When I search "école primaire mermoz", I found it in Marseille city, but when I search "école primaire mermoz Marseille" or "école primaire mermoz 13008 Marseille", there's not result. When I activate debug mode, I have many times (for each results ?) same warnings :

Notice: Undefined index: fLat in /srv/nominatim/Nominatim-3.0.1/lib/lib.php on line 566
Notice: Undefined index: fLon in /srv/nominatim/Nominatim-3.0.1/lib/lib.php on line 567
Notice: Undefined index: fRadius in /srv/nominatim/Nominatim-3.0.1/lib/lib.php on line 568

Is there a mistake with my installation ? I only used a extract of Marseille and surrounding cities (pbf from mapzen, wikipedia_redirect.sql.bin and wikipedia_article.sql.bin)

BR

mtmail commented 6 years ago

@honoref If you still see the same error, can you submit a new issue? Comments on already closed issues get lost because they don't show up in the active issue list (https://github.com/openstreetmap/Nominatim/issues)