<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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@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:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texte de bulles Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.TextedebullesCar
{mso-style-name:"Texte de bulles Car";
mso-style-priority:99;
mso-style-link:"Texte de bulles";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></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="FR-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hello all,<o:p></o:p></p>
<p class="MsoNormal">I hope someone will can help me.<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal">When I use pgr_kdijkstrapath function as this:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:Consolas">select * FROM pgr_kdijkstrapath('<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> SELECT d.id,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> source::integer,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> target::integer,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> c.cost::double precision as cost<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> FROM way_topo_data d join way_cost c on d.id = c.id
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> where c.profile_id=5',<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> (select n1.start_id::integer from n1),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> (select array_agg(end_id::integer)::integer[] as id from n2),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> false, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> false) p;<o:p></o:p></span></p>
<p class="MsoNormal">It return me the following error : One of the target vertices was not found or several targets are the same.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But when i take the result of the<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Consolas">(select array_agg(end_id::integer) ::integer[] as id from n2)<o:p></o:p></span></p>
<p class="MsoNormal">giving me "{28411,25582}" and hardcode it in the the statement as :<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:Consolas">select * FROM pgr_kdijkstrapath('<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> SELECT d.id,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> source::integer,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> target::integer,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> c.cost::double precision as cost<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> FROM way_topo_data d join way_cost c on d.id = c.id
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> where c.profile_id=5',<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> (select n1.start_id::integer from n1),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> '{28411,25582}',<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> false, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> false) p;<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="FR" style="color:#000099;mso-fareast-language:FR-CA"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span lang="FR" style="mso-fareast-language:FR-CA">It works<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR" style="mso-fareast-language:FR-CA">Then, where's the difference between the result of
</span><span style="font-family:Consolas">(select array_agg(end_id::integer)::integer[] as id from n2) AND '{28411,25582}'</span><span lang="FR" style="mso-fareast-language:FR-CA"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="FR" style="color:#000099;mso-fareast-language:FR-CA"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="FR" style="color:#000099;mso-fareast-language:FR-CA">Thanks<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="FR" style="color:#000099;mso-fareast-language:FR-CA">Marc-André
</span></b><b><span lang="FR" style="font-size:12.0pt;color:#000099;mso-fareast-language:FR-CA"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>