<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi, Gerd,</div>
<div> </div>
<div>I think, there shouldn't be a problem. Actually, if you are using a filter inside of the apply{} block, you would presumably like to be able to access the current element from the filter. At the moment you don't have such a possibility at all.</div>
<div>If though there will be need to pass a tag from the global relation to the filter, one can always assign a global tag to a temporary local tag before calling the filter with this local tag.</div>
<div>So, in my mind, nothing should go wrong here. Perhaps someone else can say something more regarding this issue.</div>
<div> </div>
<div>Max</div>
<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Donnerstag, 29. Januar 2015 um 18:30 Uhr<br/>
<b>Von:</b> GerdP <gpetermann_muenchen@hotmail.com><br/>
<b>An:</b> mkgmap-dev@lists.mkgmap.org.uk<br/>
<b>Betreff:</b> Re: [mkgmap-dev] Patch: New filter "not-contained"</div>
<div>Hi Max,<br/>
<br/>
not sure. What will happen if one uses another filter in the relations file?<br/>
<br/>
Gerd<br/>
<br/>
<br/>
&quot;Maxim Düster&quot; wrote<br/>
> Hi, Gerd,<br/>
><br/>
> &nbsp;<br/>
><br/>
> the change is caused by the fact that the filter was thought primarily for<br/>
> working in relations file inside of the apply{} block and needs that the<br/>
> tag given as last parameter is a local tag of the element being processed<br/>
> (e.g. a way). But the old code line says: &quot;value =<br/>
> filter.filter(tagval,el);&quot;, &#39;el&#39; being the parent relation<br/>
> the way is in. That is, in the filter I only have an access to the<br/>
> (global) relation&#39;s tags, but what I actually need are the tags of the<br/>
> (local) element being currently processed.<br/>
><br/>
> While applying filters to &quot;plain&quot; elements (those not inside a<br/>
> relation, e.g. in points or lines files), &#39;local_el&#39; and<br/>
> &#39;el&#39; are equal, so my change should not corrupt anything.<br/>
><br/>
> &nbsp;<br/>
><br/>
> Max<br/>
><br/>
> &nbsp;<br/>
><br/>
> Gesendet:&nbsp;Donnerstag, 29. Januar 2015 um 11:20 Uhr<br/>
> Von:&nbsp;&quot;Gerd Petermann&quot; &lt;<br/>
<br/>
> gpetermann_muenchen@<br/>
<br/>
> &gt;<br/>
> An:&nbsp;&quot;<br/>
<br/>
> mkgmap-dev@.org<br/>
<br/>
> &quot; &lt;<br/>
<br/>
> mkgmap-dev@.org<br/>
<br/>
> &gt;<br/>
> Betreff:&nbsp;Re: [mkgmap-dev] Patch: New filter &quot;not-contained&quot;<br/>
><br/>
><br/>
><br/>
> Hi Maxim,<br/>
><br/>
> please can you explain the reason for the change in ValueItem?<br/>
><br/>
> Gerd<br/>
> &nbsp;<br/>
><br/>
> From:<br/>
<br/>
> maxc@<br/>
<br/>
><br/>
> To:<br/>
<br/>
> mkgmap-dev@.org<br/>
<br/>
><br/>
> Date: Wed, 28 Jan 2015 12:12:25 +0100<br/>
> Subject: [mkgmap-dev] Patch: New filter &quot;not-contained&quot;<br/>
> &nbsp;<br/>
><br/>
> Hello!<br/>
> &nbsp;<br/>
> I&#39;ve attached a patch with a new filter that helps while processing,<br/>
> for example, public transport relations. The reason: there can be multiple<br/>
> route relations with the same ref attribute (for example, one for the<br/>
> forward direction, one for the return direction), combined to a<br/>
> route_master relation.<br/>
><br/>
> If you want a name for a way to contain the refs of all of the routes<br/>
> going through that way, you have a problem that some refs will be present<br/>
> more than once, similar to &quot;1,1,2,2,2&quot; (if we assume that route<br/>
> 1 has two instances, and route 2 - three instances).<br/>
><br/>
> The new filter helps to circumvent this. It takes 2 parameters: a<br/>
> delimiter (a comma in the example above) and the name of a tag containg<br/>
> the list. The filter works a bit like the &quot;not-equal&quot; filter,<br/>
> but it doesn&#39;t just compare two values; instead it looks if the<br/>
> tag&#39;s value (to which the filter is being applied) is contained in the<br/>
> list from the (other) given tag. If it is not the case, the value can be<br/>
> added to the list, otherwise the tag is considered unset.<br/>
><br/>
> &nbsp;<br/>
><br/>
> Simple example for relations file:<br/>
><br/>
> &nbsp;<br/>
><br/>
> type=route &amp; route=bus &amp; ref=* {<br/>
> &nbsp;&nbsp; apply {<br/>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set<br/>
> route_ref=&#39;&#36;(route_ref),&#36;{ref&#124;not-contained:,:route_ref}&#39;<br/>
> &#124; &#39;&#36;(route_ref)&#39; &#124; &#39;&#36;{ref}&#39;;<br/>
> &nbsp;&nbsp; }<br/>
> }<br/>
><br/>
> &nbsp;<br/>
><br/>
> Here, ref value is only added to route_ref if it is not already contained<br/>
> in that list (with separator &#39;,&#39;). Otherwise, the value of<br/>
> route_ref is unchanged.<br/>
> &nbsp;<br/>
> Cheers!<br/>
> Max<br/>
><br/>
><br/>
> _______________________________________________ mkgmap-dev mailing list<br/>
<br/>
> mkgmap-dev@.org<br/>
<br/>
> <a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a><br/>
><br/>
> _______________________________________________ mkgmap-dev mailing list<br/>
<br/>
> mkgmap-dev@.org<br/>
<br/>
> <a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a><br/>
><br/>
><br/>
><br/>
><br/>
><br/>
> _______________________________________________<br/>
> mkgmap-dev mailing list<br/>
<br/>
> mkgmap-dev@.org<br/>
<br/>
> <a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
--<br/>
View this message in context: <a href="http://gis.19327.n5.nabble.com/Patch-New-filter-not-contained-tp5831668p5831841.html" target="_blank">http://gis.19327.n5.nabble.com/Patch-New-filter-not-contained-tp5831668p5831841.html</a><br/>
Sent from the Mkgmap Development mailing list archive at Nabble.com.<br/>
_______________________________________________<br/>
mkgmap-dev mailing list<br/>
mkgmap-dev@lists.mkgmap.org.uk<br/>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a></div>
</div>
</div>
</div></div></body></html>