This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Show building names only for specific group

1

I try to customize my own carto style. I try to reduce building names in my city only to the most important ones. I've found in style/addressing.mss part:

    #building-text {

[zoom >= 14][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-face-name: @book-fonts;
text-fill: #444;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-size: 11;
text-wrap-width: 22; // 2.0 em
text-line-spacing: -1.65; // -0.15 em
}
}
(I cannot format that properly)

And by manipulating that values I can see that building names change and it's fine. What I'm wondering can I use that styling only to some groups/tags? In example to use that style only for building: train_station and not use in example for building: commercial. Or Can I use that attribute for building: train_station or building: yes (I don't have another examples, just wondering if the OR is possible).

I tried to find this in carto documentation pdf, but I couldn't find anything which at least aimed me to the solution.

asked 24 Mar '21, 12:48

engopy's gravatar image

engopy
126101015
accept rate: 0%

I tested to add [building = 'train_station'] inside curly braces, but from Kosmtik I received some SQL exception with some SELECT query. Looked at that query I figured out that maybe building attribute is not selecting from DB, so I tried to use name like: [name = 'Dworzec PKP Gliwice'] and indeed only that building is labeled. But I'm looking for some more general solution, not selecting them by name which is very specific for concrete building.

(24 Mar '21, 13:10) engopy

Source code available on GitHub .