otsaloma / poor-maps

Maps and navigation for Sailfish OS
https://openrepos.net/content/otsaloma/poor-maps
GNU General Public License v3.0
43 stars 10 forks source link

Allow to search Nearby Venues by Name #39

Closed rinigus closed 7 years ago

rinigus commented 7 years ago

According to the search dialog presented by "Nearby Venues", POIs are searched by type. However, from inspecting Foursquare and Nominatim URLs, it seems to me that they would find venues by name as well if I would type the name as a type. OSM Scout Server, however, makes "type" as it is - as a type of the venue and looks into OSM type tag.

I have just finished the version of "Nearby" search which is backed by geocoder-nlp. This search accepts poitype and name options. When only one is specified, it would take that one to search for POI. When the both are specified, its using them both with logical AND. That way you can specify cafe and its name, for example. I think its a correct handling of the situation, but it differs from the current approach.

I wonder, is it possible to add "Name" into Nearby Venues dialog? Its probably possible to do so as a specific OSM Scout Server option, but that would probably feel odd.

There is also an option to use logical OR and, using the current dialog, search for type or name.

Would be great to get your thoughts on it.

otsaloma commented 7 years ago

I'm not quite comfortable just adding UI, especially to suit a worst case – IMHO OSM data is really bad for nearby POI search. OSM types are very unintuitive, e.g. something as common as grocery stores are very difficult to find, and names are inconsistent, sometimes wrong, and sometimes duplicated, e.g. in Finnish "Posti" used as name for both post offices and post boxes.

So, I'd first ask, is there a downside to always doing a search for both type and name separately and combining the results? Is there a case where that returns a significant amount of unwanted results?

I'd imagine you'd usually want loose rather than strict search criteria, maybe even forming a joint string {name} {type} and doing some fuzzy match against that. Consider for example someone looking for "sushi restaurant", they'd probably want to find name="Tokyo Sushi", type="restaurant".

rinigus commented 7 years ago

Fair enough, I should try to mix type and name and reply to your question. Making it fuzzy would be difficult and would require major rework. However, its simple to check type and name for substrings and combine the results. That would probably be sufficient and I'll report back here.

rinigus commented 7 years ago

OK, looks like it works good enough. I am closing the issue and will be using a general query for type or name matching.