Hi Espen,<div><br></div><div>Do you use pgRouting on Windows?</div><div>Otherwise I would recommend you to try 1.05, because several bugs have been fixed since then.</div><div><br></div><div>Daniel</div><div><br></div><div>
<br><br><div class="gmail_quote">2010/12/20 Espen Isaksen <span dir="ltr"><<a href="mailto:espen.isaksen@gmail.com">espen.isaksen@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi!<br>
<br>
I am running pgrouting 1.03 at the moment.<br>
<br>
I tried running from 157334 to 157332 with two different bounding<br>
boxes. Same problem as you see below:<br>
<br>
routing=# SELECT gid<br>
FROM shootingstar_sp('elveg',157334,157332,1000, 'cost', true, true);<br>
gid<br>
--------<br>
157334<br>
161375<br>
155338<br>
159163<br>
157333<br>
157332<br>
(6 rows)<br>
<br>
routing=# SELECT gid<br>
FROM shootingstar_sp('elveg',157334,157332,10, 'cost', true, true);<br>
gid<br>
--------<br>
157334<br>
157334<br>
157333<br>
157332<br>
(4 rows)<br>
<br>
Actually now it accepts running directly from 157333 to 157332 when<br>
running 1000 m as bounding box, but it does not(as shown in my first<br>
post) accept it if I start running from 157333 instead of 157334. So<br>
the problem seems to be that the algorithm does not let me run<br>
directly from my starting edge to the nearest edge in the direction of<br>
the shortest path.<br>
<br>
I'll check out the other wrapper functions and tell you how it went.<br>
<br>
Thanks,<br>
<font color="#888888">Espen<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Mon, Dec 20, 2010 at 2:39 PM, Daniel Kastl <<a href="mailto:daniel@georepublic.de">daniel@georepublic.de</a>> wrote:<br>
> Hi Espen,<br>
> Have you tried to route with more than two road links, lets say from 157332<br>
> to 157334?<br>
> If you try both directions there, does it take two different routes as well?<br>
> The starting points/edges are somtimes the ones, where issues are likely to<br>
> occur.<br>
> Which version of pgRouting do you use?<br>
> I mostly use this wrapper function, that usually worked well for me:<br>
> <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>
> It takes X/Y of start and end point as parameter, looks for the nearest edge<br>
> and then splits it into two substrings and selects the right one.<br>
> Maybe this wrapper cares better about special cases, because I haven't had a<br>
> strange route with it.<br>
> Daniel<br>
><br>
> 2010/12/20 Espen Isaksen <<a href="mailto:espen.isaksen@gmail.com">espen.isaksen@gmail.com</a>><br>
>><br>
>> On Mon, Dec 20, 2010 at 11:11 AM, Daniel Kastl <<a href="mailto:daniel@georepublic.de">daniel@georepublic.de</a>><br>
>> wrote:<br>
>> > Hi Espen,<br>
>> > Your projection unit is "meter", I guess. So if you decrease your<br>
>> > bounding<br>
>> > box to 10, then, there are no other edges in your select than the two<br>
>> > you<br>
>> > want to get as a result.<br>
>><br>
>> Yes that is understandable. Just hoped it would not jump to a<br>
>> different "shortest path" when I increased the bounding box :-)<br>
>><br>
>><br>
>> > But thank you for trying this, because it shows, that your result passes<br>
>> > one<br>
>> > link twice. Could you find out, if the cost of passing edge 157333 twice<br>
>> > would be higher than taking the "long" way?<br>
>><br>
>> The cost of 15733 is 104.8033 so passing twice would be 209.6066 and<br>
>> the cost of going around is 229.675.<br>
>><br>
>> If I rearrange the query and do not use the wrapper function I get this<br>
>> result:<br>
>><br>
>> routing=# SELECT * FROM shortest_path_shooting_star('SELECT gid as id,<br>
>> source, target, cost, reverse_cost,x1, y1,x2, y2, rule, to_cost FROM<br>
>> elveg order by id',157333,157332,true,true);<br>
>><br>
>> vertex_id | edge_id | cost<br>
>> -----------+---------+------------------<br>
>> 269628 | 157333 | 104.8033<br>
>> 269630 | 159163 | 62.3978<br>
>> 266068 | 155337 | 75.4899<br>
>> 256213 | 155336 | 29.7317<br>
>> 266065 | 158776 | 62.0563<br>
>> 269628 | 157332 | 61.7253486704361<br>
>> (6 rows)<br>
>><br>
>><br>
>> Espen<br>
>><br>
>><br>
>><br>
>> > Then the search result would be correct, but of course trying to pass<br>
>> > one<br>
>> > edge twice wouldn't be OK.<br>
>> > Thank you for reporting this!<br>
>> > Daniel<br>
>> ><br>
>> > 2010/12/20 Espen Isaksen <<a href="mailto:espen.isaksen@gmail.com">espen.isaksen@gmail.com</a>><br>
>> >><br>
>> >> Hi!<br>
>> >><br>
>> >> I am running the following query:<br>
>> >><br>
>> >> SELECT gid<br>
>> >> FROM shootingstar_sp('elveg',157332,157333,100, 'cost', true, true);<br>
>> >><br>
>> >> and I get:<br>
>> >><br>
>> >> gid<br>
>> >> --------<br>
>> >> 157332<br>
>> >> 157333<br>
>> >> (2 rows)<br>
>> >><br>
>> >><br>
>> >> which seems correct. Now if i flip the direction with the this query:<br>
>> >><br>
>> >> SELECT gid<br>
>> >> FROM shootingstar_sp('elveg',157333,157332,100, 'cost', true, true)<br>
>> >><br>
>> >> then I get:<br>
>> >><br>
>> >> gid<br>
>> >> --------<br>
>> >> 157333<br>
>> >> 159163<br>
>> >> 155337<br>
>> >> 155336<br>
>> >> 158776<br>
>> >> 157332<br>
>> >> (6 rows)<br>
>> >><br>
>> >> which is not correct. There should not be any extra costs on the edges:<br>
>> >><br>
>> >> gid | cost | reverse_cost | to_cost | rule<br>
>> >> --------+------------------+------------------+---------+------<br>
>> >> 157332 | 61.7253486704361 | 61.7253486704361 | |<br>
>> >> 157333 | 104.8033 | 104.8033 | |<br>
>> >> (2 rows)<br>
>> >><br>
>> >><br>
>> >> >From my understanding I should get 2 rows in both queries. Am I<br>
>> >> missing something here?<br>
>> >><br>
>> >> If I decrease the bounding box in the second query to 10, then I get<br>
>> >> this result:<br>
>> >><br>
>> >> gid<br>
>> >> --------<br>
>> >> 157333<br>
>> >> 157333<br>
>> >> 157332<br>
>> >> (3 rows)<br>
>> >><br>
>> >> I thought I should get the same result for a larger bounding box as<br>
>> >> long as the shortest path(least cost) is within the smallest bounding<br>
>> >> box?<br>
>> >><br>
>> >> Image of the road network can be seen here:<br>
>> >> <a href="http://dl.dropbox.com/u/8829/road_network.png" target="_blank">http://dl.dropbox.com/u/8829/road_network.png</a><br>
>> >><br>
>> >> Espen<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>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Georepublic UG & Georepublic Japan<br>
>> > eMail: <a href="mailto:daniel.kastl@georepublic.de">daniel.kastl@georepublic.de</a><br>
>> > Web: <a href="http://georepublic.de" target="_blank">http://georepublic.de</a><br>
>> ><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>
>> ><br>
>> ><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>
><br>
><br>
><br>
> --<br>
> Georepublic UG & Georepublic Japan<br>
> eMail: <a href="mailto:daniel.kastl@georepublic.de">daniel.kastl@georepublic.de</a><br>
> Web: <a href="http://georepublic.de" target="_blank">http://georepublic.de</a><br>
><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>
><br>
><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 & 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>