-
Notifications
You must be signed in to change notification settings - Fork 820
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
Render brand=* additionally to name=* #972
Conversation
Can you provide a rendering example? |
Thanks! I think rendering the brand name will be a great improvement. I'm not sure what would be better - rendering the brand name only for selected POI, or for all POI? Are there any POI for which rendering the brand would be a disadvantage? Alternatively, we could do the computation of the name in the SQL rather than in the CartoCSS code. I think it would save some duplication, and more importantly, it would reduce the number of cases in the generated XML code. Something like this should work (untested).
(It needs an extra condition if we don't want it for all POI.) Also, I think it doesn't matter, because it shouldn't get triggered anyway, but you're inconsistent with the default case. Sometimes you use By the way, the brand of the gas station in your example is of course a tagging error. Probably this code will highlight many tagging errors like that, but I guess that's a good thing because it means they'll get corrected faster :). |
Independent as brand is widely used, it is one of top values. |
So you are suggesting to delete all the name tags for McDonalds restaurants, Burger Kings, Rewes etc. when they have a brand tag? This means that all other applications also have to use the brand-tag otherwise the names of supermarkets, fuel stations and fast food restaurants are not shown anymore. I think it's perfectly fine for a fast food restaurant to have 'name=McDonalds' and brand='McDonalds'. See also http://wiki.openstreetmap.org/wiki/Key:brand#Distinguishing_between_Brand.2C_Name.2C_Operator.2C_etc.
It's also in the JOSM-preset for fuel stations. I didn't find documentation for it, but afaik it is used for fuel stations that do not belong to a specific brand. |
math1985 wrote:
I'd go with a limited set of POIs, because e.g. amenity=embassy, amenity=prison, landuse=military, natural=bay or natural=forest don't make much sense with brand=*. These tags don't currently have brand-tags (didn't check that, but I assume that), but I suspect, that some mappers could misuse them for displaying some text in braces below the name of some POI.
+1
That was intentional: In the pub/biergarten/restaurant/fast_food/cafe-selector, the default is name, because this will be used for pub, biergarten, restaurant and cafe. But in the bank-selector the default is '', because it will never be used. MapCSS doesn't recognize the unused default and thus requires some default. This could basically be anything, but wouldn't change the result, so I chose the simplest value, the empty string.
As mkoniecz and sb12already mentioned, brand=Independent is used for gas stations, that do not sell a specific brand, so this gas station is tagged correct. It is a member of the "Federal Association of free gas stations and independent german mineral oil dealers" (German: Bundesverband Freier Tankstellen und Unabhängiger Deutscher Mineralölhändler e. V.) or short bft. Maybe you could also tag brand=bft, but brand=Independent isn't really wrong. |
sb12 wrote:
Yes, if the name-tag equals the brand-tag. If the POI has an own name, this one should be placed in the name-tag, otherwise no name-tag should be present. Just recently I needed this feature in OsmAnd, when I searched for a gas station and needed a certain brand, because I had a company car with a fuel card for this brand. But I was in a region, where it showed me only entries like "gas station City XY east", "gas station John Doe" or "self-service gas station". I had to manually open each one and look up the brand-tag (almost all had one). It would be so much better, if applications would evaluate both the name- and brand-tag. |
2014-09-24 1:54 GMT+02:00 Florian Schäfer notifications@github.com:
actually things are much more complicated than this, have a look here in |
I agree that this improves the rendering for Edekas (I always tagged them as Just to clarify: I like the rendering of the brand name and I also tag it a lot, what I do not like in this approach is the double rendering of name and brand (if both is set). If we assume that it is wrong to tag a name when the name is actually a brand, I think this needs to be discussed with the community and the wiki needs to be changed accordingly. I would prefer to have something like
Please also think about the impact of this style. This can lead to a massive retagging of names especially for fast food restaurants and shops. So other applications need to be aware of this change so they can adapt their code to also use brand instead of name. Also by only rendering the brand for specific shops, this means that an IKEA will appear with only the
I would add
|
I mentioned this pull request on taging mailing list ("name and brand tags" topic - https://lists.openstreetmap.org/pipermail/tagging/2014-September/thread.html ), as I agree with
especially as currently wiki describes 'name=McDonalds' and brand='McDonalds' as OK. |
I'd like to see the name vs brand issue resolved before merging this. |
2014-09-24 19:00 GMT+02:00 Andy Allan notifications@github.com:
+1. Actually for restaurants (in general for many POIs) displaying both |
I've now reworked the pull request. Now the SQL decides, if the name, the brand or both is displayed. It also checks, if the value of the name-tag starts with the value of the brand-tag (case-insensitive) and displays only the name, if this is the case. By the way: Is there a better way to add a |
Perhaps checking if the name ends with the brand would be useful, too. |
You shouldn't be editing project.mml directly. Spaces within the YAML are for syntax formatting, so add them as necessary - most good text editors will help with this. If you need to add a new line within a SQL string constant, do |
I did not want to do that. I just wanted to produce a
With exactly one newline-character and 8 spaces between foo and bar this translates to I knew that this approach was error-prone, makes the yaml-file harder to read and it might get broken by future editors, who want to format the SQL for better readability. So I asked for a better solution.
Thank you for your tip , this solves exactly my problem. I didn't know about this PostgreSQL-feature of escape string constants before. This change is now incorporated in this pull request. |
3ba720a
to
6fa84dd
Compare
…s not start with the brand It is rendered in the following format (\n is the newline-character): name\n(brand) If only one of both is present only this value is rendered.
Stale PR, and the issue related to it is closed. |
In my humble opinion (and I know this is polemic), the tag name=* for those POIs is much more official_name=* then name=*. But this is subject to the tagging list, not here, so feel free to ignore. |
On Thu, Sep 17, 2015 at 10:44 AM, Arlindo Pereira notifications@github.com
|
Please, could you look at this discussion? Thank you! |
This is supposed to solve parts of #698.
I've picked some amenities, for which it makes the most sense to render brand. These are:
Depending on what tags are present (only name, only brand or both), one of the following variants is rendered:
Currently this will result in many amenities (especially petrol stations) showing up as "Brand xy\n(Brand xy)", because many of them have the same value for the brand- and name-key. I even had difficulties to find a petrol station, that has different values for name and brand. But this is in my eyes a tagging-mistake (tagging for the renderer), which will hopefully be corrected as soon as brand renders in this style (see also the comment by Rovastar to issue #698).