[Routing] FW: [pgrouting-users] Multiple queries in a row

Peter K peathal at yahoo.de
Wed Nov 21 12:58:18 GMT 2012


Hi Iñigo,

you could create a shortest path tree from the given node until you
reach the nearest 30 or 40 locations (one-to-many). So, only one
dijkstra run is sufficient.

Not sure how you would do so in pg (but you'r asking on the more general
routing list ;))

Regards,
Peter.

>
> Dear all,
>
> I need to obtain a set of nearest nodes from a given location (maybe
> 30 or 40). Then I need to calculate the shortest path from the given
> node from each others. It means to execute shortes_path query multiple
> times in a row, wich takes about 2 seconds (1 query 2 seconds: 30
> queries 60 -> too long).
>
> |SELECT * FROM shortest_path('
>    SELECT id AS id,
>           source::int4 AS source,
>           target::int4 AS target,
>           cost::float8 AS cost
>    FROM tt_2po_4pgr',
> 275742,
> 274494,
> false,
> false)|
>
> What would be the best way to do this in a reasonable time?
>
>
> Thank in advance!
>
>
> Pd: excuse my english
>
>
> _______________________________________________ Pgrouting-users
> mailing list Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>
> _______________________________________________
> Routing mailing list
> Routing at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/routing


-- 
GraphHopper.com routes the Java way

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/routing/attachments/20121121/a587ee90/attachment.html>


More information about the Routing mailing list