shootingstar (#18) - 'rule' doesn't work … (#278) - Message List

'rule' doesn't work …

hi i got some problem with the restriction turn with shooting*.

my table (tbl_tmp_segment_routier)looks like this :

id - source - target - cost - reverse_cost - rule - to_cost

54400028 - 275 - 283 - 10176.629 - 1000000 - "54400036" - 1000000

54400104 - 337 - 342 - 17585.972 - 1000000 - "54400144" - 1000000

54400394 - 477 - 464 - 5901.509 - 1000000 - "54400398" - 1000000 54400408 - 522 - 506 - 20293.212 - 1000000 - "54400417" - 1000000

54400385 - 509 - 507 - 6836.598 - 1000000 - "54400388" - 1000000

54400448 - 532 - 531 - 32548.028 - 1000000 - "54400445, 54400446" - 1000000

54401353 - 634 - 757 - 4821.117 - 1000000 - "54401376, 54401355" - 1000000

.... where id = int, source = int, target = int, cost = double precision, reverse_cost = double precision, rule = text and to_cost = double precision

my request looks like this :

INSERT INTO shooting_path1_1

(id, vertex_id, cost, reverse_cost, vitesse_circulation, the_geom)

SELECT id, vertex_id, shot.cost, reverse_cost, vitesse_circulation, the_geom

FROM shortest_path_shooting_star('

SELECT sr.id::int4, source::int4, target::int4,cost::float8, reverse_cost::float8,sr.x1, sr.y1, sr.x2, sr.y2, rule, to_cost::float8 FROM tbl_tmp_seg_routier AS sr ORDER BY sr.id DESC',

SOURCE_ID,

TARGET_ID,

TRUE, TRUE) AS shot JOIN tbl_tmp_seg_routier AS sr ON sr.id = shot.edge_id;

SOURCE_ID and TARGET_ID = one of the ids in the table tbl_tmp_seg_routier i cut this part because there is some joins with other table and it come a little long. I guess it's more readable like this.

i don't know what i doing wrong but no restriction turn are respected. however, The one-way are

and i got a other question, i see somewhere in my research there a function shooting* who trim the start and end edge Can i have it somewhere on the site ?

  • Message #985

    has anyone a hint or idea ? and it's ok for the last question (trim). I done my own function.

  • Message #986

    Can you please provide few examples of your paths with queries? Also please note that your to_cost values are comparable with cost values, while they should be SIGNIFICANTLY higher if you really want to restrict turns.

  • Message #989

    i tried to put a picture with my post but it did not work. What do i put on the bracket ? Image(*HERE*) ?

    so here is my table and request for the routing

    my road's table :

    id		x1		y1		x2		y2		cost		reverse_co	source	target	rule	to_cost
    54400047	445285,938	5034184,363	445282,591	5034266,259	10000000	5901,444695	332	343	54400044	100000000
    54400062	445282,591	5034266,259	445278,15	5034426,193	10000000	11520,399196	343	353	54400059	100000000
    54400091	445359,024	5034460,517	445290,668	5034341,892	10000000	9958,299027	381	351	54400105	100000000
    54400028	445265,6	5034035,828	445303,065	5034167,456	10176,629057	10000000	319	326	54400036	100000000
    54400104	445295,102	5034427,3	445289,178	5034671,256	17585,972086	10000000	380	385	54400144	100000000
    54400037	445303,065	5034167,456	445300,96	5034184,343	1225,220325	10000000	326	333	54400044, 54400046	100000000
    54400037	445303,065	5034167,456	445300,96	5034184,343	1225,220325	10000000	326	333	54400044, 54400035	100000000
    54400045	445300,96	5034184,343	445295,553	5034267,106	5971,63749	10000000	333	341	54400059, 54400047	100000000
    54400030	445246,349	5034054,599	445287,176	5034165,417	10000000	8683,553489	322	328	54400027, 54400028	100000000
    54400090	445290,668	5034341,892	445295,102	5034427,3	6159,377435	10000000	351	380	54400103, 54400062	100000000
    54400090	445290,668	5034341,892	445295,102	5034427,3	6159,377435	10000000	351	380	54400105	10000000
    54400035	445287,176	5034165,417	445285,938	5034184,363	10000000	1367,0009	328	332	 	0
    54400036	445303,065	5034167,456	445287,176	5034165,417	1153,404739	1153,404739	326	328	 	0
    54400038	445405,445	5034179,152	445303,065	5034167,456	7419,309444	7419,309444	324	326	 	0
    54400044	445300,96	5034184,343	445285,938	5034184,363	1081,606885	1081,606885	333	332	 	0
    54400046	445285,938	5034184,363	445204,107	5034180,018	5900,127391	5900,127391	332	342	 	0
    54400059	445295,553	5034267,106	445282,591	5034266,259	935,316988	935,316988	341	343	 	0
    54400060	445295,553	5034267,106	445290,668	5034341,892	5398,72837	5398,72837	341	351	 	0
    54400061	445282,591	5034266,259	445199,697	5034262,846	5973,372932	5973,372932	343	352	 	0
    54400103	445295,102	5034427,3	445278,15	5034426,193	1223,108168	1223,108168	380	353	 	0
    54400105	445359,024	5034460,517	445295,102	5034427,3	5253,962324	5253,962324	381	380	 	0
    54400106	445278,15	5034426,193	445153,377	5034420,044	8994,594096	8994,594096	353	329	 	0
    54400107	445278,15	5034426,193	445276,215	5034670,409	10000000	17607,571012	353	386	 	0
    

    my request :

    	SELECT id, vertex_id, shot.cost, reverse_cost, sr.source, sr.target, the_geom
    	INTO shooting_pathXX
    	FROM shortest_path_shooting_star('
    		SELECT sr.id::int4, source::int4, target::int4, cost::float8, reverse_cost::float8,
    		sr.x1, sr.y1, sr.x2, sr.y2, rule, to_cost::float8
    		FROM tbl_tmp_seg_routier AS sr
    		ORDER BY sr.id DESC',
    				54400103::int4,
    				54400045::int4,
    		TRUE, TRUE) AS shot
    		JOIN tbl_tmp_seg_routier AS sr ON sr.id = shot.edge_id;
    

    and the result :

    id		vertex_id	cost		reverse_cost		source	target
    54400103	1146	1223.1081678975		1223.1081678975		380	353
    54400062	1143	11520.3991956127	11520.3991956127	343	353
    54400059	1195	935.316987517814	935.316987517814	341	343
    54400045	1198	10000000		10000000		333	341
    

    as you can see, the result did not respect the turn restriction of the road "54400062". I increased the cost of a restriction, 1 000 000 to 100 000 000 and i got the same result.

    a hint or idea of what i'm doing wrong ?

    • Message #991

      Hi,

      An image would be nice. What about posting your question with a link to this forum topic on the pgRouting mailing list?
      You can attach your image there to your mail. I also believe that more people will be aware of your question then.

      In case you can't find the link to the list:  http://lists.postlbs.org/mailman/listinfo

      • Message #992

        Now I got it!

        There is no any restriction on edge 54400062 in your data set.

        Look, you have a rule for edge 54400090 which is '54400103, 54400062'. It means that way 54400103->54400062->54400090 is restricted.

        Please read http://pgrouting.postlbs.org/wiki/ShootingStar - rule setting is described there.

        • Message #993

          ahhhhh barnack (french swear) !

          I was doing the opposite. So, i must write the edge from which i can't come and not, like i'm doing, the edge from which i can't turn.
          Small translation error on my part.
          Now it's more clear

          thanks a lot lot lot guys !

          • Message #994

            You are welcome!