<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>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<br><br><div>From: mike@tvage.co.uk<br>To: mkgmap-dev@lists.mkgmap.org.uk<br>Date: Thu, 29 Jan 2015 12:10:40 +0000<br>Subject: Re: [mkgmap-dev] leading and trailing spaces<br><br><pre>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: GerdP [mailto:gpetermann_muenchen@hotmail.com] <br>Sent: 29 January 2015 06:18<br>To: mkgmap-dev@lists.mkgmap.org.uk<br>Subject: Re: [mkgmap-dev] 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>trim() should be used with great care as it removes the highway shield<br>codes.<br> <br>Gerd<br> <br> <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>&gt; <br>&gt; Regards,<br>&gt; Mike<br>&gt; <br>&gt; _______________________________________________<br>&gt; mkgmap-dev mailing list<br> <br>&gt; mkgmap-dev@.org<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> <br> <br> <br> <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> <br></pre><br>_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</div>                                               </div></body>
</html>