[OSM-dev] on-road cycle routes - osmarender and ncn tags
80n
80n80n at gmail.com
Fri Jul 6 20:14:09 BST 2007
Mike
Firstly, there's a fundamental bug in the <addclass> instruction which
prevents it from rendering any rules contained within it in the correct
sequence. In almost all cases there is a way of achieving the same result
withup using <addclass>. The plan is to deprecate this instruction and it
will not be available in the next version of Osmarender.
In your case the following would work:
<rule e="segment|way" k="highway" v="primary">
<line class='highway-core highway-primary-core' />
</rule>
<rule e="segment|way" k="highway" v="secondary">
<line class='highway-core highway-secondary-core' />
</rule>
<rule k="route" v="ncn">
<rule e="segment|way" k="highway" v="primary">
<line class='highway-core highway-primary-core route-ncn' />
</rule>
<rule e="segment|way" k="highway" v="secondary">
<line class='highway-core highway-secondary-core route-ncn' />
</rule>
</rule>
The rules are executed in strict sequence and so the second set of rules
will paint over the first set.
The styles referenced by the class attribute obey the standard CSS rules, so
anything in route-ncn will override a similar property in
highway-secondary-core, for example.
You seem to be doing the right kind of thing.
I'll be presenting a workshop at SotM next weekend if you want to learn more
about Osmarender.
Etienne
On 7/6/07, mike <mike at bristolbeat.co.uk> wrote:
>
> I'm using osmarender (well - actually tilesAtHome) to build a cycle
> oriented map.
>
> So far I have greyed out all the roads to make them less prominent. I
> would like to add color: red to any highways with a route=ncn tag
>
> I'm just looking at the addclass statement in osmarender, but I'm a little
> unsure - can anyone see if the following makes sense?
>
> <addclass k="route" v="ncn" class="route-ncn">
> <rule e="segment|way" k="highway" v="primary">
> <line class='highway-core
> highway-primary-core' />
> </rule>
> <rule e="segment|way" k="highway" v="secondary">
> <line class='highway-core
> highway-secondary-core' />
> </rule>
> ...
> </addclass>
>
> I'm also unsure, if it does add the class, what will take precedence e.g.
> highway-primary-core (color: #c0c0c0;) or route-ncn (color: red;) ?
>
> If anyone has a good osmarender rule set for cycling that would help..!
>
> Also, I'm very new to this xsl / svg stuff, so any tips on debugging would
> be really, really usefull.
>
> cheers,
>
> mike
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20070706/9414f522/attachment.html>
More information about the dev
mailing list