pelias / api

HTTP API for Pelias Geocoder
http://pelias.io
MIT License
218 stars 162 forks source link

Region not returned in results for Algeria (DZ) if using multiple layers #1628

Closed YanDjin closed 1 year ago

YanDjin commented 1 year ago

I am doing a Pelias build for Algeria, in Algeria, the same name is used for the region and the main city in the region. For example, the region Jijel has a city also named Jijel (the biggest city in the region). When using the pelias build, if I search for a region, only the city (locality) named the same will appear in the result and the region will be absent, but if I specify to use only the region layer, then the result will be correct, and I will have the region. Specifying other layers will remove the region from the results. I also reproduced the same behavior in the mapzen online demo, so I don't think it has to do with my installation.

Steps to Reproduce

Expected behavior

Environment (please complete the following information):

Pastebin/Screenshots

missinglink commented 1 year ago

Hi @YanDjin, this behavior is intentional. It's fairly common around the world (ie. NY county, city, state), Luxemburg, Singapore etc.

We've had numerous issued filed over the years about insufficient deduplication in these cases, most end users expect a similar experience as the fortune 100 mapping providers, which also 'squash' similarly named entries like we do.

There is a ruleset in the code which defines which layer gets priority, it's usually the locality, as that's usually what the user is searching for.

YanDjin commented 1 year ago

Hi @missinglink, thanks for the reply, and sorry for the late reply, Thank you for your insight, I modified the ruleset for my use case. I will close this PR.