<div dir="ltr">Ah sorry - I missed the entry about that point in the style manual.... Now I understand it.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 25 Nov 2021 at 18:00, Felix Hartmann <<a href="mailto:extremecarver@gmail.com">extremecarver@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Oh sorry - no my mistake was different - I used the wrong brackets. However I could not find anywhere where this is documented.<div>working:</div><div><span style="color:rgb(0,0,0)">set route_name_hiking1 = '$<b>(route_name_hiking1)</b> + ${name|not-contained: + :route_name_hiking1}' | 'IWN ${name}' | <b>'$(route_name_hiking1)</b>' | 'IWN'</span><br></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">not working:</span></div><div><span style="color:rgb(0,0,0)">set route_name_hiking1 = '$<b>{route_name_hiking1}</b> + ${name|not-contained: + :route_name_hiking1}' | 'IWN ${name}' | <b>'${route_name_hiking1}</b>' | 'IWN'</span><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Why do we have to use standard brackets when referencing a value inside the apply action? Usually for referencing a value we need to use curly {} brackets... </span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 25 Nov 2021 at 16:17, Felix Hartmann <<a href="mailto:extremecarver@gmail.com" target="_blank">extremecarver@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I think there is a bug in mkgmap.<div><br></div><div>This line works as intended:</div><div>set route_name_hiking1 = '${route_name_hiking1} + ${name|not-contained: + :route_name_hiking1}' | 'IWN ${name}' | '${route_name_hiking1}' | 'IWN'<br></div><div>while this line in the relations file fails to work as expected - the part after the + is not added - or at least not visible (strangely the map size is pretty similar).</div><div>set route_name_hiking1 = '${route_name_hiking1} + ${name}' | 'IWN ${name}' | '${route_name_hiking1}' | 'IWN'<br></div><div><br></div><div><br></div><div>So only by including the not-contained filter ithe relations file is actually adding the names of the routes after each other - while they are not added without such a filter.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 24 Nov 2021 at 10:45, Felix Hartmann <<a href="mailto:extremecarver@gmail.com" target="_blank">extremecarver@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">I will try your example to see where it goes wrong. Apply_once is about forward and backward relations. It should not matter: <a href="https://www.mkgmap.org.uk/pipermail/mkgmap-dev/2010q1/006268.html" target="_blank">https://www.mkgmap.org.uk/pipermail/mkgmap-dev/2010q1/006268.html</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 23 Nov 2021, 19:32 Mike Baggaley <<a href="mailto:mike@tvage.co.uk" target="_blank">mike@tvage.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB"><div><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Felix,<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">This is what I have in my relations file for routes:<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">type=route & state!=proposed & route~'.*bicycle.*' & network~'.*<span>ncn</span>.*' & ref~'\d*' { <span>apply_once</span> { set <span>nationalbicycleroute</span>=yes; set <span>rn</span>='$(<span>rn</span>) & ${<span>ref|not-contained</span>: & :<span>rn</span>}' | '$(<span>rn</span>)' | '${ref}'; set <span>nrn</span>='$(<span>nrn</span>) & ${<span>ref|not-contained</span>: & :<span>nrn</span>}' | '$(<span>nrn</span>)' | '${ref}'; } }<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">type=route & state!=proposed & route~'.*bicycle.*' & network~'.*<span>rcn</span>.*' & ref~'\d*' { <span>apply_once</span> { set <span>regionalbicycleroute</span>=yes; set <span>rn</span>='$(<span>rn</span>) & ${<span>ref|not-contained</span>: & :<span>rn</span>}' | '$(<span>rn</span>)' | '${ref}'; } }<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">type=route & state!=proposed & (route~'.*foot.*' | route~'.*hiking.*') & network~'.*[<span>nr</span>]<span>wn</span>.*' & name~".*\(.*\)" { set name='${<span>name|subst</span>:"\(.*\)~>"}'}<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">type=route & state!=proposed & (route~'.*foot.*' | route~'.*hiking.*') & network~'.*<span>nwn</span>.*' & name=* { <span>apply_once</span> { set <span>nationalhikingroute</span>=yes; set <span>rn</span>='$(<span>rn</span>) & ${<span>name|not-contained</span>: & :<span>rn</span>}' | '$(<span>rn</span>)' | '${name}'; set <span>nrn</span>='$(<span>nrn</span>) & ${<span>name|not-contained</span>: & :<span>nrn</span>}' | '$(<span>nrn</span>)' | '${name}'; set <span>nwrn</span>='$(<span>nwrn</span>) & ${<span>name|not-contained</span>: & :<span>nwrn</span>}' | '$(<span>nwrn</span>)' | '${name}'; } }<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">type=route & state!=proposed & (route~'.*foot.*' | route~'.*hiking.*') & network~'.*<span>rwn</span>.*' & name=* { <span>apply_once</span> { set <span>regionalhikingroute</span>=yes; set <span>rn</span>='$(<span>rn</span>) & ${<span>name|not-contained</span>: & :<span>rn</span>}' | '$(<span>rn</span>)' | '${name}'; } }<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The most significant difference is that I have <span>apply_once</span> rather than apply.<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hope this helps,<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Mike<u></u><u></u></span></font></p><p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></font></p><p class="MsoNormal"><b><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;font-weight:bold">From:</span></font></b><font size="2" face="Calibri"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> Felix Hartmann [mailto:<a href="mailto:extremecarver@gmail.com" rel="noreferrer" target="_blank">extremecarver@gmail.com</a>] <br><b><span style="font-weight:bold">Sent:</span></b> 23 November 2021 13:31<br><b><span style="font-weight:bold">To:</span></b> Development list for mkgmap <<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk" rel="noreferrer" target="_blank">mkgmap-dev@lists.mkgmap.org.uk</a>><br><b><span style="font-weight:bold">Subject:</span></b> [mkgmap-dev] Failure to understand apply logic in relations - or failure in the logic<u></u><u></u></span></font></p><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt"><u></u> <u></u></span></font></p><div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt">route=hiking { apply { set route=hiking; set route_name = '${route_name} & ${name}' | '${name}'; add route_ref = '${ref}'; } }<u></u><u></u></span></font></p><div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt"><u></u> <u></u></span></font></p></div><div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt">I would expect that this rule if several relations are matching one line, adds all names of route=hiking relations to the route_name variable separated by "&". However it is only adding the first found.<u></u><u></u></span></font></p></div><div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt"><u></u> <u></u></span></font></p></div><div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt">Where is my mistake?<br clear="all"><u></u><u></u></span></font></p><div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt"><u></u> <u></u></span></font></p></div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt">-- <u></u><u></u></span></font></p><div><div><div><div><div><div><div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt">Felix Hartman - Openmtbmap.org & VeloMap.org<u></u><u></u></span></font></p></div><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:12pt"><u></u> <u></u></span></font></p></div></div></div></div></div></div></div></div></div></div></blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Felix Hartman - Openmtbmap.org & VeloMap.org<br></div><br></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Felix Hartman - Openmtbmap.org & VeloMap.org<br></div><br></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Felix Hartman - Openmtbmap.org & VeloMap.org<br></div><br></div></div></div></div></div></div>