<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
No answer... I am stuck with this one.<br>
<br>
Is it possible that there is a conflict between the where clause
processing and the cost / rev_cost ?<br>
<br>
I have the same behaviour with edge start / target instead of
vertex start / target.<br>
<br>
Here is the wrong query result :<br>
<table x:str="" style="border-collapse: collapse;width:173pt"
border="0" cellpadding="0" cellspacing="0" width="229">
<colgroup><col
style="mso-width-source:userset;mso-width-alt:1024;width:21pt"
width="28"> <col
style="mso-width-source:userset;mso-width-alt:1536;
width:32pt" span="2" width="42"> <col
style="mso-width-source:userset;mso-width-alt:4278;width:88pt"
width="117"> </colgroup><tbody>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt;width:21pt" height="17" width="28">seq</td>
<td style="width:32pt" width="42">id1</td>
<td style="width:32pt" width="42">id2</td>
<td style="width:88pt" width="117">cost</td>
</tr>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt" x:num="" height="17"
align="right">0</td>
<td x:num="" align="right">19314</td>
<td x:num="" align="right">23805</td>
<td>25.2230680696244</td>
</tr>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt" x:num="" height="17"
align="right">1</td>
<td x:num="" align="right">16327</td>
<td x:num="" align="right">15869</td>
<td>200.551744693165</td>
</tr>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt" x:num="" height="17"
align="right">2</td>
<td x:num="" align="right">16328</td>
<td x:num="" align="right">30606</td>
<td x:num="" align="right">1000000</td>
</tr>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt" x:num="" height="17"
align="right">3</td>
<td x:num="" align="right">22180</td>
<td x:num="" align="right">30607</td>
<td>12.1375967381755</td>
</tr>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt" x:num="" height="17"
align="right">4</td>
<td x:num="" align="right">14374</td>
<td x:num="" align="right">28286</td>
<td>249.361944927019</td>
</tr>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt" x:num="" height="17"
align="right">5</td>
<td x:num="" align="right">14371</td>
<td x:num="" align="right">18295</td>
<td>111.604786405456</td>
</tr>
<tr style="height:12.75pt" height="17">
<td style="height:12.75pt" x:num="" height="17"
align="right">6</td>
<td x:num="" align="right">10776</td>
<td x:num="" align="right">-1</td>
<td x:num="" align="right">0</td>
</tr>
</tbody>
</table>
<br>
In my understanding, it shouldn't be possible to have an edge with
cost 1000000 in the resulting path (it is the only one in the
network to have such a cost, and the network is very small) !<br>
<br>
Thanks for any hint,<br>
<pre class="moz-signature" cols="72">--
Christophe DAMOUR
</pre>
Le 03/03/2014 20:20, Christophe Damour a écrit :<br>
</div>
<blockquote cite="mid:5314D5E6.4030409@sigeal.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Hi,<br>
<br>
Sorry to post twice, I forgot the attached file...<br>
<br>
I use pgRouting to calculate accessible routes for disabled
pedestrians.<br>
Network edges have some attributes that are used to filter the
accessible network in both ways depending on the user capacities
(where clause).<br>
Network edges have also attributes that are used to update cost
/ rev_cost depending on the routing way : If an edge is
forbidden in the digitizing way, cost is set to 1 000 000. If it
is forbidden in the reverse way, rev_cost is set to 1 000 000.
If it is forbidden in both ways, cost and rev_cost are set to 1
000 000.<br>
<br>
Now, in some cases, despite there is no accessible route
according to the where clause, pgr_trsp() returns a route going
through edges with cost / rev_cost set to 1 000 000.<br>
If I change the where clause so that there is actually an
alternative route, same edges with cost / rev_cost set to 1 000
000 are taken into account, and the calculated route is correct.<br>
<br>
I attached to this message images of both results (forbidden
edges in red, returned paths in blue).<br>
Routing is calculated from edge n°18295 (vertex n°19314) to edge
n°23805 (vertex n°10776).<br>
Wrong edge is n°30606 in test 2.<br>
<br>
Here is the sql code of the first test :<br>
<small><font face="Courier New, Courier, monospace">SELECT *
FROM pgr_trsp(<br>
'SELECT id_tron::integer AS id, source::integer,
target::integer,<br>
cost::double precision, rev_cost::double precision AS
reverse_cost<br>
FROM rp_test <br>
WHERE type_tron NOT IN(3, 8, 9) AND largeur_c > 90 AND
largeur_p > 75 AND etat_revet >= 2',<br>
19314::INTEGER, 10776::INTEGER, true, true,<br>
'SELECT to_cost::double precision, target_id::integer,
via_path::text FROM reseau_global_rest');</font></small><br>
<br>
And here is the sql code of the second test :<br>
<small><font face="Courier New, Courier, monospace">SELECT *
FROM pgr_trsp(<br>
'SELECT id_tron::integer AS id, source::integer,
target::integer,<br>
cost::double precision, rev_cost::double precision AS
reverse_cost<br>
FROM rp_test <br>
WHERE type_tron NOT IN(3, 8, 9) AND largeur_c > 90 AND
largeur_p > 75',<br>
19314::INTEGER, 10776::INTEGER, true, true,<br>
'SELECT to_cost::double precision, target_id::integer,
via_path::text FROM reseau_global_rest');</font></small><br>
<br>
I also attach to this message a shape file of the network.<br>
<br>
Do I miss something, or is it a bug ?<br>
<br>
Thanks for any help,
<pre class="moz-signature" cols="72">--
Christophe DAMOUR
</pre>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Pgrouting-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a></pre>
</blockquote>
<br>
</body>
</html>