shootingstar (#18) - First edge doesn't respect the one way restriction (#308) - Message List

First edge doesn't respect the one way restriction

Hi there. I have a problem with the algorithm shortest_path_shooting_star. The image hosted by imageshack will help me:

 http://img198.imageshack.us/img198/7125/errorei.jpg


Look at the image on the left Via fiano and Via corio. I want to go from Via Fiano to Via Corio. this is the query i do :

##for correct order result

set enable_hashjoin=false;

set enable_mergejoin=false;

##shooting_star query

SELECT ".TABLE.".*, AsText?(".TABLE.".the_geom) AS wkt FROM ".TABLE.", shortest_path_shooting_star('SELECT gid as id, source, target, cost, reverse_cost,

x1, y1, x2, y2, rule, to_cost FROM ".TABLE."', ".$startEdgegid?.", ".$endEdgegid?.", true, true) as rt

WHERE ".TABLE.".gid=rt.edge_id;

this is result: gid|vertex|edge_id|cost
5494;9236;5494;90.092508879762
5503;8058;5503;39.4141794163281
5509;5427;5509;94.3764538381396

As you see, the algorithm does not respect the one way restriction of first edge. Instead the reverse path works well:  http://img132.imageshack.us/img132/2015/errorpi.jpg

If i make turn restricion in gid 5503 rule 5494 to_cost=1000 doesn't solve this situation. Thanks for any advice

  • Message #1153

    edit 1: the turn restriction solve the problem, but i can't find all one way on the map and set manually to_cost=1000 rule="one_way street gid with turn restriction" There is a better way to do it? Thanks!!!

  • Message #1155

    look at this new image:  http://img132.imageshack.us/img132/8185/error2ia.jpg
    edge_id|vertex_id|cost|street
    4311;790;1001000138.79372;790;"RE G. (VIA)"
    4150;501;61.479488767088;501;"PACCHIOTTI G. (VIA)"
    6114;856;1001000142.27532;856;"LIONETTO (STR. DEL)"

    it takes a cost of 1001000138 !! What i can do? Thanks

    • Message #1172

      Hi,

      First of all, I would like to see your data for one way (and neighbour) edges and the query your trying to execute.

      And the second note - hight reverse (or plain) cost doesn't mean that an edge is not reachable - you can reach it with this high cost when there is no other option. That's why I would like to see your data - to make sure that everything is OK with other edges.

      Anton.

  • Message #1157

    Hi carlos ! I have similar problem, but with the last edge. I have tried everything and I could not fix it. I will continue investigating, if I find the solution you notice. If you find it please write the solution.

    bye.. good luck !!

    • Message #1158

      Yes with last edge too... I think is a bug. Should we open a ticket about it?

      i think is related to the algorithm that stops to consider the edge cost on the first and last edge...My pgrouting version is the latest svn version.

      • Message #1159

        Yes, we should open a ticket. I've researched everywhere and have not found the solution. Now I'm mixing with shortest_path algorithm with shortest_path_shooting_star, but not good !!

        Do you generate you the ticket? because my English is not very good :(

        • Message #1160

          ok

          • Message #1161

            Please, notify me when you have news..

            • Message #1162
              • Message #1163

                perfect!

              • Message #1168

                Hello! could you solve the problem? I still did not! no more to do.. my mail the gmail is diegoalberione bye !

                • Message #1173

                  Can you tell me your pgrouting version or SVN/revision ?

  • Message #1174

    Removing the "directed connection" and working only with costs query is:

    set enable_hashjoin=false;set enable_mergejoin=false;

    SELECT ".TABLE.".*, AsText?(".TABLE.".the_geom) AS wkt FROM ".TABLE.", shortest_path_shooting_star('SELECT gid as id, source, target, cost, reverse_cost,

    x1, y1, x2, y2, rule, to_cost FROM ".TABLE."', ".$startEdgegid?.", ".$endEdgegid?.", false, true) as rt

    WHERE ".TABLE.".gid=rt.edge_id;

    Result is not same but still not correct.

    • Message #1175

      look at this strange thing:  http://img245.imageshack.us/img245/4746/exampleq.jpg
      routing works well in the first 2 and last images, doesn't works in the 3rd

    • Message #1176

      look at this strange thing:  http://img245.imageshack.us/img245/4746/exampleq.jpg
      routing works well in the first 2 and last images, doesn't works in the 3rd

      • Message #1177

        same for pgRouting-1.02_pg-8.3.3

        • Message #1179

          i can confirm that the problem is only on last edge. not first. (My fault was considering directed graph too). Considering only cost and reverse cost the proble persist only on teh last edge.