<html>
<head>
</head>
<body class='hmmessage'><div dir='ltr'>

<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">Hi all,<br><br>I've now looked at the code in POIGeneratorHook.<br>Attached is a first attempt to solve the problem, the compiled binary<br>based on trunk version r3564 is here:<br><code><a href="http://files.mkgmap.org.uk/download/264/mkgmap.jar" target="_blank">http://files.mkgmap.org.uk/download/264/mkgmap.jar</a><br><br></code>It implements the following:<br>When POIGeneratorHook creates a POI for a type=boundary relation<br>with boundary=administrative it searches for a role=admin_centre member <br>in that relation.<br>If one is found, the generated POI will use the coordinates of this member.<br><br>I see no easy way to compare the tags of the existing<br>node with those of the generated POI, so<br>as a second step, StyledConverter detects when a POI <br>with the same type and name (or empty name) is created at the <br>same Garmin coordinates (after style processing)<br>If that is true, the latter one is ignored and an info message is logged.<br><br>Maybe for certain types this should be changed to check for a radius <br>rather than equality, but that would require complex configuration.<br><br>I think this solves the problem reported by A.Carlos, maybe it also<br>helps Stephen Sgalowski.<br><br>Please let me know if there are other member roles like admin_centre <br>which could be treated alike, or if this patch causes problem.<br><br>If I hear no complains I will commit it on sunday.<br><br>Gerd<br><br><div><hr id="stopSpelling">From: thundercel@gpsinfo.com.br<br>To: mkgmap-dev@lists.mkgmap.org.uk<br>Date: Mon, 4 May 2015 10:13:55 -0300<br>Subject: Re: [mkgmap-dev] Fw:  Help<br><br>
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>


<div dir="ltr">
<div style="FONT-SIZE:12pt;FONT-FAMILY:'Calibri';COLOR:#000000;">
<div>Hi,</div>
<div>&nbsp;</div>
<div>On Mon, May 04, Gerd Petermann wrote:</div>
<div>
<div style="FONT-SIZE:small;TEXT-DECORATION:none;FONT-FAMILY:&quot;Calibri&quot;;FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;DISPLAY:inline;">&gt; 
I got some screenshots from Anor.Carlos that show this relation:<br>&gt; <a href="http://www.openstreetmap.org/relation/333659" target="_blank">http://www.openstreetmap.org/relation/333659</a><br>&gt; which has 
name=Barra do Garças and place=town. <br><br>&gt; If I got that right, the 
--add-pois-to-area option creates a node with the tag place=town for it, 
although the relation also has a member <br>&gt; <a href="http://www.openstreetmap.org/node/415522222" target="_blank">http://www.openstreetmap.org/node/415522222</a><br>&gt; with 
place=town and name=Barra do Garças<br><br>&gt; As a result, the map contains 
two POI with very different locations, one has the additional tag 
mkgmap:area2poi=true, but that doesn't help in the style rules to filter 
duplicate entry because one doesn't know about the node 415522222. 
<br></div></div>
<div><span id="ecxresult_box" lang="en"><font face="Times New Roman"><span class="ecxhps">Yes, in</span> <span class="ecxhps">relation</span> <span class="ecxhps">the</span> <span class="ecxhps">--add</span><span class="ecxatn">-poi</span><span>-to</span><span>-area</span> <span class="ecxhps">creates 
a node</span>&nbsp;<span class="ecxhps">with</span> the tag <span class="ecxhps">place</span> <span class="ecxhps">=</span> <span class="ecxhps">town,</span> 
<span class="ecxhps">but</span> <span class="ecxhps">in</span> <span class="ecxhps">this</span> 
relation <span class="ecxhps">there is</span> <span class="ecxhps">415522222</span> <span class="ecxhps">member</span> <span class="ecxhps">node that</span> <span class="ecxhps">is 
the</span> place=<span class="ecxhps">town</span> <span class="ecxhps">positioned in 
its</span> <span class="ecxhps">true location</span><span>.</span><br><span id="ecxresult_box" lang="en"><span class="ecxhps">The knot</span> <span class="ecxhps">created</span> 
<span class="ecxhps">by the</span> <span class="ecxhps">--add</span><span>-to</span><span class="ecxatn">-it-</span><span>area</span> <span class="ecxhps">option</span> <span class="ecxhps">in this</span> <span class="ecxhps">case</span> <span class="ecxhps">duplicates 
an</span> <span class="ecxhps">existing</span> <span class="ecxhps">node place=town, <span id="ecxresult_box" lang="en"><span class="ecxhps">but</span> <span class="ecxhps">in another 
position</span><span>.</span></span></span></span></font></span></div>
<div><span lang="en"><font face="Times New Roman"><span class="ecxhps">This</span> 
<span class="ecxhps">node member</span> <span class="ecxhps">(415522222)</span> <span class="ecxhps">was included in the</span> <span class="ecxhps">relationship as</span> 
<span class="ecxhps">admin_centre</span><span>.</span></font></span></div>
<div>
<div style="FONT-SIZE:small;TEXT-DECORATION:none;FONT-FAMILY:&quot;Calibri&quot;;FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;DISPLAY:inline;"><br>&gt; 
My 1st approach would be this:<br>&gt; After style processing, keep a map that 
relates the Garmin POI with the original node, one map for each type. If two or 
more POI have the same type and label(s), remove those where the OSM element has 
the mkgmap:area2poi=true tag (maybe also the ones with 
mkgmap:line2poi=true.<br>&gt; Gerd</div></div>
<div>
<div style="FONT-SIZE:small;TEXT-DECORATION:none;FONT-FAMILY:&quot;Calibri&quot;;FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;DISPLAY:inline;">&nbsp;</div></div>
<div>
<div style="FONT-SIZE:small;TEXT-DECORATION:none;FONT-FAMILY:&quot;Calibri&quot;;FONT-WEIGHT:normal;COLOR:#000000;FONT-STYLE:normal;DISPLAY:inline;"><span id="ecxresult_box" lang="en"><font face="Times New Roman"><span class="ecxhps">For 
our</span> <span class="ecxhps">tests</span> <span class="ecxhps">in Brazil</span> <span class="ecxhps">only</span> <span class="ecxhps">identified this</span> <span class="ecxhps">occurrence of</span> <span class="ecxhps">POI</span> <span class="ecxhps">duplication</span> <span class="ecxhps">in</span> <span class="ecxhps">boundary</span> <span class="ecxhps">relations and</span> <span class="ecxhps">when there is</span> <span class="ecxhps">the relation=boundary</span> 
<span class="ecxhps">the</span> <span class="ecxhps">admin_center</span> <span class="ecxhps">included.</span></font></span></div>
<div>&nbsp;</div>
<div>Marcio<br><br></div></div></div></div>
<br>_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</div></div>
                                               </div></body>
</html>