osmlab / name-suggestion-index

Canonical common brand names, operators, transit and flags for OpenStreetMap.
https://nsi.guide
BSD 3-Clause "New" or "Revised" License
712 stars 872 forks source link

Linked overpass queries for brands too restrictive #4805

Open kymckay opened 3 years ago

kymckay commented 3 years ago

With the new format (name tag no longer required) the overpass link generated for brands is too restrictive as it looks for features by the "name" tag. It should probably be the "brand" tag (really it should always be the primary tag).

This would mean the styling can no longer show mapped brands that are only mapped in the "name" field. However, it fixes the queries for branded things that don't have a name tag (bicycle networks being the example that I ran into).

Jeremiah-England commented 3 years ago

Another situation is where the brand and name tags are different. For example, Cash America Pawn. The Wikipedia page has the brand as "Cash America International" while all the signs have "Cash America Pawn". Maybe they should just be the same? Anyway, the query assumes that brand if it exists is equal to name or at least preferentially uses it for the name in the query. Unless it's true that these should always be the same, we need another variable.

https://github.com/osmlab/name-suggestion-index/blob/67ca9ce00d8d02de193a6206f785d954b85b74e3/app/src/CategoryRow.jsx#L28

Maybe do something like

b = item.tags.brand || item.tags.name; 
n = item.tags.name || item.tags.brand;
bhousel commented 3 years ago

Yes we can definitely improve how the overpass queries on https://nsi.guide work..

The reason I added these originally was - after processing a planet file, our index would pick up new names and I wanted to see where those names are used. It's was more for doing research on an unknown brand, less for seeing where a known brand is used.

1ec5 commented 3 years ago

Another situation is where the brand and name tags are different. For example, Cash America Pawn. The Wikipedia page has the brand as "Cash America International" while all the signs have "Cash America Pawn". Maybe they should just be the same?

Sounds like the brand should be “Cash America Pawn”. “Cash America International” refers to the company. (Ideally, eventually, someone would create a separate Wikidata item for the brand, linked to the company’s item, but it isn’t a high priority for every kind of brand.)