I'm trying to produce a QGIS map style / symbology for processed openstreetmap data. For roads, I'd like to mimic how the OpenStreetMap web tile map "Standard" rendering style (produced with mapnik AFAIK) treats road intersections, road bridges over roads, road intersections on bridges and road bridges over road bridges etc.
Map tiles OpenStreetMap contributors (CC BY-SA 2.0)
To produce the dark rim, I use the same trick as the "Standard" style: Draw a wide dark line and above it a bright line with slightly smaller width for the "interior" of the road. This looks alright for individual road features. To get continuation of roads (which might be split over several features in the data) and road intersections to look right, I can put all "interior" parts of these multi-level line symbols on a higher "Symbol level" (later rendering pass) than all the "rim" parts.
To get bridges on various levels drawn correctly over each other and over roads, I check "Control feature rendering order" and let it order by the
z_order attribute as produced by osm2pgsql. This works fine without the rim, but without the rim you can only really visually see the bridges when they are between roads of different type (which I symbolized in QGIS with different colors). For roads of the same type, the rim is needed to distinguish bridges from intersections.
Combining "Control feature rendering order" with "Symbol levels" gives a wrong-looking result, though. It seems that "Symbol levels" rendering passes take precedence over the feature rendering order: Bridges over roads start to look like intersections when all "interiors" are on a later rendering pass than all "rims". This can be fixed putting both bridge interiors and bridge rims on a later pass than non-bridge road interiors. But bridges over bridges will then still look wrong.
I think they would look right if the feature rendering order took precedence over the "Symbol levels", i.e. order two strokes by rendering pass number only if their
z_order value is the same, otherwise draw them in the order of the
z_order. Can I get QGIS to do that? If so, how?