This is a draft for the docu. Feel free to add/correct or ignore it 😊

 

Apply_first

The apply_first action is like apply,but it will apply the Action only to the FIRST member of the relation.

 

It can be used to generate a POI providing information about a routes details. Assuming the relation is tagged in the right order, the POI will be placed at the start of the route – otherwise it will be placed somewhere on the route.

 

As most relation member are of type „way“, use it together with the --add-pois-to-lines command line-option  to generate the POI.

 

Be aware that relations which are splitted into  parts (probably at the border of two tiles) may „produce“ more than one POI.

 

 

Gesendet von Mail für Windows 10

 

Von: Gerd Petermann
Gesendet: Montag, 10. Dezember 2018 14:21
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

 

Hi Andreas,

okay, I guess nobody else tried it so yes, I'll work on some documentation and commit it within the next days.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag von andreas.schmidt.hetschb...@t-online.de <andreas.schmidt.hetschb...@t-online.de>
Gesendet: Montag, 10. Dezember 2018 11:10
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

HI,

will this feature made it to the master-branch? I´m quite happy with it.

Regards

Andreas

Gesendet von Mail<https://go.microsoft.com/fwlink/?LinkId=550986> für Windows 10

Von: andreas.schmidt.hetschb...@t-online.de<mailto:andreas.schmidt.hetschb...@t-online.de>
Gesendet: Mittwoch, 28. November 2018 10:25
An: mkgmap-dev<mailto:mkgmap-dev-boun...@lists.mkgmap.org.uk>; Development list for mkgmap<mailto:mkgmap-dev@lists.mkgmap.org.uk>; Gerd Petermann<mailto:gpetermann_muenc...@hotmail.com>
Betreff: Re: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

Hi Gerd,

forget my mail from 22.11.18.

apply_first does work as expected – I just didn’t catch it how the data is processed.

Now I can

If the relation is in order and the „direction“ (role=backward/Forward) is tagged (at the first way) -> Display the POIs Right at the start
If the relation is in order but there is no direction or there are more than one relation starting at this way -> Display the POIs somewhere on the first way
If the relation is not in order -> Display the POI somewhere on the relation

I can search for POIs like „MTB-Infopint“ and get all the mtb-relations and there tagged Information (ascent, distance, etc.).

Tests with relations starting with a node still going on.

Thanks a lot so far.

Andreas


Gesendet von Mail<https://go.microsoft.com/fwlink/?LinkId=550986> für Windows 10

Von: andreas.schmidt.hetschb...@t-online.de<mailto:andreas.schmidt.hetschb...@t-online.de>
Gesendet: Donnerstag, 22. November 2018 19:37
An: Development list for mkgmap<mailto:mkgmap-dev@lists.mkgmap.org.uk>
Betreff: Re: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

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<https://go.microsoft.com/fwlink/?LinkId=550986> für Windows 10

_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to