This is the first post in a short series i intend to publish on recent changes in road rendering in the Alternative-Colors map style.
One of the most fundamental techniques of digital rule based map design since the beginning has been the rendering of roads with round line caps, usually with a casing and fill (the different design elements of road drawing in digital maps are explained in more detail here).

The principle of using round line caps to consistently display a road network

For comparison: how the same would look like with flat line caps
By simply rendering every linestring the road network is composed of with a round line end and, in addition, sorting the drawing order of different road classes by ascending line width, you automatically get a consistent display of the road network – at all scales and no matter where the lines of the road are split in the data. This even works with layered display of roads (bridges and tunnels) – for the most part and as long as a few constraints are taken into account – which i have discussed in a previous blog post.

Layered road display with round line ends
This method of road display is used almost everywhere in the domain of automatically rendered tiled digital maps, a few examples are shown below.

Road rendering universally with round line caps in various maps (line wise from top to bottom: OpenStreetMap Carto, Mapbox, Here, Google, TomTom, Esri)
The main side effect of using this technique is that open road ends (where a road ends without being connected to another road) are shown with a rounded line ending. While this can be considered a valid design choice – after all, the road lines in maps usually do not depict the physical extent of the road on the ground – it is a design technique essentially unknown before digital maps. So, it is clear that the ubiquitous use of rounded open ends of roads in digital maps rendered from generic geodata – like OpenStreetMap – is almost never a conscious design choice, but almost always an accepted consequence of the technique employed to easily obtain a consistent overall display of the road network.
The rounded open ends of roads are not only a dubious and not very intuitive choice of displaying open ends of roads, they also have the additional negative side effect that they tend to visually connect roads that are disconnected, especially, of course, at smaller map scales where the roads are rendered in a width wider than the ground width of the road, but sometimes also beyond that. The presence of features directly at the end of a road, like some kind of barrier (wall, railing), buildings or point features is also not accurately shown.

Incorrectly connected roads in Strasbourg, France at z16 (left) and at higher zoom levels

Incorrectly connected roads in Verona, Italy at z15 (left) and at higher zoom levels
Practically producing flat line ends
To address this problem there are two possible approaches:
- Use flat line ends for displaying roads and explicitly process junctions to generate a consistent display of connected roads. This is quite a lot of work to set up in common map rendering frameworks, but it also offers the most flexibility in design. You could, for example, take turn restrictions at a junction into account when rounding the corners of the junction. An approach like this is also necessary to decently model a change in physical width or number of lanes between two segments of road.
- Use flat line ends for open ends of road segments, while continuing use of round line ends elsewhere.
What i am demonstrating here is the use of the second approach. And since no currently widely used rendering framework allows specifying different line cap styles for the start and end of a line signature, the way to implement this approach is to split every road line with an open end into one part with round line caps and a second end part with flat line caps. Doing this works as an imitation of drawing with different line caps on start and end in most situations, although there are corner cases with highly convoluted way geometries where this is not completely accurate.
What is classified as an open end of a road is a road with a wide casing + fill line signature being not connected at its end with any other road with a wide road signature. Roads with a narrow line signature (track, footway, cycleway etc.) do not get the special open end treatment and also are not considered when analyzing the other roads.
In addition to the basic design feature of showing open end roads with a flat line cap i implemented a differentiation of the styling depending on tagging of the end node:
- untagged end nodes are displayed with a simple casing line at the end
- ends explicitly tagged as
noexit=yesare shown with a wider casing at the end - ends tagged
fixme=continueare showing without a casing at the end.
Aeroways
One part of the roads (in the wider sense) where OSM-Carto – and also other OpenStreetMap based maps – never used round line ends is airport highways and taxiways. This is, however, traditionally done simply by using flat line caps universally, which leads to the usual problems which i illustrated already above. Mapping practice in OpenStreetMap has to some extent adjusted to that by avoiding splits in mapping of taxiways at corners. In the course of moving to render open road ends with flat line caps as shown above i also integrated the runways and taxiways with the normal roads so they now get rendered with the same logic of using round line caps for inner ends while using flat line caps for open, unconnected ends.
Conclusion
Even though the ability to use different line caps on the start and end of line signatures is absent from practically all automated map rendering frameworks, this post demonstrates that it is still possible to practically show roads with flat line caps at open ends. This would be much easier, of course, if map rendering tools offered more flexible line cap choices. That this goes beyond just allowing different line caps at start and end of a line will be discussed in a future post.
As usual the demonstrated technique is now available in my experimental map style.





