Skip to content
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

Location Preference does not appear to be honored #198

Closed
dan-castle-rock opened this issue Oct 15, 2015 · 17 comments
Closed

Location Preference does not appear to be honored #198

dan-castle-rock opened this issue Oct 15, 2015 · 17 comments

Comments

@dan-castle-rock
Copy link

I am evaluating photon for use as an open source alternative and am not seeing the results I would expect with location biasing for a geocode request. The URL is passing in a latitude/longitude centered on Portland Oregon USA. When I enter a query such as 'bois', I would expect the results to include Boise, Idaho (which is nearby) to appear in the search results, but instead am receiving results from around the globe. Being new to this library, I could be doing something incorrectly.

The URL I am passing in is: http://photon.komoot.de/api/?q=bois&lat=45.52&lon=-122.6819

@christophlingg
Copy link
Member

Our location bias fosters results nearby but does not skip results that are far away. Exact matches (in this case with the french city Bois) are more important than partial matches (Boise). In the end the exact match overweights the benefit of the location bias and the french city appears first.

if you type the entire name it works: http://photon.komoot.de/api/?q=boise&lat=45.52&lon=-122.6819

@karussell
Copy link
Collaborator

I find this problematic too. It might related to #193

@dan-castle-rock
Copy link
Author

Thank you for the reply. I agree with Peter. For our application, location
biasing is more important than exact matching (as I suspect is true with a
lot of applications). As suggested in issue 193, are there any plans to add
a filter that would give more weight to location than exact name?

On Fri, Oct 16, 2015 at 1:44 AM, Peter notifications@github.com wrote:

I find this problematic too. It might related to #193
#193


Reply to this email directly or view it on GitHub
#198 (comment).


Dan Nichols
Mobile Software Developer
Castle Rock Associates

@christophlingg
Copy link
Member

Different uses cases require different location biases. I think it would make sense to have

  • a location bias that is controlled by an additional request parameter
  • an additional endpoint that returns entries only within a given radius. That's cool if you want to search for stuff that is nearby / in my city

@karussell
Copy link
Collaborator

maybe a new parameter like distance_filter=5km which directly filters instead of scores the results, would be sufficient and also usable in other situations.

@amnesia7
Copy link
Contributor

Or proximity.
Maybe it could apply extra weighting to those within the proximity requested but still allow global ones.

@amnesia7
Copy link
Contributor

Alternatively, what about following nominatim's design (http://wiki.openstreetmap.org/wiki/Nominatim#Parameters) that doesn't use lat,lng but instead uses viewbox (the preferred area to find search results) and bounded (restrict the results to only items contained with the bounding box).

@silberjan
Copy link

any clue when this will be implemented? for us the location biasing is also much more important than exact matches.

@christophlingg
Copy link
Member

I have it on my list, but there is a lot of other stuff too ;-( Can you help out?

@stephanebastian
Copy link

Hello,

I just stumbled across this issue and I am wondering if ElasticSearch function scoring would help here, adding more weight to result that are close to a specified location
just my 2 cents

@dmitry
Copy link

dmitry commented Aug 25, 2016

@stephane-bastian it could based on the distance and few other parameters.

@imadk
Copy link

imadk commented Dec 23, 2017

Hi Has this been implemented?

@karussell
Copy link
Collaborator

This should work now with #254

@kurko
Copy link

kurko commented Apr 16, 2018

Nope, that doesn't seem to be working after #254.

http://photon.komoot.de/api/?q=bois&lat=45.52&lon=-122.6819 doesn't return Boise, Idaho (not even with &limit=1000). I tried adding location_bias_scale=2 which returned:

{
  "message": "unknown query parameter 'location_bias_scale'. Allowed parameters are: [q, limit, distance_sort, osm_tag, lon, lang, lat]"
}

#254 was definitely deployed to photon.komoot.de (according to #295). Was location_bias_scale dropped but still documented in the README? Is lat/lon working at all?

@soualid
Copy link

soualid commented Aug 20, 2018

+1

@lonvia
Copy link
Collaborator

lonvia commented May 25, 2021

With #580 the example returns Boise in Oregon as expected.

@lonvia
Copy link
Collaborator

lonvia commented Jun 16, 2021

Addressed in #580.

@lonvia lonvia closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests