<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hello<BR>
&nbsp;<BR>
I get different results on each run. Your result&nbsp;is one of them.<BR>
&nbsp;<BR>
Both the target_id&nbsp;and rule ids are edgeids refering to gid and&nbsp;should be correct.&nbsp;They originally referred to objid, but&nbsp;I remapped them to gid.<BR>
I will reduce the size of the network and send&nbsp;you new testdata.<BR>
&nbsp;<BR>
Regards<BR>
Espen<BR>&nbsp;<BR>
<DIV>
<DIV id=SkyDrivePlaceholder></DIV>&gt; Date: Thu, 8 Mar 2012 09:21:12 -0500<BR>&gt; From: woodbri@swoodbridge.com<BR>&gt; To: espoern@hotmail.com; pgrouting-dev@lists.osgeo.org<BR>&gt; Subject: Re: [pgrouting-dev] pgRouting and the Shortest Path Shooting Star algorithm<BR>&gt; <BR>&gt; Espen,<BR>&gt; <BR>&gt; I have CC the list as there might be helpful information to others in my <BR>&gt; response.<BR>&gt; <BR>&gt; I get the following results on my Linux system. Is this what you are <BR>&gt; getting on your system?<BR>&gt; <BR>&gt; trsp_bug=# SELECT kollektivnett32.objid::integer, qry1.*<BR>&gt; FROM turn_restrict_shortest_path(<BR>&gt; 'SELECT gid AS id,<BR>&gt; source::int4,<BR>&gt; target::int4,<BR>&gt; minutes::double precision AS cost,<BR>&gt; rminutes::double precision AS reverse_cost<BR>&gt; FROM kollektivnett32',<BR>&gt; 17914,<BR>&gt; 24470,<BR>&gt; true,<BR>&gt; true,<BR>&gt; 'SELECT to_cost,<BR>&gt; gid AS target_id,<BR>&gt; rule AS via_path<BR>&gt; FROM kollektivnett32_turns<BR>&gt; WHERE costtype=''V''') qry1<BR>&gt; inner join kollektivnett32<BR>&gt; on qry1.edge_id=kollektivnett32.gid;<BR>&gt; <BR>&gt; objid | vertex_id | edge_id | cost<BR>&gt; -------+-----------+---------+-------------------<BR>&gt; 39510 | 17914 | 39553 | 1.22921517354843<BR>&gt; 39503 | 19542 | 39546 | 1.16385126125265<BR>&gt; 39502 | 15062 | 39545 | 1.13463764875839<BR>&gt; 39501 | 10238 | 39544 | 0.894134798291999<BR>&gt; 39495 | 19538 | 39538 | 0.866380394768565<BR>&gt; 39496 | 19468 | 39539 | 0.933687082563116<BR>&gt; 39497 | 19470 | 39540 | 0.657732599215612<BR>&gt; 39498 | 19473 | 39541 | 0.908336115840503<BR>&gt; 39499 | 19452 | 39542 | 0.375975675882557<BR>&gt; 39500 | 9999 | 39543 | 0.467548379399679<BR>&gt; 39493 | 18169 | 39536 | 0.722558560770379<BR>&gt; 39492 | 19474 | 39535 | 0.359215445372181<BR>&gt; 39491 | 18166 | 39534 | 0.372316300710597<BR>&gt; 39490 | 6151 | 39533 | 0.7529314841121<BR>&gt; 39514 | 14128 | 39557 | 0.247611717608335<BR>&gt; 39513 | 2820 | 39556 | 0.642005590638696<BR>&gt; 39494 | 19535 | 39537 | 1.08148812344578<BR>&gt; 39475 | 19518 | 39518 | 0.985412403126148<BR>&gt; 39476 | 19519 | 39519 | 1.00870667860245<BR>&gt; 39477 | 19524 | 39520 | 1.10356478488934<BR>&gt; 39478 | 7347 | 39521 | 2.31489365914156<BR>&gt; 2912 | 19418 | 2630 | 0.710630767866117<BR>&gt; (22 rows)<BR>&gt; <BR>&gt; Ok, I have a couple of observations:<BR>&gt; <BR>&gt; 1. the route does not get to the destination node which seems like that <BR>&gt; might indicate a bug<BR>&gt; <BR>&gt; 2. I see you are using "rule AS via_path", is rule formatted the way you <BR>&gt; would pass it to shooting_star? If so this is wrong. I unfortunately <BR>&gt; implemented via_path to be a list of edges in the reverse order of rule.<BR>&gt; <BR>&gt; IF for RULE:<BR>&gt; target_id: 1, rule: 2,3,4,5<BR>&gt; <BR>&gt; THEN for via_path<BR>&gt; target_id: 1, via_path: 5,4,3,2<BR>&gt; <BR>&gt; Since all your restrictions only involve a single edge this does not <BR>&gt; matter. So moving on to the next potential problem. Consistency of edge <BR>&gt; ids could be a problem.<BR>&gt; <BR>&gt; For example, in the kollektivnett32_turns table what are the target_id <BR>&gt; and rule ids? These should be the edge ids not the node ids and you <BR>&gt; using: gid, objectid_1, objectid, or some other field for these values?<BR>&gt; <BR>&gt; When you select your edges in the first query you have "gid as id", you <BR>&gt; have to match the column used in the kollektivnett32_turns table as the <BR>&gt; edge id to define the id in the first query. So if the <BR>&gt; kollektivnett32_turns uses objectid values your first query needs to be <BR>&gt; "objectid::integer as id"<BR>&gt; <BR>&gt; Also it would be good it you can reduce the problem to a simple 10-20 <BR>&gt; node/edge graph that is easier to debug and understand. Most cases can <BR>&gt; be demonstrated using a simple graph like:<BR>&gt; <BR>&gt; o o<BR>&gt; | |<BR>&gt; | |<BR>&gt; o---------o---o--------o<BR>&gt; | | | |<BR>&gt; | | | |<BR>&gt; o-------o---------o---o--------o---------o<BR>&gt; | | | |<BR>&gt; | | | |<BR>&gt; o---------o---o--------o<BR>&gt; | |<BR>&gt; | |<BR>&gt; o o<BR>&gt; <BR>&gt; Just label the nodes and the edges, and set up the restrictions, then <BR>&gt; you can run simple tests to verify that it works as expected on simple <BR>&gt; cases.<BR>&gt; <BR>&gt; -Steve<BR>&gt; <BR>&gt; On 3/8/2012 5:12 AM, Espen O wrote:<BR>&gt; &gt; Hi<BR>&gt; &gt;<BR>&gt; &gt; Here is our testdata http://dl.dropbox.com/u/525315/example.rar<BR>&gt; &gt;<BR>&gt; &gt; It contains the following:<BR>&gt; &gt;<BR>&gt; &gt; *File *<BR>&gt; &gt;<BR>&gt; &gt; <BR>&gt; &gt;<BR>&gt; &gt; *Description *<BR>&gt; &gt;<BR>&gt; &gt; Kollektivnett32.sql<BR>&gt; &gt;<BR>&gt; &gt; <BR>&gt; &gt;<BR>&gt; &gt; Network table<BR>&gt; &gt;<BR>&gt; &gt; kollektivnett32_turns.sql<BR>&gt; &gt;<BR>&gt; &gt; <BR>&gt; &gt;<BR>&gt; &gt; Turn restrictions table<BR>&gt; &gt;<BR>&gt; &gt; example_query.sql<BR>&gt; &gt;<BR>&gt; &gt; <BR>&gt; &gt;<BR>&gt; &gt; Example query from node 17914 to 24470<BR>&gt; &gt;<BR>&gt; &gt; expected_route.jpg<BR>&gt; &gt;<BR>&gt; &gt; <BR>&gt; &gt;<BR>&gt; &gt; Image of expected result (24,2 minutes including turn costs)<BR>&gt; &gt;<BR>&gt; &gt; Regards Espen<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; &gt; Date: Wed, 7 Mar 2012 10:43:50 -0500<BR>&gt; &gt; &gt; From: woodbri@swoodbridge.com<BR>&gt; &gt; &gt; To: pgrouting-dev@lists.osgeo.org<BR>&gt; &gt; &gt; Subject: Re: [pgrouting-dev] pgRouting and the Shortest Path Shooting<BR>&gt; &gt; Star algorithm<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; On 3/7/2012 8:39 AM, Espen O wrote:<BR>&gt; &gt; &gt; &gt; Hi<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; We are very interested in version 1.03/1.05 of pgRouting and the<BR>&gt; &gt; &gt; &gt; Shortest Path Shooting Star algorithm. However, there is a problem with<BR>&gt; &gt; &gt; &gt; way restrictions in shooting star if there is more than one rule for an<BR>&gt; &gt; &gt; &gt; edge. It also doesn’t seem to take into account the reverse cost.<BR>&gt; &gt; We are<BR>&gt; &gt; &gt; &gt; interested in fixing these bugs.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Stephen Woodbridge has developed an alternative<BR>&gt; &gt; &gt; &gt; “turn_restricted_shortest_path” which is very promising. We have tested<BR>&gt; &gt; &gt; &gt; the Windows version compiled by Sanak (2012/03/04), but it is very<BR>&gt; &gt; &gt; &gt; unstable and seems to return inconsistent answers when running the same<BR>&gt; &gt; &gt; &gt; input data multiple times.<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; Hi Espen,<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; I would like to get a copy of you graph and queries that return<BR>&gt; &gt; &gt; inconsistent results. I have not seen this behavior and I think I need<BR>&gt; &gt; &gt; to understand what is happening. If we have a bug I want to get it fixed.<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; Can you dump your database something like:<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; pg_dump -fP -Z0 -f mydump.sql.gz -t &lt;table_1&gt; -t &lt;table_2&gt; ... -U &lt;user&gt;<BR>&gt; &gt; &gt; -h localhost &lt;mydatabase&gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; and email that and the queries you are running. I would be greatly<BR>&gt; &gt; &gt; appreciated and I will analyze it and get any bugs fixed that we need to.<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; Thanks,<BR>&gt; &gt; &gt; -Steve<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; We are working on Windows 2008 server 32 bit, not Linux. Is there<BR>&gt; &gt; anyone<BR>&gt; &gt; &gt; &gt; who can give us the detailed setup for compiling on Windows (pgRouting<BR>&gt; &gt; &gt; &gt; 1.03 2010/01/30 by Martin is the most stable we have tested) so we can<BR>&gt; &gt; &gt; &gt; start to debug the source code? We have tried Sanaks recipe<BR>&gt; &gt; &gt; &gt; (/sanak/pgrouting/blob/master/BUILD.msvc90), but we get a lot of errors<BR>&gt; &gt; &gt; &gt; (Microsoft Visual C++ 2008 Express Edition and the required libraries).<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Regards<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; pgrouting-dev mailing list<BR>&gt; &gt; &gt; &gt; pgrouting-dev@lists.osgeo.org<BR>&gt; &gt; &gt; &gt; http://lists.osgeo.org/mailman/listinfo/pgrouting-dev<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; pgrouting-dev mailing list<BR>&gt; &gt; &gt; pgrouting-dev@lists.osgeo.org<BR>&gt; &gt; &gt; http://lists.osgeo.org/mailman/listinfo/pgrouting-dev<BR>&gt; <BR></DIV>                                               </div></body>
</html>