logo separator

[mkgmap-dev] Add a POI to the start of a relation (route:mtb)

From andreas.schmidt.hetschbach at t-online.de andreas.schmidt.hetschbach at t-online.de on Thu Nov 22 18:37:07 GMT 2018

Hi Gerd,
 great idea and it works good for my puposes. In principle I try to do the following:
 Use Option –add-pois-to-lines
• Add a tag route_mtb_info_point to the first member of a route
• Add all the relevant relation Information
• Add the „direction“ (role=backward/Forward) of the first member
• Add an element in the Points-file which is shown at the start or the end (or in the middle if there is no direction) in relation of the direction of the way
I can search for POI like „MTB-Info…“ and get all the MTB-Routes around my Position. The POI are at the start (or nearby) of the route (if the mebers are ordered) or somewhere on the route – as expected. Sometimes there are two POI for one route
 I have the following in my style:
#add tag for direction to each member, could be both if way is twice or more with diff Direction in the route.
route=mtb{apply
                role ='backward'{set mtb_role_backward="yes";}
}
route=mtb {apply
                role ='forward'{ set mtb_role_forward="yes";}
}
 #save data of first member of the route, (could be more than one route but not relevant in this example)
 route=mtb{apply_first {
                                                               set route_mtb_info_point="yes";
                                                               set route_mtb_info_point_forward="$(mtb_role_forward)";
                                                               set route_mtb_info_point_backward="$(mtb_role_backward)";
                                                               set route_mtb_name="$(route_mtb_name)-${name}"|"${name}";
                                                               set route_mtb_ref="$(route_mtb_ref)-${ref}"|"${ref}";
                                                               set route_mtb_info_actual ="HM:k.A.,KM:k.A.";
                                                               set route_mtb_info_actual="HM:${ascent},KM:${distance}" | "HM:${fee},KM:${distance}" | "KM:${distance}" | "HM:${ascent}";
                                                               set route_mtb_info="$(route_mtb_info)-$(route_mtb_info_actual)"|"$(route_mtb_info_actual)";
                                                               echotags"rel apply_first"
                                               }
 
I expected that for a way which is only member of one relation the values of
route_mtb_info_point_forward and route_mtb_info_point_backward
could never be „yes“ at the same time for both, because only the first member of the relation is under investigation. But it seems that if a way is more than once a member in a relation, the data of both positions are stored (the way is the first (backward) and the last (Forward) member of the relation).
 
Way 337595135 [highway=track, motor_vehicle=forestry, mtb_role_backward=yes, mtb_role_forward=yes, route_bicycle=yes, route_hiking=yes, route_mtb_info=HM:754,KM:30, route_mtb_info_actual=HM:754,KM:30, route_mtb_info_point=yes, route_mtb_info_point_backward=yes, route_mtb_info_point_forward=yes, route_mtb_name=MTB-Strecke Breuberg 1, route_mtb_ref=Bb1, route_name=Odenwaldklub HW 27, Seligenstadt - Waldbrunn - Bad Rappenau-2-Burgen-Radweg-Rundwanderweg Breuberg Burg Breuberg 3: Scheuerberg-Weg-Rundwanderweg Breuberg Burg Breuberg 2: Schanzen-Weg-Rundwanderweg Breuberg Burg Breuberg 2: Schanzen-Weg-Südhessen-Route 22, route_ref=HW 27-2BR-3-2-2-22, route_symbol=rotes X auf weißem Grund, tracktype=grade2] rel apply_first
 The Points – file includes the following:
 route_mtb_info_point="yes" & route_mtb_info_point_forward="yes" & mkgmap:line2poitype=start  {set mkgmap:label:1 = "MTB-Info: ${route_mtb_ref} ${route_mtb_name} ${route_mtb_info}"}[0x1010a resolution 20-24 ]
route_mtb_info_point="yes" & route_mtb_info_point_backward="yes" & mkgmap:line2poitype=end  {set mkgmap:label:1 = "MTB-Info: ${route_mtb_ref} ${route_mtb_name} ${route_mtb_info}"}[0x1010a resolution 20-24 ]
route_mtb_info_point="yes" & mkgmap:line2poitype=mid & route_mtb_info_point_backward!=* & route_mtb_info_point_forward!=* {set mkgmap:label:1 = "MTB-Info: ${route_mtb_ref} ${route_mtb_name} ${route_mtb_info}"}[0x1010a resolution 20-24 ]
 
This results in 2 POIs for this route. 

Andreas

Gesendet von Mail für Windows 10

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20181122/b0ba4fb2/attachment-0001.html>


More information about the mkgmap-dev mailing list