<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>
      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>
  </body>
</html>