osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.59k stars 1.01k forks source link

Search for objects not only by main tag, but also by secondary tags #18219

Open Nine-Tailed opened 11 months ago

Nine-Tailed commented 11 months ago

Description

For example, I want to find benches not only by the main tag amenity=bench, but also by the secondary tag bench=yes, such benches are at public transportation stops, shelters. Or for example I want to find toilets not only as amenity=toilets, but also toilets=yes, for example at gas stations or cafes like McDonald's ;)

Workaround

Enable developer plugin -> Select Nearest POI's -> Select Filter and specific category (from a long list of duplicate categories)

Steps to reproduce

1 press the search button 2 entered e.g. shelter As a result, there will be no shelters associated with public transportation stops.

Actual result

The search does not show all results on the map

Expected result

When searching for an object, perform a full search for both the main tag and the secondary tags.

Your Environment (required)

OsmAnd Version:OsmAnd~ 4.6.0#803m, Дата выпуска: 2023-09-24
Android/iOS version:13
Device model:poco f3
Crash-Logs: ?
vshcherb commented 11 months ago

I think this is not a request cause osmand doesn't work like described. Each OSM object split by OsmAnd main POI types, so it's possible to have multiple POI for 1 OSM i.e. bank + atm.

Also OsmAnd has secondary poi types (additional) it's not possible to search over them and won't be possible cause there is no index on these additional entities. However you can Search All and configure a filter on top of it, so it might work

scaidermern commented 11 months ago

Duplicate of #11614 and #11892 I guess.

Nine-Tailed commented 11 months ago

At the moment I solve the problem of searching for such objects with the help of the following crutches:

  1. In the category of the nearest POI I set a filter e.g. bench=yes and save it as a new category "bench=yes".
  2. In the categories I select customizable search and use the search to find the POI bench and save the new category as "bench".
  3. I create a quick show/hide POI action where I add the previously saved categories for benches. As a result, enabling this action will show both amenity=bench and bench=yes. But as I wrote above, this is a crutch.
petitminion commented 11 months ago

Hello, I'm also very interested by this feature, but I can't find your solution, what is "the category of the nearest POI" ? Could you provide a video @Nine-Tailed ?

Nine-Tailed commented 11 months ago

@petitminion, the video turned out to be heavy, so I posted it in the ruosmand telegram chat https://t.me/ruosmand/138188

petitminion commented 11 months ago

Thx you so muuuuch ! :) Helped me a loot

So it's working great but it's taking a crazy amount of time for large spaces. @vshcherb you said secondary poi didn't have index, why not implement one ? Could be a plugin to save disk space. Even why not a separated search bar where we could look for tags. Because using "nearest point" is not practical at all (we cannot search the secondary poi, we have to scroll and they do not seem sorted alphabetically). This would be amazing, we could search for anything but I don't have any idea of technical implications.

vshcherb commented 11 months ago

Secondary index displays problems with our structure, we don't want to support non-hierarchical requests like "all POI where you can pay with CIDEX card". Such requests exist but they are very very specific, so we don't think it's needed to use an index as probably can "Search all POI" and filter them by a selected property.