logo separator

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

From Gerd Petermann gpetermann_muenchen at hotmail.com on Tue Dec 11 10:25:56 GMT 2018

________________________________________
Von: Gerd Petermann
Gesendet: Dienstag, 11. Dezember 2018 11:24
An: andreas.schmidt.hetschbach at t-online.de
Betreff: AW: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

Hi Andreas,

I just noticed a stupid error in the original patch which might cause crashes when logging is activated.
I've attached a 2nd version that also contains changes in the doc.
I've also attached a patch for splitter that implements a new option --route-rel-values which tells splitter
that route relations of the given type should be kept complete.
Sample usage:
--route-rel-values=mtb,bicycle

The use of the route-complete patch for splitter should reduce the number of duplicate POI.

Not sure if all this makes sense, esp. if this is the only reason to use the --add-pois-to-lines option
which can cause all kinds of trouble.
I'f prefer to have a specialized add-poi option for route relations and a logic to recognize incomplete
relations as well as a logic to sort relation members, but that really requires a lot of work for all
the possible special cases :-(

Gerd

________________________________________
Von: andreas.schmidt.hetschbach at t-online.de <andreas.schmidt.hetschbach at t-online.de>
Gesendet: Dienstag, 11. Dezember 2018 11:05
An: Gerd Petermann
Betreff: AW: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

HI Gerd,

>>>>„I prefer to document only what the apply_first does, not what it could be used for, since the results are so unpredictable“
I guess you´re absolutely right with that.

>>>>> I can change that, but I am not sure if you like what you get now?
I´m happy with the actual, but It would be very nice to have only one POI per route (at the first member of the complete relation).

Andreas



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

Von: Gerd Petermann<mailto:gpetermann_muenchen at hotmail.com>
Gesendet: Dienstag, 11. Dezember 2018 09:46
An: andreas.schmidt.hetschbach at t-online.de<mailto:andreas.schmidt.hetschbach at t-online.de>
Betreff: AW: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

Hi Andreas,

thanks for that. I prefer to document only what the apply_first does, not what it could be used for, since the results are so unpredictable.

Reg.
"Be aware that relations which are splitted into parts (probably at the border of two tiles) may „produce“ more than one POI."
It seems there is no simple way to tell splitter that it should keep route relations complete.

I can change that, but I am not sure if you like what you get now?

Gerd

________________________________________
Von: andreas.schmidt.hetschbach at t-online.de <andreas.schmidt.hetschbach at t-online.de>
Gesendet: Montag, 10. Dezember 2018 18:35
An: Development list for mkgmap; Gerd Petermann
Betreff: AW: [mkgmap-dev] Add a POI to the start of a relation (route:mtb)

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

Von: Gerd Petermann<mailto:gpetermann_muenchen at hotmail.com>
Gesendet: Montag, 10. Dezember 2018 14:21
An: Development list for mkgmap<mailto:mkgmap-dev at lists.mkgmap.org.uk>
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-bounces at lists.mkgmap.org.uk> im Auftrag von andreas.schmidt.hetschbach at t-online.de <andreas.schmidt.hetschbach at 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.hetschbach at t-online.de<mailto:andreas.schmidt.hetschbach at t-online.de>
Gesendet: Mittwoch, 28. November 2018 10:25
An: mkgmap-dev<mailto:mkgmap-dev-bounces at lists.mkgmap.org.uk>; Development list for mkgmap<mailto:mkgmap-dev at lists.mkgmap.org.uk>; Gerd Petermann<mailto:gpetermann_muenchen at 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.hetschbach at t-online.de<mailto:andreas.schmidt.hetschbach at t-online.de>
Gesendet: Donnerstag, 22. November 2018 19:37
An: Development list for mkgmap<mailto:mkgmap-dev at 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 at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
</https:></mailto:mkgmap-dev at lists.mkgmap.org.uk></mailto:andreas.schmidt.hetschbach at t-online.de></https:></mailto:gpetermann_muenchen at hotmail.com></mailto:mkgmap-dev at lists.mkgmap.org.uk></mailto:mkgmap-dev-bounces at lists.mkgmap.org.uk></mailto:andreas.schmidt.hetschbach at t-online.de></https:></andreas.schmidt.hetschbach at t-online.de></mkgmap-dev-bounces at lists.mkgmap.org.uk></mailto:mkgmap-dev at lists.mkgmap.org.uk></mailto:gpetermann_muenchen at hotmail.com></https:></andreas.schmidt.hetschbach at t-online.de></mailto:andreas.schmidt.hetschbach at t-online.de></mailto:gpetermann_muenchen at hotmail.com></https:></andreas.schmidt.hetschbach at t-online.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: route-complete.patch
Type: application/octet-stream
Size: 3566 bytes
Desc: route-complete.patch
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20181211/d31edc09/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apply_first-v2.patch
Type: application/octet-stream
Size: 3810 bytes
Desc: apply_first-v2.patch
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20181211/d31edc09/attachment-0003.obj>


More information about the mkgmap-dev mailing list