Hi Espen,<div><br></div><div>Sorry for the late reply. The combination of Christmas and Japanese New Year makes this time very busy.</div><div><br></div><div>So if it&#39;s still the case with 1.05 it&#39;s probably a bug. The best place to report this would be in the bug tracker <a href="https://github.com/pgRouting/pgrouting/issues">https://github.com/pgRouting/pgrouting/issues</a>. As soon as someone has a time to tackle the problem, we will take a look. I hope you understand that customer projects usually have priority, but we won&#39;t forget about it if it&#39;s in the Github issue tracker.</div>

<div>If you could write a summary of the problem there, that would be great. Otherwise I will try to add it.</div><div><br></div><div>Regarding wrapper functions:</div><div>Initially wrapper functions weren&#39;t supposed to be part of the source code. So while reducing the number of parameters and do some internal calculation, it became easier to use, but also some parameters weren&#39;t possible to change anymore.</div>

<div>I must admit that wrappers might need some cleanup (parameters and function names), but at least there should be a wrapper with bounding box for each algorithm as far as I remember.</div><div>Shooting_star_smart wrapper we put into a repository called &quot;contrib&quot;. It was quite difficult to think about all possibilities a route could take to select the right substrings. So there might be cases we forgot about.</div>

<div>You&#39;re free to take the wrappers as an example and change and extend them to your needs. If you can find a possibility to improve them, you&#39;re very welcome to share with everyone. In general we hope to collect more useful wrapper functions in the &quot;contrib&quot; repository.</div>

<div><br></div><div>Daniel</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><br><br><div class="gmail_quote">2010/12/21 Espen Isaksen <span dir="ltr">&lt;<a href="mailto:espen.isaksen@gmail.com">espen.isaksen@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Just a quick note that upgrading to 1.05 did not resolve my problem.<br>
<font color="#888888"><br>
Espen<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Mon, Dec 20, 2010 at 3:25 PM, Daniel Kastl &lt;<a href="mailto:daniel@georepublic.de">daniel@georepublic.de</a>&gt; wrote:<br>
&gt; Hi Espen,<br>
&gt; Do you use pgRouting on Windows?<br>
&gt; Otherwise I would recommend you to try 1.05, because several bugs have been<br>
&gt; fixed since then.<br>
&gt; Daniel<br>
&gt;<br>
&gt;<br>
&gt; 2010/12/20 Espen Isaksen &lt;<a href="mailto:espen.isaksen@gmail.com">espen.isaksen@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi!<br>
&gt;&gt;<br>
&gt;&gt; I am running pgrouting 1.03 at the moment.<br>
&gt;&gt;<br>
&gt;&gt; I tried running from 157334 to 157332 with two different bounding<br>
&gt;&gt; boxes. Same problem as you see below:<br>
&gt;&gt;<br>
&gt;&gt; routing=# SELECT gid<br>
&gt;&gt; FROM shootingstar_sp(&#39;elveg&#39;,157334,157332,1000, &#39;cost&#39;, true, true);<br>
&gt;&gt;  gid<br>
&gt;&gt; --------<br>
&gt;&gt;  157334<br>
&gt;&gt;  161375<br>
&gt;&gt;  155338<br>
&gt;&gt;  159163<br>
&gt;&gt;  157333<br>
&gt;&gt;  157332<br>
&gt;&gt; (6 rows)<br>
&gt;&gt;<br>
&gt;&gt; routing=# SELECT gid<br>
&gt;&gt; FROM shootingstar_sp(&#39;elveg&#39;,157334,157332,10, &#39;cost&#39;, true, true);<br>
&gt;&gt;  gid<br>
&gt;&gt; --------<br>
&gt;&gt;  157334<br>
&gt;&gt;  157334<br>
&gt;&gt;  157333<br>
&gt;&gt;  157332<br>
&gt;&gt; (4 rows)<br>
&gt;&gt;<br>
&gt;&gt; Actually now it accepts running directly from 157333 to 157332 when<br>
&gt;&gt; running 1000 m as bounding box, but it does not(as shown in my first<br>
&gt;&gt; post) accept it if I start running from 157333 instead of 157334. So<br>
&gt;&gt; the problem seems to be that the algorithm does not let me run<br>
&gt;&gt; directly from my starting edge to the nearest edge in the direction of<br>
&gt;&gt; the shortest path.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ll check out the other wrapper functions and tell you how it went.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Espen<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Dec 20, 2010 at 2:39 PM, Daniel Kastl &lt;<a href="mailto:daniel@georepublic.de">daniel@georepublic.de</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hi Espen,<br>
&gt;&gt; &gt; Have you tried to route with more than two road links, lets say<br>
&gt;&gt; &gt; from 157332<br>
&gt;&gt; &gt; to 157334?<br>
&gt;&gt; &gt; If you try both directions there, does it take two different routes as<br>
&gt;&gt; &gt; well?<br>
&gt;&gt; &gt; The starting points/edges are somtimes the ones, where issues are likely<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; occur.<br>
&gt;&gt; &gt; Which version of pgRouting do you use?<br>
&gt;&gt; &gt; I mostly use this wrapper function, that usually worked well for me:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; <a href="https://github.com/pgRouting/pgrouting-contrib/blob/master/wrapper/routing_core_smart.sql" target="_blank">https://github.com/pgRouting/pgrouting-contrib/blob/master/wrapper/routing_core_smart.sql</a><br>


&gt;&gt; &gt; It takes X/Y of start and end point as parameter, looks for the nearest<br>
&gt;&gt; &gt; edge<br>
&gt;&gt; &gt; and then splits it into two substrings and selects the right one.<br>
&gt;&gt; &gt; Maybe this wrapper cares better about special cases, because I haven&#39;t<br>
&gt;&gt; &gt; had a<br>
&gt;&gt; &gt; strange route with it.<br>
&gt;&gt; &gt; Daniel<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2010/12/20 Espen Isaksen &lt;<a href="mailto:espen.isaksen@gmail.com">espen.isaksen@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Mon, Dec 20, 2010 at 11:11 AM, Daniel Kastl &lt;<a href="mailto:daniel@georepublic.de">daniel@georepublic.de</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; Hi Espen,<br>
&gt;&gt; &gt;&gt; &gt; Your projection unit is &quot;meter&quot;, I guess. So if you decrease your<br>
&gt;&gt; &gt;&gt; &gt; bounding<br>
&gt;&gt; &gt;&gt; &gt; box to 10, then, there are no other edges in your select than the two<br>
&gt;&gt; &gt;&gt; &gt; you<br>
&gt;&gt; &gt;&gt; &gt; want to get as a result.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Yes that is understandable. Just hoped it would not jump to a<br>
&gt;&gt; &gt;&gt; different &quot;shortest path&quot; when I increased the bounding box :-)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; But thank you for trying this, because it shows, that your result<br>
&gt;&gt; &gt;&gt; &gt; passes<br>
&gt;&gt; &gt;&gt; &gt; one<br>
&gt;&gt; &gt;&gt; &gt; link twice. Could you find out, if the cost of passing edge 157333<br>
&gt;&gt; &gt;&gt; &gt; twice<br>
&gt;&gt; &gt;&gt; &gt; would be higher than taking the &quot;long&quot; way?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The cost of 15733 is 104.8033 so passing twice would be 209.6066 and<br>
&gt;&gt; &gt;&gt; the cost of going around is 229.675.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; If I rearrange the query and do not use the wrapper function I get this<br>
&gt;&gt; &gt;&gt; result:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; routing=# SELECT * FROM shortest_path_shooting_star(&#39;SELECT gid as id,<br>
&gt;&gt; &gt;&gt; source, target, cost, reverse_cost,x1, y1,x2, y2, rule, to_cost FROM<br>
&gt;&gt; &gt;&gt; elveg order by id&#39;,157333,157332,true,true);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  vertex_id | edge_id |       cost<br>
&gt;&gt; &gt;&gt; -----------+---------+------------------<br>
&gt;&gt; &gt;&gt;    269628 |  157333 |         104.8033<br>
&gt;&gt; &gt;&gt;    269630 |  159163 |          62.3978<br>
&gt;&gt; &gt;&gt;    266068 |  155337 |          75.4899<br>
&gt;&gt; &gt;&gt;    256213 |  155336 |          29.7317<br>
&gt;&gt; &gt;&gt;    266065 |  158776 |          62.0563<br>
&gt;&gt; &gt;&gt;    269628 |  157332 | 61.7253486704361<br>
&gt;&gt; &gt;&gt; (6 rows)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Espen<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; Then the search result would be correct, but of course trying to pass<br>
&gt;&gt; &gt;&gt; &gt; one<br>
&gt;&gt; &gt;&gt; &gt; edge twice wouldn&#39;t be OK.<br>
&gt;&gt; &gt;&gt; &gt; Thank you for reporting this!<br>
&gt;&gt; &gt;&gt; &gt; Daniel<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 2010/12/20 Espen Isaksen &lt;<a href="mailto:espen.isaksen@gmail.com">espen.isaksen@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Hi!<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I am running the following query:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; SELECT gid<br>
&gt;&gt; &gt;&gt; &gt;&gt; FROM shootingstar_sp(&#39;elveg&#39;,157332,157333,100, &#39;cost&#39;, true, true);<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; and I get:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;  gid<br>
&gt;&gt; &gt;&gt; &gt;&gt; --------<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157332<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157333<br>
&gt;&gt; &gt;&gt; &gt;&gt; (2 rows)<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; which seems correct. Now if i flip the direction with the this<br>
&gt;&gt; &gt;&gt; &gt;&gt; query:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; SELECT gid<br>
&gt;&gt; &gt;&gt; &gt;&gt; FROM shootingstar_sp(&#39;elveg&#39;,157333,157332,100, &#39;cost&#39;, true, true)<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; then I get:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;  gid<br>
&gt;&gt; &gt;&gt; &gt;&gt; --------<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157333<br>
&gt;&gt; &gt;&gt; &gt;&gt;  159163<br>
&gt;&gt; &gt;&gt; &gt;&gt;  155337<br>
&gt;&gt; &gt;&gt; &gt;&gt;  155336<br>
&gt;&gt; &gt;&gt; &gt;&gt;  158776<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157332<br>
&gt;&gt; &gt;&gt; &gt;&gt; (6 rows)<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; which is not correct. There should not be any extra costs on the<br>
&gt;&gt; &gt;&gt; &gt;&gt; edges:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;  gid   |       cost       |   reverse_cost   | to_cost | rule<br>
&gt;&gt; &gt;&gt; &gt;&gt; --------+------------------+------------------+---------+------<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157332 | 61.7253486704361 | 61.7253486704361 |         |<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157333 |         104.8033 |         104.8033 |         |<br>
&gt;&gt; &gt;&gt; &gt;&gt; (2 rows)<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;From my understanding I should get 2 rows in both queries. Am I<br>
&gt;&gt; &gt;&gt; &gt;&gt; missing something here?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; If I decrease the bounding box in the second query to 10, then I get<br>
&gt;&gt; &gt;&gt; &gt;&gt; this result:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;  gid<br>
&gt;&gt; &gt;&gt; &gt;&gt; --------<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157333<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157333<br>
&gt;&gt; &gt;&gt; &gt;&gt;  157332<br>
&gt;&gt; &gt;&gt; &gt;&gt; (3 rows)<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I thought I should get the same result for a larger bounding box as<br>
&gt;&gt; &gt;&gt; &gt;&gt; long as the shortest path(least cost) is within the smallest<br>
&gt;&gt; &gt;&gt; &gt;&gt; bounding<br>
&gt;&gt; &gt;&gt; &gt;&gt; box?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Image of the road network can be seen here:<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="http://dl.dropbox.com/u/8829/road_network.png" target="_blank">http://dl.dropbox.com/u/8829/road_network.png</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Espen<br>
&gt;&gt; &gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt;&gt; Pgrouting-users mailing list<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; --<br>
&gt;&gt; &gt;&gt; &gt; Georepublic UG &amp; Georepublic Japan<br>
&gt;&gt; &gt;&gt; &gt; eMail: <a href="mailto:daniel.kastl@georepublic.de">daniel.kastl@georepublic.de</a><br>
&gt;&gt; &gt;&gt; &gt; Web: <a href="http://georepublic.de" target="_blank">http://georepublic.de</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt; Pgrouting-users mailing list<br>
&gt;&gt; &gt;&gt; &gt; <a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
&gt;&gt; &gt;&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; Pgrouting-users mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
&gt;&gt; &gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Georepublic UG &amp; Georepublic Japan<br>
&gt;&gt; &gt; eMail: <a href="mailto:daniel.kastl@georepublic.de">daniel.kastl@georepublic.de</a><br>
&gt;&gt; &gt; Web: <a href="http://georepublic.de" target="_blank">http://georepublic.de</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Pgrouting-users mailing list<br>
&gt;&gt; &gt; <a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
&gt;&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Pgrouting-users mailing list<br>
&gt;&gt; <a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
&gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Georepublic UG &amp; Georepublic Japan<br>
&gt; eMail: <a href="mailto:daniel.kastl@georepublic.de">daniel.kastl@georepublic.de</a><br>
&gt; Web: <a href="http://georepublic.de" target="_blank">http://georepublic.de</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Pgrouting-users mailing list<br>
&gt; <a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse">Georepublic UG &amp; 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><br>
</div>