[mkgmap-dev] Ranking of relations
From Bernard Mai bm.ffb at gmx.de on Sat Jan 27 18:37:04 GMT 2024
Dear Mike, I looks like your suggestion did the trick. With the following lines in the "relations" file I get the desired display of routes in my overlay map: # bicycle routes route=bicycle { apply {set route='${route}';set route_name='$(route_name),${name}'|'${name}';set route_ref='$(route_ref),${ref}'|'${ref}';} } type=route & route=bicycle & network=icn {apply {add route_icn=yes;}} type=route & route=bicycle & network=ncn {apply {add route_ncn=yes;}} type=route & route=bicycle & network=rcn {apply {add route_rcn=yes;}} type=route & route=bicycle & network=lcn {apply {set route_lcn=yes;}} # mountainbike routes route=mtb { apply {add route_mtb=yes; add route_mtb_name='$(route_mtb_name),${name}'|'${name}'; add route_mtb_ref='$(route_mtb_ref),${ref}'|'${ref}';} } In the "lines" file I can adjust the zoom-level display and naming. For me the following lines work well: # bicycle routes route_icn=yes [0x10f01 resolution 18-20 continue] route_icn=yes {name '${route_ref}'} [0x10f01 resolution 20-23 continue] route_icn=yes {name '${route_name} (${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f02 resolution 24] route_ncn=yes [0x10f01 resolution 20-22 continue] route_ncn=yes {name '${route_ref}'} [0x10f01 resolution 23 continue] route_ncn=yes {name '${route_name} (${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f02 resolution 24] route_rcn=yes [0x10f03 resolution 21-22 continue] route_rcn=yes {name '${route_ref}'} [0x10f03 resolution 23 continue] route_rcn=yes {name '${route_name} (${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f04 resolution 24] route_lcn=yes [0x10f05 resolution 23 continue] route_lcn=yes {name '${route_name}'|'${route_ref}'} [0x10f05 resolution 24] # mtb routes route_mtb=yes {name '${route_mtb_ref}'} [0x10f06 resolution 23 continue] route_mtb=yes {name '${route_mtb_name} (${route_mtb_ref})'|'${route_mtb_name}'|'${route_mtb_ref}'} [0x10f06 resolution 24] Now I can play around, as the display of these lines as overlay map on a Garmin Epix watch is quite thin (even with lines up to 18 pixel width, having 6-7 pixel width used with a colour and the remaining pixels transparent to show the route beside any way). In general, my experience is that specially on a watch all bitmap lines are hard to see. Many thanks and regards, Bernard Am 27.01.2024 um 16:11 schrieb mike at tvage.co.uk: > > HI Bernard, > > I can’t see why bicycle routes should be displaying in the wrong > order, but if an MTB route runs along a bicycle route and its relation > is processed after the bicycle one, I think the route value will be > changed from bicycle to mtb. I suggest using add instead of set on the > relation statement for mountain bike routes: > > type=route & route=mtb > { > apply > {add route='${route}'; set > route_mtb_name='$(route_mtb_name),${name}'|'${name}'; set > route_mtb_ref='$(route_mtb_ref),${ref}'|'${ref}';} > } > > Regards, > > Mike > > *From:*Bernard Mai <bm.ffb at gmx.de> > *Sent:* 26 January 2024 10:50 > *To:* mkgmap-dev at lists.mkgmap.org.uk > *Subject:* [mkgmap-dev] Ranking of relations > > Dear all, > 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). > As most routes in openstreetmap are defined as relations I am using > the following rules in my bike-routes style: > > *relations (file)* > # Route relations as additional transparent layer for: > # bicycle > # mtb > > # bicycle routes > type=route & route=bicycle > { > apply > {set route='${route}';set > route_name='$(route_name),${name}'|'${name}';set > route_ref='$(route_ref),${ref}'|'${ref}';} > } > type=route & route=bicycle & network=icn {apply {set route_icn=yes;}} > type=route & route=bicycle & network=ncn {apply {set route_ncn=yes;}} > type=route & route=bicycle & network=rcn {apply {set route_rcn=yes;}} > type=route & route=bicycle & network=lcn {apply {set route_lcn=yes;}} > > # mountainbike routes > type=route & route=mtb > { > apply > {set route='${route}'; set > route_mtb_name='$(route_mtb_name),${name}'|'${name}'; set > route_mtb_ref='$(route_mtb_ref),${ref}'|'${ref}';} > } > > *lines (file)* > # bicycle routes > route=bicycle & route_icn=yes {name '${route_ref}'} > [0x10f01 resolution 18-22 continue] > route=bicycle & route_icn=yes {name '${route_name} > (${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f02 resolution > 23-24] > > route=bicycle & route_ncn=yes > [0x10f01 resolution 20-22 continue] > route=bicycle & route_ncn=yes {name '${route_ref}'} > [0x10f02 resolution 23 continue] > route=bicycle & route_ncn=yes {name '${route_name} > (${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f02 resolution 24] > > route=bicycle & route_rcn=yes > [0x10f03 resolution 20-22 continue] > route=bicycle & route_rcn=yes {name '${route_ref}'} > [0x10f04 resolution 23 continue] > route=bicycle & route_rcn=yes {name '${route_name} > (${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f04 resolution 24] > > route=bicycle & route_lcn=yes {name '${route_name} > (${route_ref})'|'${route_name}'|'${route_ref}'} [0x10f05 resolution 24] > > # mtb routes > route=mtb {name '${route_mtb_ref}'} > [0x10f06 resolution 23 continue] > route=mtb {name '${route_mtb_name} > (${route_mtb_ref})'|'${route_mtb_name}'|'${route_mtb_ref}'} > [0x10f06 resolution 24] > > > 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. > 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? > 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? > Does anybody have an idea, how this could be overcome? > > Example: > 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. > > Regards, > Bernard > > > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev at lists.mkgmap.org.uk > https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20240127/d7e63462/attachment-0001.html>
- Previous message: [mkgmap-dev] Ranking of relations
- Next message: [mkgmap-dev] Ranking of relations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list