[Photon] Location bias and typo tolerance

Geneviève Bastien genevieve.bastien at polymtl.ca
Wed Mar 9 15:06:57 UTC 2022


Hi photon community!

I'm on a journey to convince partner organisations to invest in 
OpenStreetMap data instead of spend on Google API. We need to prove that 
there's a way to query openStreetMap data with similar results as 
Google. Photon looks very much this tool, it works great for most queries.

But since our application will be public facing, the query tool needs to 
be typo tolerant and still return expected result. Here's one example 
where results are unexpected:

Let's say the map is centered around Montréal and we're looking for a 
'Jean coutu' pharmacy. The following query without typo works fine:

https://photon.komoot.io/api/?q=jean 
coutu&limit=5&lat=45.52294660989206&lon=-73.62765846541139

Now, if we make a typo in 'jean coutu' and write 'jean couti' instead, 
I'd expect to get some of the results from the first query:

https://photon.komoot.io/api/?q=jean 
couti&limit=5&lat=45.52294660989206&lon=-73.62765846541139

Yet it rather returns exact matches in France, thousands of kilometers 
away. And no matter if I set the `zoom` or `location_bias_scale` 
parameters. On my local instance with only Quebec data, then I get the 
expected result as the exact matches are not in the database. The query 
seems to prefer exact matches, even if they are far away, rather than 
close matches, closer to the location.

I would expect results to be weighted by closeness to the queried 
string, but also by proximity to the location, such that the returned 
results would contain the locations with typo close by, and exact 
matches only if they are not too far away.

Are my expectations correct? Is there any parameter I can tweak to 
achieve this? If desirable, I can contribute this feature.

Thanks for the great work!

Geneviève




More information about the Photon mailing list