<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Préformaté HTML Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texte de bulles Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
span.TextedebullesCar
        {mso-style-name:"Texte de bulles Car";
        mso-style-priority:99;
        mso-style-link:"Texte de bulles";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PrformatHTMLCar
        {mso-style-name:"Préformaté HTML Car";
        mso-style-priority:99;
        mso-style-link:"Préformaté HTML";
        font-family:"Consolas","serif";
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1386489502;
        mso-list-type:hybrid;
        mso-list-template-ids:-22630446 135004175 135004185 135004187 135004175 135004185 135004187 135004175 135004185 135004187;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="FR-BE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Hi Peter,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks for you answer.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">We are willing to have this feature as ap so we could develop it and share it.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">But as you already have your idea of the way to implement it I’d be glad if you could give me guide lines so that I don’t diverge (much) from your idea an keep a good coherency in the project.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">So as I said earlier my vision was modify the
<a href="eclipse-javadoc:%E2%98%82=graphhopper/src%5C/main%5C/java%3Ccom.graphhopper%7BGraphHopper.java%E2%98%83GraphHopper%5Eindex%E2%98%82Location2IDIndex">
<span style="color:#1F497D;text-decoration:none">Location2IDIndex</span></a> and return an edge instead of a nodeId.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Then create instrument method to find the tower node to be rooted out of (the edge + gps point + boolean telling if it’s an origin or destination (for one way restrictions))<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I would then get proper from and to tower nodeIds I can pass to the routing algorithm to compute the path.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Once the algorithm returns me the path, I’d use my 2 previously computed edges to “finish the job” and correct the extremities of the road.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">The two problem of this approach I can already see, are
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US" style="color:#1F497D"><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span lang="EN-US" style="color:#1F497D">how can I retrieve one single edge when I only have its ID<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US" style="color:#1F497D"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span lang="EN-US" style="color:#1F497D">how can I retrieve the two tower nodes out of an EdgeIterator<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">What do you think ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D;mso-fareast-language:FR-BE">Nicolas GILLET<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D;mso-fareast-language:FR-BE"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D;mso-fareast-language:FR-BE">Market-IP –</span></b><i><span lang="EN-US" style="color:#1F497D;mso-fareast-language:FR-BE">
</span></i><i><span lang="EN-US" style="color:#404040;mso-fareast-language:FR-BE">Creating Mobile Intelligence</span></i><span lang="EN-US" style="color:#1F497D;mso-fareast-language:FR-BE"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="FR" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:FR-BE">De :</span></b><span lang="FR" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:FR-BE">
 Peter K [mailto:peathal@yahoo.de] <br>
<b>Envoyé :</b> mardi 14 mai 2013 16:32<br>
<b>À :</b> graphhopper@openstreetmap.org<br>
<b>Objet :</b> Re: [GraphHopper] Improve route's geometry<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Nicolas,<br>
<br>
this limitation will be removed with solving this issue:<br>
<a href="https://github.com/graphhopper/graphhopper/issues/27">https://github.com/graphhopper/graphhopper/issues/27</a><br>
<br>
BTW: nodes between edges in graphhopper are only stored in wayGeometry (see GraphStorage), not as real nodes. This was introduced as this speeds up querying a lot and also space is reduced.<br>
<br>
Regards,<br>
Peter.<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Hello,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I noticed that routes are computed only between the graph’s nodes, and the route does not go close enough to the actual GPS points.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I also noticed that there is a small mistake when selecting the start/end node when the GPS point falls on an “one way” edge.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">The current behavior is to find the closest edge to the lon/lat coordinates and then find the closest node on this edge to the lon/lat.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">When an edge is one way, you don’t have to take the closes node on the edge but the node that will respect the traffic flow.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Mean if your starting point fall on an one way edge, you’ll have to start the routing form the end point of this edge, no matter the starting point may be closer to your GPS coordinates. Indeed, if you go from you gps
 point to the start node, you’ll have to violate the one way restriction.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">(see attachment as example)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">In this picture we also see the first thing I mentioned : the geometry lacks of accuracy between nodes and GPS coordinates ; the blue line does not “stop” exactly at the two little flags representing my GPS coordinates.
 (green flag: start, red flag : end)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I started digging into the code in order to solve these two issues and I came up thinking that the whole API needs a bit of rework.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Right now the node resolution returns a node ID but I think it should rather return an EdgeIterator of the matched edge.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">With this edge, it’s possible to find the appropriate start/end node depending on the lon/lat of the point and the fact that edge is one way. It’s also possible “finish” the road and compute the missing/exceeding parts
 of the road.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Am I missing something ?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Do you think that my point of view is correct ?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thank you</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D;mso-fareast-language:FR-BE">Nicolas GILLET</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;color:#1F497D;mso-fareast-language:FR-BE"> </span><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D;mso-fareast-language:FR-BE">Market-IP –</span></b><i><span lang="EN-US" style="color:#1F497D;mso-fareast-language:FR-BE">
</span></i><i><span lang="EN-US" style="color:#404040;mso-fareast-language:FR-BE">Creating Mobile Intelligence</span></i><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR-BE"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>GraphHopper mailing list<o:p></o:p></pre>
<pre><a href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a><o:p></o:p></pre>
<pre><a href="http://lists.openstreetmap.org/listinfo/graphhopper">http://lists.openstreetmap.org/listinfo/graphhopper</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR-BE"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>GraphHopper.com Your way is our destination!<o:p></o:p></pre>
</div>
</body>
</html>