Thanks for ur suggestions .. I ll try it out<br><br><div class="gmail_quote">On Fri, Apr 25, 2008 at 10:45 AM, William Temperley <<a href="mailto:willtemperley@gmail.com">willtemperley@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Hi Matthew,<br>
<br>
<br>
>What I am finding hard to implement is the part where to find the shortest<br>
>distance on the road network.  It is taking more or a less a minute there.<br>
>Any idea how I can improve it please?<br>
<br>
Any way in which you can cut down the size of the graph PGRouting<br>
works on will give you a faster calculation - just pass a query<br>
representing a subset of your street data to the shortest path<br>
function, e.g.<br>
<br>
        SELECT edge_id FROM shortest_path_astar(''<br>
                                SELECT gid AS id,<br>
                                source::int4,<br>
                                target::int4,<br>
                                to_cost as cost,<br>
                                reverse_cost,<br>
                                x1, y1, x2, y2<br>
                                FROM '||table_name||' where<br>
                                (<br>
                                (the_geom<br>
                                && <something to cut down the result set>)<br>
                                )<br>
<br>
                                ''<br>
                                ,'||start_node.node_id||','||end_node.node_id||', true, true<br>
)<br>
<br>
A while ago I was attempting to precalculate routes between strongly<br>
connected nodes and keeping these in the routing table, then selecting<br>
only streets near the start and end points, plus the relevant<br>
pre-calculated routes and passing these to the A* function, but this<br>
never really got past proof of concept, there being a lot of<br>
complications with the precalculation itself. This way I think you<br>
could get sub-second queries on any sized network.<br>
<br>
Also- I think Shooting* is the slowest method and the only extra you<br>
get over A* is right turn restrictions.<br>
<br>
Hope this helps<br>
<br>
Will<br>
<br>
<br>
</div></div>Hope this helps<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Matthew Pulis<br>URL : <a href="http://www.solutions-lab.net">http://www.solutions-lab.net</a><br>MSN : pulis_matthew[@]<a href="http://hotmail.com">hotmail.com</a><br>ICQ : 145951110<br>
Skype : <a href="http://solutions-lab.net">solutions-lab.net</a>