<div><span class="gmail_quote">Reposted with attachment removed<br><br></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span class="q">
<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>I took a smaller area and converted it successfully for my garmin<br>device. Unfortunately some weird red lines are crossing the map. I
<br>guessed those are caused by ways which haven't been downloaded<br>completely, due to the bounding box specified. </blockquote></div><br><br></span>The reason for this might also be that segments in a way are not neccessarily ordered. As cgpsmapper draws lines from points to points, these ways appear as roads pointing back to themselves. This inconsistency in the OSM DB is most likely for longer ways and motorways are most visible. There have been various discussions on this in this forum on how to solve it.
<br><br>I had been working indepenently of Jochen on a OSM to Garmin GPS converter and I solved this problem of unordered streets by writing a preprocessing XSLT file, which simply breaks up all ways that are not ordered into individual ways  of one segment each. It is not very elegant but it works. As the result is again an OSM XML file, you can simply process the XML file as downloaded from OSM with it, then do all the steps you did with Jochen's scripts. 
<br><br>I used it with the sabcmd xslt processor (sabcmd.exe fix.xsl input.xml output.xml), other XSLT processors should work similarly, but I have not tried. Jochen tried this script and it worked for him.<br><br>(I had mailed Jochen the script for inclusion in his toolboox, as I just checked he has not done this, so I include it again at the end of this mail).
<br><br>I incidentally made a karlsruhe map with my processor as a test application, let me know if it is any good for you.<br><br>HTH<br><br>Ludwig<br><br>Attachment (copy it into a file fix.xsl)<br><br><br><?xml version="
1.0" encoding="iso-8859-1"?><br><!-- (c) 2007 Ludwig M Brinckmann, ludwigbrinckmann (at) <a href="http://gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">gmail.com</a>
<br>This is free software; you can redistribute it and/or modify<br>it under the terms of the GNU General Public License as published by
<br>the Free Software Foundation; either version 2 of the License, or<br>(at your option) any later version.<br><br>These scripts are distributed in the hope that it will be useful,<br>but WITHOUT ANY WARRANTY; without even the implied warranty of
<br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>GNU General Public License for more details.<br><br>You should have received a copy of the GNU General Public License<br>along with these files; if not, write to the Free Software
<br>Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA<br>--><br><xsl:stylesheet version="1.0" xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.w3.org/1999/XSL/Transform
</a>"><br><xsl:output method="xml" indent="no" omit-xml-declaration="yes"/><br><br><xsl:template match="text()"/><br><br><xsl:template match="osm"><osm><xsl:apply-templates select="way|segment|node"/></osm></xsl:template>
<br><br><xsl:key name="node" match="/osm/node" use="@id"/><br><xsl:key name="segment" match="/osm/segment" use="@id"/><br><br><xsl:template match="segment|node">
<br><xsl:copy-of select="."/><br></xsl:template><br><br><xsl:template name="splitway"><br><xsl:param name="way"/><br><xsl:for-each select="seg"><br><way id="{../@id}">
<br><seg id="{@id}"/><br><xsl:for-each select="../tag"><br><xsl:copy-of select="."/><br></xsl:for-each><br></way><br></xsl:for-each><br></xsl:template>
<br><br><xsl:template match="way"><br><xsl:variable name="splitifnotempty"><br><xsl:for-each select="seg"><br><xsl:if test="position() != last()"><br><xsl:variable name="thissegment" select="key('segment',@id)"/>
<br><xsl:variable name="next" select="position()+1"/><br><xsl:variable name="nextsegment" select="key('segment',../seg[$next]/@id)"/><br><xsl:variable name="tolon" select="key('node',$thissegment/@to)/@lon"/>
<br><xsl:variable name="tolat" select="key('node',$thissegment/@to)/@lat"/><br><xsl:variable name="fromlon" select="key('node',$nextsegment/@from)/@lon"/>
<br><xsl:variable name="fromlat" select="key('node',$nextsegment/@from)/@lat"/><br><!-- breaking ways with more than 28 segments for cgpsmapper routing --><br><xsl:if test="$tolon != $fromlon or $tolat != $fromlat or $next &gt; 28 ">
<br><!--xsl:if test="$tolon != $fromlon or $tolat != $fromlat"--><br><xsl:value-of select="../@id"/>fail<br></xsl:if><br></xsl:if><br></xsl:for-each><br></xsl:variable>
<br><xsl:choose> <br><xsl:when test="$splitifnotempty=''"><br><xsl:copy-of select="."/><br></xsl:when><br><xsl:otherwise><br><xsl:call-template name="splitway">
<br><xsl:with-param name="way" select="."/><br></xsl:call-template><br></xsl:otherwise><br></xsl:choose><br></xsl:template><br></xsl:stylesheet><br><br><br><br>

<br clear="all"></blockquote></div><br>