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.
This is also suggested in the QGIS Training Manual. See their solution:
screenshot CC BY-SA 3.0 QGIS project
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 (cf. Applying OSM z-order after osm2pgsql with qgis). 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":
OSM standard style for comparison:
Map tiles © OpenStreetMap contributors (CC BY-SA 2.0)
This can be fixed by 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, as will intersections on bridges:
And here is the second example from above, rendered in QGIS:
If I use symbol levels with render pass numbers non-bridge road edge < non-bridge road interior < bridge edge < bridge interior, it'll look like this:
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?
No comments:
Post a Comment