<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Dear Professionals,<br>It's been a while we are using PostGIS to store our Geometry information in our Postgress database. We have developed vertex-to-vertex routing ourselves using iGraph library. Yesterday I read about pgRouting and I am porting our current application to pgRouting. However, I faces some issues in using shooting start path finder.<br><br>We stored edges and vertices information in tables and for finding a graph route with turn restriction, we are calling following SQL script:<br><br>SELECT&nbsp; shortest_path_shooting_star( <br>&nbsp;&nbsp;&nbsp; 'SELECT e.id, <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.first as source, <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 e.second as target, <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ST_Length(e.geom) as cost,&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; st_x(st_pointn(e.geom, 1)) AS x1, st_y(st_pointn(e.geom, 1)) AS y1, <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; st_x(st_pointn(e.geom, 2)) AS x2, st_y(st_pointn(e.geom, 2)) AS y2, <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (not connected)::boolean::int * 1000000 AS to_cost, <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; c.first AS rule <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FROM edges e LEFT OUTER JOIN edge_connections c ON e.id = c.second <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WHERE e.group_id = 0 order by e.id', <br>&nbsp;&nbsp;&nbsp;
 1209560, 1209653, <br>&nbsp;&nbsp;&nbsp; true, false);<br><br>My inner subqery woud have following results:<br>&nbsp; id&nbsp;&nbsp;&nbsp; | source&nbsp; | target&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cost&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | to_cost |&nbsp; rule&nbsp;&nbsp; <br>---------+---------+---------+----------------------+------------------+------------------+------------------+------------------+---------+---------<br>&nbsp;1087134 |&nbsp; 926686 |&nbsp; 926687 | 2.3299 | 51.4675 | 35.728 | 51.4675 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 35.72805577
 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>.<br>.<br>.<br>&nbsp;1209706 | 1039731 | 1039870 | 4.005 | 51.40828 | 35.7239 | 51.4082 | 35.7239 | 1000000 | 1209564<br>.<br>.<br>.<br><br><span>In the results, when a constraint exists, rule and to_cost would not be NULL. When a turn restriction exists, the results would be exactly like what specified in the docs (<a target="_blank" href="http://www.pgrouting.org/docs/1.x/shooting.html">http://www.pgrouting.org/docs/1.x/shooting.html</a>). </span><br><br>However, when I call the shortest_path_shooting_star function, results would not differ if a rule-and-to_cost exists or not. I have changed directed and  <span class="n">has_reverse_cost</span> parameters but nothing happened. <br><br>I was wondering if you guys could help me in this matter. Any advice or even a clue would be very much appreciated.<br><div>Thanks,<br>* Roozbeh</div></div><br>

      </body></html>