OpenStreetMap 标志 OpenStreetMap

Long Distance Footpaths

SomeoneElse 于 2016年七月 3日 以 English 发布 最后一次更新于2016年七月14日。

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:

Brassington showing the Midshires Way, Limestone Way and High Peak Trail

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:

Text going around a corner from some steps onto a road

电子邮件图标 Bluesky图标 Facebook图标 LinkedIn图标 Mastodon图标 Telegram图标 X图标

讨论

登录以留下评论