<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Dear all,<br>
I want to generate an overlay map to be used as additional layer on
a Garmin watch. This layer can be turned on/off on the watch and
should show only bicycle routes (route=bicycle and route=mtb).<br>
As most routes in openstreetmap are defined as relations I am using
the following rules in my bike-routes style:<br>
<br>
<b>relations (file)</b><br>
# Route relations as additional transparent layer for:<br>
# bicycle<br>
# mtb<br>
<br>
# bicycle routes <br>
type=route & route=bicycle<br>
{<br>
apply<br>
{set route='${route}';set
route_name='$(route_name),${name}'|'${name}';set
route_ref='$(route_ref),${ref}'|'${ref}';}<br>
}<br>
type=route & route=bicycle & network=icn {apply
{set route_icn=yes;}}<br>
type=route & route=bicycle & network=ncn {apply
{set route_ncn=yes;}}<br>
type=route & route=bicycle & network=rcn {apply
{set route_rcn=yes;}}<br>
type=route & route=bicycle & network=lcn {apply
{set route_lcn=yes;}}<br>
<br>
# mountainbike routes <br>
type=route & route=mtb<br>
{<br>
apply<br>
{set route='${route}'; set
route_mtb_name='$(route_mtb_name),${name}'|'${name}'; set
route_mtb_ref='$(route_mtb_ref),${ref}'|'${ref}';}<br>
}<br>
<br>
<b>lines (file)</b><br>
# bicycle routes<br>
route=bicycle & route_icn=yes {name '${route_ref}'}
[0x10f01 resolution
18-22 continue]<br>
route=bicycle & route_icn=yes {name '${route_name}
(${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f02
resolution 23-24]<br>
<br>
route=bicycle & route_ncn=yes
[0x10f01 resolution 20-22
continue]<br>
route=bicycle & route_ncn=yes {name '${route_ref}'}
[0x10f02 resolution 23
continue]<br>
route=bicycle & route_ncn=yes {name '${route_name}
(${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f02
resolution 24]<br>
<br>
route=bicycle & route_rcn=yes
[0x10f03 resolution 20-22
continue]<br>
route=bicycle & route_rcn=yes {name '${route_ref}'}
[0x10f04 resolution 23
continue]<br>
route=bicycle & route_rcn=yes {name '${route_name}
(${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f04
resolution 24]<br>
<br>
route=bicycle & route_lcn=yes {name '${route_name}
(${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f05
resolution 24]<br>
<br>
# mtb routes<br>
route=mtb {name '${route_mtb_ref}'}
[0x10f06 resolution 23
continue]<br>
route=mtb {name '${route_mtb_name}
(${route_mtb_ref})'|'${route_mtb_name}'|'${route_mtb_ref}'}
[0x10f06 resolution 24]<br>
<br>
<br>
In general, these routes are drawn by mkgmap and I am able to
generate an overlay map, but sometimes a route with "lower" priority
(i. e. a route=mtb) hides a route with "higher" priority. In other
words, I would like to show the routes in a ranking: The routes
tagged with network=icn should be on top, followed by network=ncn
and so on. The route=mtb should be only shown, if no other bicycle
route is on the same way.<br>
Is this possible to achieve with mkgmap alone? Or do I need some
sort of additional script to rank the relations before rendering
them with mkgmap?<br>
I have read something, that the draw order depends on the ID of the
relation and mkgmap renders the lower IDs first. But what about the
higher relation IDs? It looks like ways tagged from the relation
only get the tags from the relation with the lowest ID. Is this
correct?<br>
Does anybody have an idea, how this could be overcome?<br>
<br>
Example:<br>
Way ID has 3 bicycle relevant relations: relation IDs 2119154,
9623717,2956920. With the style from above only the last one
(relation ID 2956920, route=mtb) is shown although the second one
(relation ID 9623717, network=icn) would be desired as it is an
international bicycle route.<br>
<br>
Regards,<br>
Bernard<br>
</body>
</html>