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

For names of shops and amenities (name quest) use NSI data to offer autocomplete #2290

Closed
matkoniecz opened this issue Nov 17, 2020 · 17 comments
Assignees
Labels
feedback required more info is needed, issue will be likely closed if it is not provided

Comments

@matkoniecz
Copy link
Member

matkoniecz commented Nov 17, 2020

Use case

#1693 (comment)

Having just done a bunch of shops in a high street, using NSI's names as a suggestion when tagging shop names would also really help, e.g. type:
McD and it asks (did you mean the brand McDonalds) do that 10-20 times and it's a lot quicker and more accurate than typing them out manually. Yes you still need to do the independents and smaller shops, but it would help a lot for the others.

Based on my mapping in Vespucci it is quite useful, to reduce typos and to reduce input time.

Proposed Solution
Use autocomplete from NSI. Use just names, do not add silently other tags.

Optionally, use tagged shop/amenity value as a part of a filter do not offer unrelated autocomplete


Main drawback is that you see names of Tesco/McDonalds/etc in one more place. (and that this feature will not implement or maintain itself)

@peternewman
Copy link
Collaborator

I was just thinking this sounded like a good idea 😄 😆

#1693 (comment)

Optionally, use tagged shop/amenity value as a part of a filter do not offer unrelated autocomplete

I'd strongly encourage this if they're set on the nodes, it will reduce the list a lot so M might be sufficient to display what you want.

@westnordost
Copy link
Member

westnordost commented Nov 17, 2020

Not entirely sure if it is possible. The suggestion bar above the software keyboard is controlled by the input method editor (the keyboard software), not by the app. It is called "candidates view".

So the feature you are looking for might be autofill. Autofill suggestions are shown in a dropdown menu. Since Android 11, there seems to be the possibility to show these autofill suggestions in that candidates view of the keyboard, it the keyboard software supports it.

@westnordost
Copy link
Member

I'm putting this on feedback because it's not clear if this can be done at all and what the effort would be and I do not plan to do any more research in this direction.

@westnordost westnordost added the feedback required more info is needed, issue will be likely closed if it is not provided label Nov 17, 2020
@peternewman
Copy link
Collaborator

How are you doing the charging station/ATM operators? This is just another clone of that isn't it, with a different data source?

@westnordost
Copy link
Member

westnordost commented Nov 17, 2020

That's AutoCompleteTextView. You have to supply an array of strings to that view and the rest will work automatically. This is not really a possibility here because such array of strings does not exist but must be queried for each (key) input

@westnordost
Copy link
Member

westnordost commented Dec 2, 2020

Use just names, do not add silently other tags.

Why not though? If the user selects deliberately a brand? After all, I guess if the user selects one from the list, "brand" should be tagged, not "name".

@peternewman
Copy link
Collaborator

That's AutoCompleteTextView. You have to supply an array of strings to that view and the rest will work automatically. This is not really a possibility here because such array of strings does not exist but must be queried for each (key) input

I didn't really follow why (do you mean keyboard keypress), or OSM map key? But given you appear to have added a commit to fix it, presumably it's possible?

@peternewman
Copy link
Collaborator

Use just names, do not add silently other tags.

Why not though? If the user selects deliberately a brand? After all, I guess if the user selects one from the list, "brand" should be tagged, not "name".

The NSI stuff is a bit more complex than tagging brand or not, but can add lots of useful detail including things like brand and operator as appropriate, as well as unifying some other tagging. I suspect you probably want to add their name as a name if they have a name.

To take a concrete example, in the UK there is a pub brand called Weatherspoons, each pub still has it's own name e.g. "The Montagu Pyke", so you want to prompt for a name for those, not just skip it if the brand has been set by someone, and conversely not set the name and brand to the same thing in that case. NSI handles most of these edge cases already. Ideally SC would be really clever and if I type Weatherspoons it would populate the brand field, say thanks and then ask me what the name is either then or later (I guess it could display the brand like it does floors/house names/numbers etc as a hint it's looking for something else this time).

@westnordost
Copy link
Member

westnordost commented Dec 3, 2020

Well, there are four options:

  1. use the NSI just to suggest some common names and tag name=Carrefour only as if the user input this himself
  2. same as above but in case the user selected an item from the list, tag brand=Carrefour instead
  3. same as above but in case the user selected an item from the list, tag the preset, i.e. brand=Carrefour + brand:wikidata=Q217599 + brand:wikipedia=fr:Carrefour (enseigne) + name=Carrefour + shop=supermarket
  4. tag the preset if the text in the input field matches a preset 100%, even if the user did not tap on a suggestion in the shown dropdown but typed Carrefour all by himself.

I am strongly leaning towards 3 or 4 here. 2 is basically already disqualified because of your comment, right?

@matkoniecz seeemed to (initially) favour 1.

@westnordost
Copy link
Member

westnordost commented Dec 3, 2020

Another piece of information: Only the presets are suggested which

  • start with the term (f.e. "Deutsche Bank" is not suggested if the user starts typing "Ban...", but "Bank of America" is)
  • only presets are suggested that can be used on the geometry of the element (i.e. if a preset is only for vertices of a way,or relations they are excluded)
  • presets only valid for certain countries are excluded if the element in question is not located in one of these countries
  • only brand names (no other presets) are shown
  • only brand names that can apply to element in question are shown (for example, if the place to be named is a clothing store, "Carrefour" won't show up because it is a supermarket)

However, neither the logo nor any other icon is shown when a preset is selected. Showing icons in the dropdown there would increase the app size by at least 2 MB but more likely 8MB. Even 30MB if that icon would be shown in large (like it is done in iD.

@peternewman
Copy link
Collaborator

Well, there are four options:

1. use the NSI just to suggest some common names and tag `name=Carrefour` only as if the user input this himself

Given the other tags seem to add value, I'd personally be against this, plus it avoids the risks of people just doing the same thing via iD when they aren't in front of the shop and it's possibly changed brand or whatever.

4. tag the preset if the text in the input field matches a preset 100%, even if the user did not tap on a suggestion in the shown dropdown but typed `Carrefour` all by himself.

I am strongly leaning towards 3 or 4 here. 2 is basically already disqualified because of your comment, right?

The only thing to be wary of with four, is NSI is always evolving, there could be another shop called Carrefour which either hasn't been added to the index yet, or they haven't been geo-located yet, there seems to be a lot of overlap in the US. Seamlessly doing it perhaps risks miss-tagging it, whereas offering "Carrefour (brand=Carrefour, shop=supermarket)" and then a separate option of "Just tag Carrefour" would allow people to avoid that. Dragging in the logos would make that much safer, but then you either need to cache them all for people like me using it offline, I guess others may not like them all coming from social media either.

You could have a brand quest, which just tags the brand for places when you key it in, but that seems like unnecessary duplication, and unless you do something as complicated as that, you'll hit some edge cases.

Another piece of information: Only the presets are suggested which

* start with the term (f.e. "Deutsche Bank" is not suggested if the user starts typing "Ban...", but "Bank of America" is)

Generally sounds sensible, although risks hiding "The Foo Bank" if I just type in "Foo Bank", although I guess I'm being naughty and lazy if it's not what's on the front of the building. If you handle the match names too, they'll generally cover these sort of issues, plus Weatherspoons/J.D. Weatherspoons/Spoons etc.

* presets only valid for certain countries are excluded if the element in question is not located in one of these countries

Great, that's half the benefit of NSI, do you handle some of the more esoteric presets like 001, EU, GB-ENG etc? I guess the geojson ones will just get ditched?

* only brand names (no other presets) are shown

Makes sense.

* **only brand names that can apply to element in question are shown** (for example, if the place to be named is a clothing store, "Carrefour" won't show up because it is a supermarket)

Perfect, there are also matchtags, to deal with shop=supermarket/shop=hypermarket etc in the case of something like Carrefour.

However, neither the logo nor any other icon is shown when a preset is selected.

Fair enough. Plus presumably you're just starting with some types of presets, plus that will keep growing. You could always offer a link to Wikipedia/Wikidata/NSI if people wanted to double-check.

@westnordost
Copy link
Member

50x50px thumbnails of all the brand logos in the NSI are 8.34 MB, and growing, of course. I think this is a little much. I'll not add this for now.

@westnordost
Copy link
Member

I'll implement option 4

@matkoniecz
Copy link
Member Author

tag the preset if the text in the input field matches a preset 100%, even if the user did not tap on a suggestion in the shown dropdown but typed Carrefour all by himself.

Main risk here is that

  • NSI may be wrong (and sometimes it is wrong)
  • especially about additional tags
  • some rare cases of name and shop type not matching popular brand of the same shop type

But note that I am extremely defensive about this kind of mistakes, so overall it will be probably fine (but sooner or later there will be some actual false positive).

Sorry for a late reply (too late to be useful probably), right now I am trying to get through far too many notifications.

@matkoniecz
Copy link
Member Author

See for example https://www.openstreetmap.org/way/165659335#map=19/39.48195/-88.37310 https://en.wikipedia.org/wiki/Burger_King_(Mattoon,_Illinois)

Burger King has the right to use this name throughout USA, with the exception of a 20-mile radius surrounding a restaurant, also called Burger King, in Mattoon.

@peternewman
Copy link
Collaborator

* NSI may be wrong (and sometimes it is wrong)

I think you'll generally find when some incorrect info has got into NSI, they open an issue and leave it open until it's merged into iD and then go and fix the outstanding errors.

* especially about additional tags

Likewise in this case, they've done that a number of times.

* some rare cases of name and shop type not matching popular brand of the same shop type

Trademarks should generally cover most of this, unless the NSI data has an error, or it's geographical masks/exclusions are wrong.

But note that I am extremely defensive about this kind of mistakes, so overall it will be probably fine (but sooner or later there will be some actual false positive).

I'd possibly agree with you, and showing brand logos would help to ensure people definitely have the right one (although with some acknowledged downsides), but personally I feel allowing people to tag it on-site within OSM is better than them doing so at home via iD and not realising the shop has closed or moved to a bigger premises nearby.

I'd still suggest NSI is a better source of data than leaving it to people's typing as I think #2194 shows.

See for example https://www.openstreetmap.org/way/165659335#map=19/39.48195/-88.37310 https://en.wikipedia.org/wiki/Burger_King_(Mattoon,_Illinois)

Burger King has the right to use this name throughout USA, with the exception of a 20-mile radius surrounding a restaurant, also called Burger King, in Mattoon.

I've added an issue to get that covered in NSI: osmlab/name-suggestion-index#4817

@matkoniecz
Copy link
Member Author

I think you'll generally find when some incorrect info has got into NSI, they open an issue and leave it open until it's merged into iD and then go and fix the outstanding errors.

Main negative here is that NSI mistakes will result in invalid edits by StreetComplete - and user has no chance at all to review or notice the mistake. So StreetComplete is more affected than other NSI users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback required more info is needed, issue will be likely closed if it is not provided
Projects
None yet
Development

No branches or pull requests

3 participants