[postgis-users] Nearest Aid station to accident

Matthew Pulis mpulis at gmail.com
Fri Apr 25 03:45:42 PDT 2008


Thanks for ur suggestions .. I ll try it out

On Fri, Apr 25, 2008 at 10:45 AM, William Temperley <willtemperley at gmail.com>
wrote:

> Hi Matthew,
>
>
> >What I am finding hard to implement is the part where to find the shortest
> >distance on the road network.  It is taking more or a less a minute there.
> >Any idea how I can improve it please?
>
> Any way in which you can cut down the size of the graph PGRouting
> works on will give you a faster calculation - just pass a query
> representing a subset of your street data to the shortest path
> function, e.g.
>
>        SELECT edge_id FROM shortest_path_astar(''
>                                SELECT gid AS id,
>                                source::int4,
>                                target::int4,
>                                to_cost as cost,
>                                reverse_cost,
>                                x1, y1, x2, y2
>                                FROM '||table_name||' where
>                                (
>                                (the_geom
>                                && <something to cut down the result set>)
>                                )
>
>                                ''
>
>  ,'||start_node.node_id||','||end_node.node_id||', true, true
> )
>
> A while ago I was attempting to precalculate routes between strongly
> connected nodes and keeping these in the routing table, then selecting
> only streets near the start and end points, plus the relevant
> pre-calculated routes and passing these to the A* function, but this
> never really got past proof of concept, there being a lot of
> complications with the precalculation itself. This way I think you
> could get sub-second queries on any sized network.
>
> Also- I think Shooting* is the slowest method and the only extra you
> get over A* is right turn restrictions.
>
> Hope this helps
>
> Will
>
>
> Hope this helps
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Matthew Pulis
URL : http://www.solutions-lab.net
MSN : pulis_matthew[@]hotmail.com
ICQ : 145951110
Skype : solutions-lab.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080425/73a904cd/attachment.html>


More information about the postgis-users mailing list