開放街圖標誌 OpenStreetMap 開放街圖

Long Distance Footpaths

於 2016年七月 3日 由 SomeoneElseEnglish發表。 上一次更新在 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

電子郵件圖示 藍天圖示 Facebook 圖示 LinkedIn 圖示 乳齒象圖示 Telegram 圖示 X 圖示

討論

登入 來留下評論