This post adds another chapter to my previous series of posts on line signatures in maps.
Back in the first part of the series i explained and illustrated how the sophisticated techniques in using line signatures in pre-digital maps have practically largely been replaced by rather primitive line drawing in digital map production. And i showed some methods how you can, in digital rule based map design, work around these limitations.
Here i want to supplement this collection of techniques with some ideas on line dashing.
Dashing
Interrupted lines with dashing and dotting are one of the techniques that survived the transit to digital map production. Line dashing is available in most digital map rendering frameworks, often including the ability to define complex dashing patterns through dasharrays. This allows, in principle, to digitally reproduce many design concepts developed in pre-digital maps that make use of line dashing. But, if you look closely, the level of quality of drawing with dashed lines in digital maps is often rather low.
Here are a few examples of pre-digital use of dashing in maps:
What these examples demonstrate is how dashing adds another dimension of differentiation to simple line signatures (apart from line width and color) and also how more complex shapes of dashes can be used to highlight specific line element classes – like it is frequently used in case of boundaries.
What you can also see when you look closely is that in practical drawing the dashing is not just a simple mechanical repetition of a certain dash + gap sequence along the line with pre-defined dimensions. The dashing is adjusted to the context, usually in a way that ensures the individual line segments start and end on a dash – or, in case of junctions, that there is no gap directly at the junctions.
Pipelines in OSM-Carto
Digital rule based map styles typically do not do this – they mechanically and blindly repeat the defined dashing pattern along the line. For simple dashings this is often not that much of a problem, but for more complex patterns generated using dashing it frequently is. A good case example for this in OSM-Carto are pipelines.
Pipelines are rendered in OSM-Carto with a somewhat complex dashing pattern that is meant to resemble tube segments with flanges in a simplified form. In principle, this is an intuitive approach to showing pipelines. It even allows visualizing the substance through the choice of fill color at the higher zoom levels. The very mechanical drawing of the pattern, however, causes problems:
- The drawing starts at an arbitrary position in the pattern (in this case with a flange) at the start of each linestring. This looks odd at junctions and when a pipeline is split in mapping into several segments, for example to apply different secondary tags.
- Flanges can occur arbitrarily at any position along the line, in particular also at junctions and at sharp corners.
- In addition, the individual line strings are drawn strictly one after the other with both casing/flanges and fill – leading to junctions not being displayed as connections of the pipelines.
Pipelines improved
Here is how the improved rendering in the AC-Style now displays the same configuration.
This is primarily achieved by two things:
The dashing pattern is adjusted in length and phase to the line length in a way that they start on a pipe segment in the middle between flanges and end in the same fashion.
And the pipelines are split at intersections among themselves and with other line features, specifically roads, and at the same time separately mapped pipelines are merged where two of them meet end to end when they share relevant attributes. Furthermore, the dashing is also split at sharp corners.
In addition, the pipeline rendering is integrated into the road layer so pipelines are correctly layered both relative to each other and relative to roads. And they are shown with a correct drawing order for casing and fill.
I also re-designed the use of color to visualize the substance transported in the pipeline.
The zoom level progression remains similar to that in OSM-Carto with some smaller adjustments.
Real world examples
Conclusions
What i demonstrated here is that use of line dashing with current map rendering frameworks is not strictly limited to the primitive mechanical application of a static dashing pattern, as it is common in automatically rendered maps these days. Achieving high quality dashing with the techniques shown here requires both dynamically adjusting the dashing pattern to the individual geometry and splitting and merging geometries based on their shape, geometric context and topology. The dynamic dashing pattern adjustment also requires a custom modification to Carto that allows defining dasharrays through fields.
The benefit of doing this is a much clearer and much better readable map image with fewer artefacts and a more organic depiction of dashed features.
The implementation of what i described in this blog post can be found in the AC-Style.
Pingback: weeklyOSM 750 – weekly – semanario – hebdo – 週刊 – týdeník – Wochennotiz – 주간 – tygodnik