Controlling level of detail at different zoom levels

Are there common techniques in openstreetmap to manually control which elements are to be displayed at a specific zoom level?

For instance: motorways usually consist of two ways, one for each direction. At lower zoom levels displaying only one of these ways is sufficient. So in a local copy of OSM I marked one of these ways with a tag like this

hide_on_low_zoomlevel=yes

and made up my own mapcss (for JOSM):


way|z-13[highway=motorway][hide_on_low_zoomlevel=yes] {
    width: 1;
    opacity: 0;
}

This works great. My question is: is there something similar in the official openstreetmap data? Or are there at least any proposals for implementing such functionality in OSM?

In general adding tags to direct rendering behaviour is not a good idea (although it has a long history on OSM).

What you are talking about is geographic generalisation. There are a host of techniques for this sort of thing, some tools such as Qgis may do simple generalisations, but for many areas this is quite complex & often requires quite fancy coding.

Turning dual carriageways into a single line string at low zooms is one such issue. Some people do appear to have solved it. It’s potentially easier if the two carriageways can clearly be linked & then one can do something like draw the shortest line between the closest nodes on each carriageway & bisect those lines to provide a series of points to build a median line string. There are numerous other ways (e.g., buffer each carriageway & merge & find the medial axis) etc.,

For your purposes any query which reliably selects one of two carriageways will work without the need for tags (it could be direction, or some are tagged explicitly).

I could not even find an unreliable way.

For instance: motorway A1 in Austria, westbound - https://www.openstreetmap.org/way/40423225

highway=motorway
int_ref=E 60
lanes=3
maxspeed=130
maxspeed:hgv:conditional=80 @ (22:00-05:00 AND weight>7.5)
name=Westautobahn
oneway=yes
ref=A1
source:maxspeed=AT:motorway
toll=yes

Opposite track, eastbound - https://www.openstreetmap.org/way/267471062

highway=motorway
int_ref=E 60
lanes=3
maxspeed=130
maxspeed:hgv:conditional=80 @ (22:00-05:00 AND weight>7.5)
name=Westautobahn
oneway=yes
ref=A1
source:maxspeed=AT:motorway
toll=yes

One could use some of the relations of which the above ways are part of, but that would be cumbersome at the very least.

Absolutely not - that would be contrary to the spirit of OSM, which is that we record impartial data, and renderers make their own decision as to how to render it.

The default map on osm.org is just one of many renderings of OSM. Hard-coding rendering hints for that one specific map in the OSM data would ignore every other map made from OSM data.

A very important statement!

Many new on OSM doesn’t know this, thinking the osm-page on the web (https://www.openstreetmap.org) is the osm, when it’s only ONE example of how the osm-data can be shown.