<div dir="ltr"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: medium; border-collapse: collapse; "><div id=":11x" class="ii gt" style="font-size: 13px; margin-top: 5px; margin-right: 15px; margin-bottom: 5px; margin-left: 15px; padding-bottom: 20px; ">
<div id=":11w"><div dir="ltr"><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">Hi,</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US">I have a problem with shortest_path_shooting_star and shootingstar_sp</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">I use pgRouting-1.03_pg-8.3.7 with postgresql-8.3.10-1-windows and postgis-pg83-setup-1.3.3-1</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">For Data, i use a personal data.</p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US">I create my graph and </span>I add "temps" as "cost" and "reverse_temps" as "reverse_cost" and I set reverse_temps=1000000 when direction=1.</p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><br></span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">When I run shortest_path_shooting_star :</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US">$sql = "SELECT roads.edge_id0, AsText(roads.the_geom) AS wkt, </span>roads.length, roads.gid</p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>FROM roads, (SELECT edge_id FROM shortest_path_shooting_star('SELECT gid as id, source, target,temps as cost,reverse_temps as reverse_cost, x1, y1, x2, y2, rule, to_cost FROM roads order by id',</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>".$startEdge['gid'].",</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>".$endEdge['gid'].",</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span><span> </span>true, true)) as rt</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span><span> </span>WHERE ".TABLE.".gid=rt.edge_id;";<span> </span></span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">Pgrouting return a bad calcul (it not considerate reverse_cost : figure 1)</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US">Value 0 : both trajet</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">Value 1 : one direction (drawing direction)</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"> </span>When I use shootingstar_sp :</p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">$sql = "SELECT rt.gid, AsText(rt.the_geom) AS wkt,</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>length(rt.the_geom) AS length, ".TABLE.".id</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>FROM ".TABLE.",</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>(SELECT gid, the_geom</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>FROM shootingstar_sp(</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>'".TABLE."',</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>".$startEdge['gid'].",</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>".$endEdge['gid'].",</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span><span> </span>1, 'temps',true,true)</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>) as rt</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>WHERE ".TABLE.".gid=rt.gid;";<span> </span></span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">I have a similar result (figure 1).</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><br></span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">But when I use :</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US">$sql = "SELECT rt.gid, AsText(rt.the_geom) AS wkt,</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>length(rt.the_geom) AS length, ".TABLE.".id</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>FROM ".TABLE.",</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>(SELECT gid, the_geom</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>FROM shootingstar_sp(</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>'".TABLE."',</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>".$startEdge['gid'].",</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>".$endEdge['gid'].",</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span><span> </span>1, 'temps',true,false)</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
<span lang="EN-US"><span> </span>) as rt</span></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US"><span> </span>WHERE ".TABLE.".gid=rt.gid;";<span> </span></span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span lang="EN-US">I have a correct result (figure 2), but my graph will not be oriented and I whill have bad calcul when I navigate between roads who have both direction (figure 3 is correct but figure4 is not correct).</span></p>
<p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></p><p class="MsoNormal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Thanks</p>
<div><br></div></div></div></div><div class="hq gt" style="font-size: 13px; margin-top: 5px; margin-right: 15px; margin-bottom: 15px; margin-left: 15px; clear: both; "></div></span>
</div>