render.xml: change color based on speed limit?

68 views
Skip to first unread message

Damien

unread,
Jun 10, 2020, 7:02:30 AM6/10/20
to OsmAnd
I'm making a custom render.xml for cycling based on the Topo style. I was wondering if it was possible to apply styling based on the speed limit for a particular road? I've tried various selectors like additional="maxspeed=X", but that does not seem to work.

The goal would be to disambiguate urban trunk roads (totally cyclable) from high speed trunk roads that are more like motorways.

Thanks for any insights :)

A Thompson

unread,
Jun 13, 2020, 10:58:36 PM6/13/20
to OsmAnd
Interesting question. I looked at Topo and a few other built-in renderers on github (here) and they don't make any reference to maxspeed. So I suspect that maxspeed is not supplied to the rendering engine.

But... would that really have worked for you anyway? From your writing I guess you might be in the UK. In which case you can have nice rural cycling roads with maxspeed=60 mph The big distinction I can see is 70 mph allowed only on dual carriageways (i.e. with a central barrier). Maybe you could look at "type=dual_carriageway" or "lanes=" ? I don't know if either would work, it's just an idea.

Damien

unread,
Jun 14, 2020, 5:54:17 AM6/14/20
to OsmAnd
I guess you're right and the rendering engine doesn't get to see that attribute!

In my case this would rather be to visually downgrade trunk roads with a speed limit of 30 mph or less to primary roads, eg:


As a workaround I've used the attributes "foot=yes" or "busway=lane" which seem to catch 80% of the cases...
Reply all
Reply to author
Forward
0 new messages