<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Mike,<br><br>committed with r3435.<br>I had to modify one of the unit tests, please remember to run <br>ant test <br>and check the results when you post a patch.<br>I also hesitated because we are now trimming the values before we<br>actually know if they are used at all, but the performance implication<br>seems very small.<br>I really don't like this repeated code around the keepTag() call in three readers.<br>I think it should be possible to implement something like<br>void addTagIfUsed(Element e, String tag, String val)<br>which combines the code. <br><br>Gerd<br><br><div><hr id="stopSpelling">From: mike@tvage.co.uk<br>To: mkgmap-dev@lists.mkgmap.org.uk<br>Date: Fri, 30 Jan 2015 11:25:25 +0000<br>Subject: Re: [mkgmap-dev] leading and trailing spaces<br><br><style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {
font-size:12.0pt;
font-family:"Times New Roman",serif;
}

.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink {
color:blue;
text-decoration:underline;
}

.ExternalClass span.ecxMsoHyperlinkFollowed {
color:purple;
text-decoration:underline;
}

.ExternalClass p {
font-size:12.0pt;
font-family:"Times New Roman",serif;
}

.ExternalClass pre {
font-size:10.0pt;
font-family:"Courier New";
}

.ExternalClass span.ecxHTMLPreformattedChar {
font-family:"Consolas",serif;
}

.ExternalClass span.ecxEmailStyle20 {
font-family:"Calibri",sans-serif;
color:#1F497D;
}

.ExternalClass span.ecxSpellE {
}

.ExternalClass span.ecxGramE {
}

.ExternalClass .ecxMsoChpDefault {
font-size:10.0pt;
}

.ExternalClass div.ecxWordSection1 {
}

--></style><div class="ecxWordSection1"><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;">Hi <span class="ecxSpellE">Gerd</span>, good point. There isn’t any single place that can fix for all the input formats as far as I can see. The attached patch separately updates each of the readers.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;">&nbsp;</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;">Regards,</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;">Mike</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;">&nbsp;</span></p><div><div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm;"><p class="ecxMsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;" lang="EN-US"> Gerd Petermann [mailto:gpetermann_muenchen@hotmail.com] <br><b>Sent:</b> 29 January 2015 15:03<br><b>To:</b> mkgmap-dev@lists.mkgmap.org.uk<br><b>Subject:</b> Re: [mkgmap-dev] leading and trailing spaces</span></p></div></div><p class="ecxMsoNormal">&nbsp;</p><div><p class="ecxMsoNormal" style=""><span style="font-family:&quot;Calibri&quot;,sans-serif;">Hi Mike,<br><br>I'd prefer a patch that changes the behaviour also for xml and o5m input,<br>not just for *.pbf.&nbsp; Maybe you find a place where this can be done once for<br>all sources?<br><br>Gerd</span></p><div><p class="ecxMsoNormal" style=""><span style="font-family:&quot;Calibri&quot;,sans-serif;">From: <a href="mailto:mike@tvage.co.uk">mike@tvage.co.uk</a><br>To: <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>Date: Thu, 29 Jan 2015 12:10:40 +0000<br>Subject: Re: [mkgmap-dev] leading and trailing spaces</span></p><pre style="">Hi Gerd, you are right; trim() removes all leading and trailing characters<br>that are less than 0x20. However, the place I mention is reading the raw OSM<br>data before any styles have been applied, so this should not be a problem.<br> <br>I agree with Paco that ideally the OSM data should be corrected, but that<br>will always be playing catch up, so I think it is best to also remove them<br>in the mkgmap processing. I have corrected a number of local ones in OSM,<br>but there are too many to correct them all manually.<br> <br>I've attached a patch that seems to be OK to me. Please give it a try.<br> <br>Regards,<br>Mike<br> <br>-----Original Message-----<br>From: <span class="ecxSpellE">GerdP</span> [<a href="mailto:gpetermann_muenchen@hotmail.com">mailto:gpetermann_muenchen@hotmail.com</a><span class="ecxGramE">] <br>Sent</span>: 29 January 2015 06:18<br>To: <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a><br>Subject: Re: [mkgmap-<span class="ecxSpellE">dev</span>] leading and trailing spaces<br> <br>Hi Mike,<br> <br>I can't find it now, but I seem to remember a comment that<br><span class="ecxGramE">trim(</span>) should be used with great care as it removes the highway shield<br><span class="ecxGramE">codes</span>.<br> <br>Gerd<br> <br><span style="">&nbsp;</span><br>Mike Baggaley wrote<br>&gt; Good evening all,<br>&gt; <br>&gt; I've noticed that there are a number of unwanted leading and trailing<br>&gt; spaces<br>&gt; in OSM data. You can get a list of the ones on the name field using the<br>&gt; following:<br>&gt; <br>&gt; name~'.* ' {echotags "name ends with a space"}<br>&gt; name~' .*' {echotags "name starts with a space"}<br>&gt; <br>&gt; I can't see any facility in mkgmap to remove these, and was wondering<br>&gt; whether the best way would be simply to code them out by replacing the<br>&gt; following line in parseDense, parseNodes, ParseWays and parseRelations:<br>&gt; <br>&gt; String val = getStringById(...);<br>&gt; <br>&gt; With<br>&gt; <br>&gt; String val = getStringById(...).trim();<br>&gt; <br>&gt; I can't think of any reason why a value would need to start or end with a<br>&gt; space, so it seems reasonable to just remove them. Are there any other<br>&gt; suggestions, or reasons why this should not be done?<br><span class="ecxGramE">&gt; <br>&gt;</span> Regards,<br>&gt; Mike<br>&gt; <br>&gt; _______________________________________________<br>&gt; <span class="ecxGramE">mkgmap-dev</span> mailing list<br> <br>&gt; <a href="mailto:mkgmap-dev@.org">mkgmap-dev@.org</a><br> <br>&gt; <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><span style="">&nbsp;</span><br><span style="">&nbsp;</span><br><span style="">&nbsp;</span><br><span style="">&nbsp;</span><br>--<br>View this message in context:<br><a href="http://gis.19327.n5.nabble.com/leading-and-trailing-spaces-tp5831778p5831782" target="_blank">http://gis.19327.n5.nabble.com/leading-and-trailing-spaces-tp5831778p5831782</a><br>.html<br>Sent from the Mkgmap Development mailing list archive at Nabble.com.<br> </pre><p class="ecxMsoNormal"><span style="font-family:&quot;Calibri&quot;,sans-serif;"><br>_______________________________________________ mkgmap-<span class="ecxSpellE">dev</span> mailing list <a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a> <a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a></span></p></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></body>
</html>