Long Distance Footpaths
Posted by SomeoneElse on 3 July 2016 in English (English). Last updated on 14 July 2016.Although plenty of maps have displayed long distance footpath information for ages, I’d always assumed that it would take a lot of extra processing to get working. Turns out I was wrong:
Because of the way that relations are handled within osm2pgsql, converting route relations into “just another highway type” is pretty straightforward, and once created that new “highway=ldpnwn” can be added to the stylesheet.
In this case the two things to think about are the fill and the text. The “fill” is a short wide purple dot separated by a long gap from the next one. In the code (see the links above) at “line-dasharray” the “1” says “short and the “60” says “separated by a long gap” and further down the “line-width: 4” says “wide”.
The text for most names in the stylesheet is handled in one place. Long distance paths have to be different to distinguish them from road names, and so the text fill is purple, the text-dy larger to place it further from the road and text-spacing is further apart at higher zoom levels.
The big advantage of handling relations “just like any other road” is that all the clever Mapnik stuff “just works” - like text going around corners: