streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.89k stars 356 forks source link

individual name for places of a brand #5985

Open tiptoptom opened 2 days ago

tiptoptom commented 2 days ago

How to Reproduce Try to add a place in the places overlay of a brand with an individual name for example:

shop=supermarket
brand=EDEKA
brand:wikidata=Q701755
name=EDEKA Schreiber

At the moment you cannot set an individual name for a place of a brand in the places overlay.


Or try to add the brand tag in the places overlay to a place that already has an individual name:

shop=supermarket
name=EDEKA Schreiber

The name tag is currently overwritten and the following tagging is obtained:

shop=supermarket
brand=EDEKA
brand:wikidata=Q701755
name=EDEKA

Expected Behavior

  1. For places of a brand there should still be field to enter an individual name or at least an option to open such a field.
  2. The name tag of a place shouldn't be overridden when a brand is set. It should also be displayed and editable.

Versions affected

59.2

Issues that may have a certain relationship

4688

5313

5940

Wiki https://wiki.openstreetmap.org/wiki/Key:brand#Examples

westnordost commented 2 days ago

If EDEKAs usually have each an own name, why is name specified at all for the EDEKA brand?

westnordost commented 2 days ago

I.e. the preset should rather add brand=EDEKA rather than name=EDEKA when name is always different.

tiptoptom commented 2 days ago

I don't know whether the name is always different in the case of Edeka or whether it is only occasionally like that. Nevertheless, there is also no option to enter or change the name.

westnordost commented 2 days ago

For SC it is not possible to "detect" that "EDEKA Schreiber" is actually an "EDEKA" and henceforth should not be overwritten by the preset. So, the only solution is to always show and let the user edit the name field, which I would really like to avoid in the case of brands.

tiptoptom commented 2 days ago

Would it be a solution, if the name does not match NSI, not to overwrite it but to display it in a field. And if the name matches NSI, to hide the field and only make it visible via the three-dot menu.

tiptoptom commented 2 days ago

Maybe the branch key could help here? 🤨🤷 https://wiki.openstreetmap.org/wiki/Key:branch

westnordost commented 2 days ago

Would it be a solution, if the name does not match NSI, not to overwrite it but to display it in a field.

That would be very weird. Imagine there was a completely different shop in there before, you select "EDEKA" and the old name is still in the name field!

Anyway, actually, what exactly were you doing, by the way? You added a new EDEKA?

westnordost commented 2 days ago

iD locks the brand field for EDEKA, but not the name field:

imagen

For ALDI, it looks different:

imagen

tiptoptom commented 2 days ago

Would it be a solution, if the name does not match NSI, not to overwrite it but to display it in a field.

That would be very weird. Imagine there was a completely different shop in there before, you select "EDEKA" and the old name is still in the name field!

No, because in this case the “Is it a different place now?” window would open. If “Different place now” is then selected, the name must of course be overwritten.

Anyway, actually, what exactly were you doing, by the way? You added a new EDEKA?

I have selected the NSI preset for Edeka for an object with the following tags:

shop=supermarket
name=EDEKA Schreiber
westnordost commented 2 days ago

I have selected the NSI preset for Edeka for an object with the following tags

But why? And why did you change it?

tiptoptom commented 2 days ago

I have selected the NSI preset for Edeka for an object with the following tags

But why? And why did you change it?

Because brand=EDEKA and brand:wikidata=Q701755 were missing.

westnordost commented 2 days ago

Anyway, the NSI presets for the screenshots above are


"shop/supermarket/edeka-0a839e": {
  "name": "EDEKA",
  "locationSet": {"include": ["de"]},
  "icon": "maki-grocery",
  "geometry": ["point", "area"],
  "matchScore": 2,
  "imageURL": "https://graph.facebook.com/EDEKA/picture?type=large",
  "terms": ["e neukauf", "edeka", "edeka neukauf"],
  "fields": ["name", "brand", "{shop/supermarket}"],
  "tags": {"brand:wikidata": "Q701755", "shop": "supermarket"},
  "addTags": {
    "brand": "EDEKA",
    "brand:wikidata": "Q701755",
    "name": "EDEKA",
    "shop": "supermarket"
  }
},
"shop/supermarket/aldi-813759": {
  "name": "ALDI Nord (Deutschland)",
  "locationSet": {"include": ["de"], "exclude": ["aldi-sued.geojson"]},
  "icon": "maki-grocery",
  "geometry": ["point", "area"],
  "matchScore": 2,
  "imageURL": "https://commons.wikimedia.org/wiki/Special:FilePath/AldiNord-WorldwideLogo.svg",
  "terms": ["aldi nord"],
  "tags": {"brand:wikidata": "Q41171373", "shop": "supermarket"},
  "addTags": {
    "brand": "ALDI Nord",
    "brand:wikidata": "Q41171373",
    "name": "Aldi",
    "shop": "supermarket"
  }
},

In conclusion, I have no idea how iD is able to treat these two differently.

Maybe @kjonosm knows?

westnordost commented 2 days ago

Because brand=EDEKA and brand:wikidata=Q701755 were missing.

But StreetComplete didn't display them as missing.

Cj-Malone commented 2 days ago

In conclusion, I have no idea how iD is able to treat these two differently.

preserveTags

https://nsi.guide/index.html?t=brands&k=shop&v=supermarket&tt=edeka#edeka-0a839e

But branch is usually the real answer.

tiptoptom commented 2 days ago

Because brand=EDEKA and brand:wikidata=Q701755 were missing.

But StreetComplete didn't display them as missing.

Not directly, but you can see a difference.

d97c63c7-6e09-4a9b-8ea4-68a352f29a56 fde6c4be-461b-4305-b06b-318e7e1c78cc

westnordost commented 2 days ago

@Cj-Malone but where is preserveTags? I don't see it in the presets.json

Cj-Malone commented 2 days ago

It's in nsi.json

westnordost commented 2 days ago

Hmm, StreetComplete and osmfeatures doesn't use that file at all. It seems to be somewhat of the nsi-id-presets.json but in a different format. The entry for EDEKA in nsi.json is:

{
  "displayName": "EDEKA",
  "id": "edeka-0a839e",
  "locationSet": {"include": ["de"]},
  "matchNames": ["e neukauf", "edeka neukauf"],
  "preserveTags": ["^name"],
  "tags": {"brand": "EDEKA", "brand:wikidata": "Q701755", "name": "EDEKA", "shop": "supermarket"}
},
westnordost commented 2 days ago

I created an issue at NSI to include this information also in the nsi-id-presets.json distribution, arguing that this is necessary information to correctly make use of the NSI. https://github.com/osmlab/name-suggestion-index/issues/10083

If this is included, then we can do the following:

  1. add parsing support for this tag in the osmfeatures library
  2. if for the selected preset the "preserveTags" is "^name", then display the text field for the input of a name (pre-filled with the preset's name, but the user can change it).
tiptoptom commented 1 day ago

Sounds good. I would also display the text field if the name is not part of the NSI preset. Here are some examples: https://nsi.guide/index.html?t=brands&k=office&v=political_party

EDIT: Never mind this already happens.