Opened 8 years ago

Last modified 7 years ago

#2519 assigned enhancement

Order results by distance to specified location

Reported by: kieran.fleming@… Owned by: twain
Priority: minor Milestone:
Component: nominatim Version:
Keywords: Cc:

Description

This is about me thinking about how nominatim can benefit opensatnav (http://www.opensatnav.org) but can also definitely benefit others.
Restricting results into a bounding box doesn't really satisfy the needs of sat-nav users. What they really want is for results to be biased towards locations close to them.
For example, if the user searches for 'pub' it should return pubs in the order of distance away. If they search for 'North St' it should return results taking into account both the accuracy of the match and the distance away.
At the moment we are using OSM namefinder and it will order the results only by distance so while the first results are really close to the user they aren't a close enough match to what the user wanted.

Change History (4)

comment:1 in reply to: ↑ description Changed 8 years ago by twain

  • Owner changed from openstreetmap@… to twain
  • Status changed from new to assigned

For example, if the user searches for 'pub' it should return pubs in the order of distance away. If they search for 'North St' it should return results taking into account both the accuracy of the match and the distance away.
At the moment we are using OSM namefinder and it will order the results only by distance so while the first results are really close to the user they aren't a close enough match to what the user wanted.

I've added an option to order by distance (within matching results). To use add

nearlat=[lat]&nearlon=[lon]

to the url.

I'd be be grateful for feedback on whether this meets you requirements.

comment:2 Changed 8 years ago by kieran.fleming@…

It definitely meets the requirement of finding the closest pub, restaurant etc but it's not perfect for searching for specific places as it seems to be limited to a certain distance away. Here's my example:
Australian cities often have streets that have the same name as another city. The extreme example is the capital city, Canberra, which has a street for every capital city in the country!
http://www.openstreetmap.org/?lat=-35.30869&lon=149.12785&zoom=15&layers=B000FTF

If I'm in Canberra and do a search for 'Melbourne', both Melbourne Avenue, Canberra and the actual city of Melbourne should be in the results. In this case Melbourne Avenue is important because it is nearby and Melbourne is important because it is a perfect match and also because it is a large city. In contrast, Melbourne Street, North Adelaide is not useful because it's far away, not a great match and is only a street:
http://www.openstreetmap.org/?lat=-34.90877&lon=138.60684&zoom=17&layers=B000FTF

Sorry, I should've made it more clear when I put the issue in. Anyway, I hope this doesn't scare you off :)

comment:3 Changed 8 years ago by twain

Thanks for the example. I'm afraid this isn't likely to get resolved particularly quickly but is something that I'm already working on for the next version of the search.

I would expect that this will probably be released some time in the new year.

comment:4 Changed 7 years ago by kieran.fleming@…

The nearlat and nearlon parameters don't work anymore:
http://nominatim.openstreetmap.org/search?q=atm&format=xml&addressdetails=1&accept-language=en&nearlat=37.42201&nearlon=-122.0841
returns an error message. If it's too hard to get it working again please let me know and I'll switch back to bounding box.

Note: See TracTickets for help on using tickets.