<div>Hi Daniel</div>
<div>&nbsp;</div>
<div>yo agrege el campo ID a la consulta pero el orden en que me entrega los resultados es el mismo.</div>
<div>&nbsp;</div>
<div>query:</div>
<div>SELECT id,gid, the_geom FROM dijkstra_sp_delta( &#39;calle&#39;, 3414, 3406, 3000)</div>
<div>&nbsp;</div>
<div>result:</div>
<div>&quot;id&quot;;&quot;gid&quot;;&quot;the_geom&quot;<br>2;4414;&quot;0105000020B30F000001000000010200000002000000F9E3B4109BCC51C065E35F65B5973EC0656B43BC8ECC51C02D2D6B65B0973EC0&quot;<br>3;4415;&quot;0105000020B30F000001000000010200000002000000656B43BC8ECC51C02D2D6B65B0973EC018E60A2187CC51C007069A16AD973EC0&quot;</div>

<div>1;<strong>4416</strong>;&quot;0105000020B30F00000100000001020000000200000018E60A2187CC51C007069A16AD973EC0AA2CA7847ECC51C0EB933A5AA9973EC0&quot;<br>4;4417;&quot;0105000020B30F000001000000010200000002000000AA2CA7847ECC51C0EB933A5AA9973EC04DFDF22B7ACC51C0FD7FB373A7973EC0&quot;<br>
</div>
<div>
<div id="result_box" dir="ltr" style="TEXT-ALIGN: left">should be:</div>
<div dir="ltr" style="TEXT-ALIGN: left">&nbsp;</div>
<div dir="ltr" style="TEXT-ALIGN: left">&quot;id&quot;;&quot;gid&quot;;&quot;the_geom&quot;<br><br>2;4414;&quot;0105000020B30F000001000000010200000002000000F9E3B4109BCC51C065E35F65B5973EC0656B43BC8ECC51C02D2D6B65B0973EC0&quot;<br>
3;4415;&quot;0105000020B30F000001000000010200000002000000656B43BC8ECC51C02D2D6B65B0973EC018E60A2187CC51C007069A16AD973EC0&quot;</div>
<div dir="ltr" style="TEXT-ALIGN: left">1;4416;&quot;0105000020B30F00000100000001020000000200000018E60A2187CC51C007069A16AD973EC0AA2CA7847ECC51C0EB933A5AA9973EC0&quot;<br>4;4417;&quot;0105000020B30F000001000000010200000002000000AA2CA7847ECC51C0EB933A5AA9973EC04DFDF22B7ACC51C0FD7FB373A7973EC0</div>
</div>
<div>&nbsp;</div>
<div>
<div id="result_box" dir="ltr" style="TEXT-ALIGN: left">I think I have problems with the data from the shapefile...</div>
<div dir="ltr" style="TEXT-ALIGN: left">&nbsp;</div>
<div dir="ltr" style="TEXT-ALIGN: left">RG</div></div>
<div class="gmail_quote">2009/2/4 Daniel Kastl <span dir="ltr">&lt;<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Valeria,<br><br>I never had the case of wrong ordered result, but you could add the &quot;id&quot;<br>attribute to the select and order by it.<br>
<br>For example:<br>SELECT id, gid, AsText(the_geom) AS the_geom FROM astar_sp_delta(&#39;ways&#39;,<br>10, 20, 0.1);<br><br>... should return something like:<br><br>&nbsp;id &nbsp;| &nbsp;gid | &nbsp; &nbsp; &nbsp; &nbsp; the_geom<br>-----+-------+----------------------------------------------------------------------------------------------------------------<br>
&nbsp; 1 | &nbsp; &nbsp; 9 | MULTILINESTRING((18.421891 -33.9154821,18.4216313<br>-33.9151594))<br>&nbsp; 2 | &nbsp; &nbsp; 8 | MULTILINESTRING((18.4220472 -33.9156916,18.421891<br>-33.9154821))<br>&nbsp; 3 | &nbsp; &nbsp; 7 | MULTILINESTRING((18.4223323 -33.9159963,18.4220472<br>
-33.9156916))<br>&nbsp; 4 | &nbsp;2983 | MULTILINESTRING((...))<br>&nbsp; 5 | &nbsp;2982 | MULTILINESTRING((...))<br><br>Also you might want to try to JOIN two tables this way if you need more<br>than the standard returned attributes:<br><a href="http://pgrouting.postlbs.org/wiki/SQLTipsAndTricks" target="_blank">http://pgrouting.postlbs.org/wiki/SQLTipsAndTricks</a><br>
<br>Daniel<br><br><br>Valeria Muņoz schrieb:<br>
<div>
<div></div>
<div class="Wj3C7c">&gt; Hi<br>&gt;<br>&gt; I have problems with the query results, The results are not sorted.<br>&gt;<br>&gt; my Query:<br>&gt;<br>&gt; SELECT rt.gid,rt.the_geom AS tg, AsText(rt.the_geom) AS wkt,<br>&gt; length(rt.the_geom) AS length, calle.gid FROM calle, (SELECT gid,<br>
&gt; the_geom FROM dijkstra_sp_delta( &#39;calle&#39;, 3429, 3406, 3000) ) as rt<br>&gt; WHERE calle.gid=rt.gid;<br>&gt;<br>&gt; result:<br>&gt; &quot;gid&quot;;&quot;tg&quot;;&quot;wkt&quot;;&quot;length&quot;;&quot;gid&quot;<br>
&gt; *4416*;&quot;0105000020B30F00000100000001020000000200000018E60A2187CC51C007069A16AD973EC0AA2CA7847ECC51C0EB933A5AA9973EC0&quot;;&quot;MULTILINESTRING((-71.1957476240572<br>&gt; -30.5924848676714,-71.1952220566333<br>
&gt; -30.5924278634083))&quot;;0.000528649792432027;4416<br>&gt; *4414*;&quot;0105000020B30F000001000000010200000002000000F9E3B4109BCC51C065E35F65B5973EC0656B43BC8ECC51C02D2D6B65B0973EC0&quot;;&quot;MULTILINESTRING((-71.1969644323834<br>
&gt; -30.5926116332152,-71.1962118776697<br>&gt; -30.5925353418981))&quot;;0.000756411899864822;4414<br>&gt; *4415*;&quot;0105000020B30F000001000000010200000002000000656B43BC8ECC51C02D2D6B65B0973EC018E60A2187CC51C007069A16AD973EC0&quot;;&quot;MULTILINESTRING((-71.1962118776697<br>
&gt; -30.5925353418981,-71.1957476240572<br>&gt; -30.5924848676714))&quot;;0.00046698936208239;4415<br>&gt; *4417*;&quot;0105000020B30F000001000000010200000002000000AA2CA7847ECC51C0EB933A5AA9973EC04DFDF22B7ACC51C0FD7FB373A7973EC0&quot;;&quot;MULTILINESTRING((-71.1952220566333<br>
&gt; -30.5924278634083,-71.194956767363<br>&gt; -30.5923988641007))&quot;;0.000266869550146504;4417<br>&gt; should be given A, B and C gave me B, A and C, then I can not generate<br>&gt; a guide of how to get from point A to B properly..<br>
&gt;<br>&gt; Can sort the results?..please help..<br>&gt; RG<br></div></div>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>
&gt; Pgrouting-users mailing list<br>&gt; <a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>&gt; <a href="http://lists.postlbs.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.postlbs.org/mailman/listinfo/pgrouting-users</a><br>
&gt;<br><br>_______________________________________________<br>Pgrouting-users mailing list<br><a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br><a href="http://lists.postlbs.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.postlbs.org/mailman/listinfo/pgrouting-users</a><br>
</blockquote></div><br>