<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 19, 2013 at 2:45 AM, Nate Wessel <span dir="ltr"><<a href="mailto:bike756@gmail.com" target="_blank">bike756@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'm looking to select a number of shortest paths from one point to each of a set of points. For example, I would like to generate paths from my house to every coffee shop in the metro area.<br>


<br>
Conceptually, it seems like this should be a simple problem, but I'm running into issues when I try to construct a query to actually do it. I managed to get as far as getting a nearest-network-node ID for each of my coffee shops into a table by themselves.<br>


<br>
>From that point, I get a little lost. As far as I can tell, I have three tables to join together somehow: The network edges table, the table with the destination node IDs, and the table that results from a shortest path query. It's simple enough to join the network edge table geometry to the result of a single path query. But how do I pass a variable from my node IDs table to the end-point parameter of a shortest-path function?<br>


<br>
When I tried something like:<br>
<br>
SELECT<br>
....<br>
FROM destination_nodes, shortest_path(..., <a href="http://network_nodes.id" target="_blank">network_nodes.id</a> ,...)<br>
<br>
JOIN network_edges ON ....<br>
<br>
I get an error saying I can't pass a variable from the same query level to the function.<br>
<br>
Can someone please help me understand how I need to structure this query to get the geometry of the paths associated with information from my destination_nodes table?<br>
<br><br></blockquote><div><br></div><div>Hi Nate,</div><div><br></div><div>You could try the new pgRouting 2.0 (will be a stable release soon, I hope).</div><div>There is a new algorithm that can do 1 to many shortest path requests:</div>

<div><a href="http://docs.pgrouting.org/v2.0.0-rc1/src/kdijkstra/doc/index.html">http://docs.pgrouting.org/v2.0.0-rc1/src/kdijkstra/doc/index.html</a><br></div><div><br></div><div>Daniel</div><div><br></div><div><br></div>

<div><br></div><div> </div></div><div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Georepublic UG & Georepublic Japan<br>eMail: <a href="mailto:daniel.kastl@georepublic.de" style="color:rgb(66,99,171)" target="_blank">daniel.kastl@georepublic.de</a><br>

Web: <a href="http://georepublic.de/" style="color:rgb(66,99,171)" target="_blank">http://georepublic.de</a></span>
</div></div>