<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:1209681377;
        mso-list-type:hybrid;
        mso-list-template-ids:577268124 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thank you Daniel, and All..<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I rephrased the code and adjusted it accordingly:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>select<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>    id,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>    the_geom,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>    (pgr_kdijkstraCost(<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>    'SELECT id, source, target, st_length(geom) as cost FROM schema.cvl',<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>    1, array[98, 100, 220, 320, 650], false, false<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>  )) as cost<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'>from schema.cvl_vertices_pgr WHERE id=1</span><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Here I could calculate the costs of different destinations from
the source_point#1, but I still seek advices, as follows:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span
style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'>     
</span></span></span><![endif]><span dir=LTR></span><span style='font-size:
11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Is there a way to
automatically insert all the destination/target points in the array? I tried ‘SELECT
id FROM schema.cvl_vertices_pgr’, but didn’t work!<o:p></o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span
style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'>     
</span></span></span><![endif]><span dir=LTR></span><span style='font-size:
11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I transferred the
vector and points features from AutoCAD. How can I control the units (i.e. I
used meters in CAD but it seems to be millimeters here – e.g. Cost to point#98
= 112959.0)<o:p></o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span
style='mso-list:Ignore'>3)<span style='font:7.0pt "Times New Roman"'>     
</span></span></span><![endif]><span dir=LTR></span><span style='font-size:
11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I tried the same
contents of the function on “pgr_kdijkstraPath” but it didn’t work! What could
be the problem?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Regards,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Eyad<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> pgrouting-users-bounces@lists.osgeo.org
[mailto:pgrouting-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Daniel
Kastl<br>
<b>Sent:</b> Monday, November 10, 2014 4:11 AM<br>
<b>To:</b> pgRouting users mailing list<br>
<b>Subject:</b> Re: [pgrouting-users] Function to result routes/costs from single_origin
to multi-destinations<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<div>

<p class=MsoNormal><o:p> </o:p></p>

<div>

<p class=MsoNormal><o:p> </o:p></p>

<div>

<p class=MsoNormal>On Mon, Nov 10, 2014 at 3:42 AM, AUS - Eyad <<a
href="mailto:b00038807@aus.edu" target="_blank">b00038807@aus.edu</a>>
wrote:<o:p></o:p></p>

<div>

<div>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>While
applying the following tutorial: <a
href="http://anitagraser.com/2011/02/09/creating-catchment-areas-with-pgrouting-and-qgis/"
target="_blank">http://anitagraser.com/2011/02/09/creating-catchment-areas-with-pgrouting-and-qgis/</a>
utilizing vector network which has been tested (and demonstrated functionality)
for shortest path application, it returned the following message:</span><o:p></o:p></p>

</div>

</div>

<div>

<p class=MsoNormal>Hi, <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal>I think the tutorial was written before pgRouting 2.0 was
released.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>It may require some changes.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal> <o:p></o:p></p>

</div>

<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>LAST
COMMENT.. If you know another code/method that helps in multi-routing from one
point to list of targets to result routes and costs from single-origin (source)
to multi-destinations (targets), please provide guidance.. origins and
destinations are in a single points feature (i.e. cvl_vertices_pgr), whereas routes
calculation shall take place in lines feature (i.e. cvl).<o:p></o:p></p>

<div align=center>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
 style='border-collapse:collapse'>
 <tr>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <div align=center>
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
   style='border-collapse:collapse'>
   <tr>
    <td style='padding:.75pt .75pt .75pt .75pt'></td>
   </tr>
  </table>
  </div>
  </td>
  <td valign=top style='padding:0in 4.5pt 0in 5.25pt'></td>
 </tr>
</table>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p>

</div>

</div>

</blockquote>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal>If you need 1 -> n shortest path queries, then you could
try pgr_kDijkstra:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><a
href="http://docs.pgrouting.org/2.0/en/src/kdijkstra/doc/index.html#pgr-kdijkstra">http://docs.pgrouting.org/2.0/en/src/kdijkstra/doc/index.html#pgr-kdijkstra</a><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal>Best regards,<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Daniel<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal> <o:p></o:p></p>

</div>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<p class=MsoNormal>-- <o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Georepublic
UG & Georepublic Japan<br>
eMail: <a href="mailto:daniel.kastl@georepublic.de" target="_blank"><span
style='color:#4263AB'>daniel.kastl@georepublic.de</span></a><br>
Web: <a href="http://georepublic.info" target="_blank"><span
style='color:#4263AB'>http://georepublic.info</span></a></span><o:p></o:p></p>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><b><u><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:black'>Original Message:<o:p></o:p></span></u></b></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>While
applying the following tutorial: <a
href="http://anitagraser.com/2011/02/09/creating-catchment-areas-with-pgrouting-and-qgis/">http://anitagraser.com/2011/02/09/creating-catchment-areas-with-pgrouting-and-qgis/</a>
utilizing vector network which has been tested (and demonstrated functionality)
for shortest path application, it returned the following message:<o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt;background:#E9EDE7'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>Query
returned successfully: 1013 rows affected, 199 ms execution time<o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>but
returned no table as output!<o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>The
code I used is:<o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.0pt;font-family:Consolas;color:#222222;background:#EEEEEE'>create
table catchment_1 as select id, the_geom, (select sum(cost) from ( SELECT *
FROM pgr_dijkstra( 'SELECT id, source, target, st_length(geom) as cost FROM
schema.cvl', 1, 320, false, false )) as foo ) as cost from
schema.cvl_vertices_pgr </span><span style='font-size:10.5pt;font-family:"Helvetica","sans-serif";
color:#333333'><o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>I also
tried passing "id" to the function instead of "320" as per
the tutorial but got the following msg:<o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt;background:#E9EDE7'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>ERROR:
function pgr_dijkstra(unknown, integer, bigint, boolean, boolean) does not
exist SQL state: 42883<o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>Although,
pgr_dijkstra is working well with other codes.. so, it's one of the recognized
functions in my installed pgRouting layer<o:p></o:p></span></p>

<p align=center style='text-align:center;line-height:13.5pt'><span
style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>I'm
using QGIS 2.0.1 and pgRouting pg93-binaries-2.4.0<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal>In order to gradually test the code, I started by the inner
SELECT then went up step by step.. I got result table for each step until I
reached the highest SELECT in the structure.. I got a table showing the cost
for each point_id. the special result is a point feature.. but what drew my
attention in the result table is that all costs are exactly the same
'32430.028' whereas the points are non-regularly distributed.. This means that
I just needed to remove 'create table catchment_1 as' to get a result table,
but still the cost values do not seem to make sense.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>LAST COMMENT.. If you know another code/method that helps in
multi-routing from one point to list of targets to result routes and costs from
single-origin (source) to multi-destinations (targets), please provide
guidance.. origins and destinations are in a single points feature (i.e.
cvl_vertices_pgr), whereas routes calculation shall take place in lines feature
(i.e. cvl).<o:p></o:p></p>

<div align=center>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
 style='border-collapse:collapse'>
 <tr>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <div align=center>
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
   style='border-collapse:collapse'>
   <tr>
    <td style='padding:.75pt .75pt .75pt .75pt'></td>
   </tr>
  </table>
  </div>
  </td>
  <td valign=top style='padding:0in 4.5pt 0in 5.25pt'></td>
 </tr>
</table>

</div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><o:p> </o:p></p>

</div>

</body>

</html>