[pgrouting-users] Question regarding shortest_path_shooting_star

Roozbeh Bandari yakhmak2000 at yahoo.com
Mon Mar 14 04:33:54 EDT 2011


Dear Professionals,
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.

We stored edges and vertices information in tables and for finding a graph route 
with turn restriction, we are calling following SQL script:

SELECT  shortest_path_shooting_star( 
    'SELECT e.id, 
                    e.first as source, 
                    e.second as target, 
                    ST_Length(e.geom) as cost,  
                    st_x(st_pointn(e.geom, 1)) AS x1, st_y(st_pointn(e.geom, 1)) 
AS y1, 

                    st_x(st_pointn(e.geom, 2)) AS x2, st_y(st_pointn(e.geom, 2)) 
AS y2, 

                    (not connected)::boolean::int * 1000000 AS to_cost, 
                    c.first AS rule 
        FROM edges e LEFT OUTER JOIN edge_connections c ON e.id = c.second 
        WHERE e.group_id = 0 order by e.id', 
    1209560, 1209653, 
    true, false);

My inner subqery woud have following results:
  id    | source  | target  |         cost         |        x1        |        
y1        |        x2        |        y2        | to_cost |  rule   

---------+---------+---------+----------------------+------------------+------------------+------------------+------------------+---------+---------

 1087134 |  926686 |  926687 | 2.3299 | 51.4675 | 35.728 | 51.4675 |      
35.72805577 |         |        

.
.
.
 1209706 | 1039731 | 1039870 | 4.005 | 51.40828 | 35.7239 | 51.4082 | 35.7239 | 
1000000 | 1209564
.
.
.

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 (http://www.pgrouting.org/docs/1.x/shooting.html). 


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 
has_reverse_cost parameters but nothing happened. 


I was wondering if you guys could help me in this matter. Any advice or even a 
clue would be very much appreciated.

Thanks,
* Roozbeh


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20110314/ba5cfc10/attachment.html


More information about the Pgrouting-users mailing list