[Talk-GB] Rendering national/regional walking trails

Andy Townsend ajt1047 at gmail.com
Fri Apr 21 10:47:25 UTC 2017


On 21/04/2017 11:26, Elizabeth Oldham wrote:
> I am trying to render the national and regional walking trails. These 
> are done as relations, with tags like network=rwn so easy to pick out. 
> When I render them I find there are alternative routes, as an example 
> the Coast to Coast Walk splits into 3 at one point. Looking at the 
> relation in josm I find they have a "role" of alternative, or main as 
> appropriate.
>
> However, I don't seem to be able to get at the "role", and there is 
> nothing else which distinguishes main from alternative routes - so I 
> can render them differently. 

If you're using osm2pgsql to load a rendering database, then you could 
probably use the lua tag transforms and do something with roles for 
relations in there.  I've not done anything with relation roles myself, 
but 
https://github.com/SomeoneElseOSM/SomeoneElse-style/blob/master/style.lua 
is a lua tag transform I use and 
https://github.com/SomeoneElseOSM/SomeoneElse-style/blob/master/style.lua#L2296 
is the "relations" part of that, with "roles" as an array argument 
passed in.  You could use that to add a "pseudo-tag" like I do with 
"network=lwn" to get that to appear as a "highway", then render that as 
per e.g.: 
https://map.atownsend.org.uk/maps/map/map.html#zoom=14&lat=54.38373&lon=-1.51698 
.

Best Regards,

Andy




More information about the Talk-GB mailing list