<div>hi daniel</div>
<div> </div>
<div> i did try with Shooting* and WORKS!!! .. thanks thanks!!... now my next problem :) i am using azimuth() for instructions(turn left right etc..) but i do not how use it, can you help me please?</div>
<div> </div>
<div>RG</div>
<div> </div>
<div>Query :</div>
<div> </div>
<div>SELECT azimuth(startpoint(the_geom),endpoint(the_geom)) as azimuth from calle where gid = ".$id_gid."</div>
<div> </div>
<div>I read in a foro about azimuth() and this says that the result i have to multiply by 57.29577951. The result is the angle. Now How i know if the user have to turn left or rigth ..etc?, exist some algoritm? or function?</div>
<div> </div>
<div>RG<br><br></div>
<div class="gmail_quote">2009/2/12 Daniel Kastl <span dir="ltr"><<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Valeria,<br><br>When I saw your first screenshot I already guessed that the first<br>segment seems to be the problem, but you already could confirm this.<br>
<br>What if you try it with Shooting* function once. It routes from link to<br>link and not from node to node. (So you need to use link ID's as start<br>and end in the function.)<br><br>Daniel<br><br><br>Valeria Muņoz schrieb:<br>
<div class="Ih2E3d">> I found my problem, the problem is the first segment, from the<br>> beginning. Query does not consider the first segment, so I took the<br>> gid of the segment and obtained the information for route instructions.<br>
><br>> As a result of the query do not delivery me the first segment (in some<br>> cases) not consider if is one-way street.<br>><br>> so, now my problem is the first segment. how can i bind to the<br>> function to return the first segment informacion for the route?<br>
><br>> please see the atachment<br>><br>> RG<br>> PD:sorry for my english :)<br>><br></div>> 2009/2/12 Valeria Muņoz <<a href="mailto:valemunoz@gmail.com">valemunoz@gmail.com</a> <mailto:<a href="mailto:valemunoz@gmail.com">valemunoz@gmail.com</a>>><br>
<div class="Ih2E3d">><br>> I exchanged values,<br>><br>> update calle set reverse_cost=reverse_cost + 1000000 WHERE oneway=1;<br>> update calle set to_cost=to_cost + 1000000 WHERE oneway=-1;<br>
><br>> please see the atachment img_01<br>><br>> update calle set reverse_cost=reverse_cost + 1000000 WHERE oneway=-1;<br>> update calle set to_cost=to_cost + 1000000 WHERE oneway=1;<br>> please see the atachment img_02<br>
><br>> RG<br>> 2009/2/12 Stephen Woodbridge <<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a><br></div>> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>>><br>
<div class="Ih2E3d">><br>> Well, maybe I got the from-to sense backwards. Does it always<br>> route the wrong-way down all one-way streets now? If so then,<br>> swap the 1 and -1 in the update statements.<br>
><br>> -Steve<br>><br>> Valeria Muņoz wrote:<br>><br>> Stephen<br>> does not work, please see the attachment<br>> RG<br>><br>> 2009/2/12 Stephen Woodbridge <<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a><br>
> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>><br></div>
<div>
<div></div>
<div class="Wj3C7c">> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a><br>> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>>>><br>
><br>><br>> So set reverse_cost when oneway=1 and cost when oneway=-1<br>> Since you have already messed with the values I would<br>> do this now:<br>><br>> -- make sure everything is re-initiallized<br>
><br>> UPDATE calle SET to_cost=length(the_geom),<br>> reverse_cost=length(the_geom);<br>><br>> -- update the oneway costs<br>> update calle set reverse_cost=reverse_cost + 1000000<br>
> WHERE oneway=1;<br>> update calle set cost=cost + 1000000 WHERE oneway=-1;<br>> vacuum analyze calle;<br>><br>> Now see how your test route looks.<br>
><br>> -Steve<br>><br>> Valeria Muņoz wrote:<br>><br>> hi Stephen<br>> i got<br>> "oneway";"count"<br>
> -1;1451<br>> 0;21403<br>> 1;2640<br>> 0=both ways<br>> -1=B->A<br>> 1= A->B<br>
> RG.<br>><br>> 2009/2/12 Stephen Woodbridge<br>> <<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>><br>
> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a><br>> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>>><br>> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a><br>
> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>><br>><br>> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a><br>> <mailto:<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>>>>><br>
><br>><br>> Valeria,<br>><br>> What do you get for this query:<br>><br>> select distinct oneway, count(*) as count from<br>> calle group by<br>
> oneway, order by oneway;<br>><br>> If you have a street A------->B then the oneway<br>> flag probable<br>> needs<br>> 3 values. 0 for both ways, 1? for A to B, and<br>
> maybe 2? for B<br>> to A.<br>> You need to figure out which values are which.<br>><br>> Then you need cost or reverse cost based on the<br>
> value of oneway.<br>><br>> -Steve<br>><br>> Valeria Muņoz wrote:<br>><br>> hi Daniel, thanks for the link..<br>> I did the following:<br>
> * UPDATE calle SET to_cost=length(the_geom),<br>> reverse_cost=length(the_geom); *<br>> * *<br>> * UPDATE calle SET reverse_cost=reverse_cost<br>
> + 1000000 WHERE<br>> oneway!=0 , oneway!=0 are one way streets. *<br>><br>> my query:<br>> SELECT edge_id as gid,cost as length<br>
> FROM<br>> shortest_path_astar('SELECT gid AS<br>> id,source::int4,<br>> target::int4, to_cost::double precision as cost,<br>> reverse_cost::double precision, x1,y1,x2,y2 FROM<br>
> calle',3412,3411,false,true)**<br>><br>> this do not works 100%, with some street<br>> works with<br>> others no...<br>
> I am missing something?<br>> RG<br>><br>> 2009/2/11 Daniel Kastl <<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a><br>
> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>><br>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>>><br>
> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a><br>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a><br>
> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>>>><br>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a><br>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a><br>
> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>>><br>><br>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a><br>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a><br>
> <mailto:<a href="mailto:kastl@orkney.co.jp">kastl@orkney.co.jp</a>>>>>><br>><br>><br>><br>> So I guess pgRouting doesn't know that<br>> there is a one<br>
> way street.<br>> You might want to read this:<br>><br>> <a href="http://pgrouting.postlbs.org/wiki/OneWayStreets" target="_blank">http://pgrouting.postlbs.org/wiki/OneWayStreets</a><br>
><br>> Daniel<br>><br>><br>> Valeria Muņoz schrieb:<br>> > HI!!<br>> ><br>> > I have a little problem with my<br>
> routing, the best<br>> path from<br>> A to<br>> > B do not respect the traffic direction.<br>> > attached image.<br>
> ><br>> > please check in the example vicente<br>> perez rosales<br>> street<br>> ><br>
> > Query<br>> ><br>> > rt.gid,rt.the_geom AS tg,<br>> AsText(rt.the_geom) AS wkt,<br>> > length(rt.the_geom) AS length,<br>
> calle.gid FROM calle,<br>> (SELECT gid,<br>> > the_geom FROM dijkstra_sp_delta(<br>> 'calle', 3414, 3406,<br>> 3000) ) as rt<br>
> > WHERE calle.gid=rt.gid;<br>> ><br>> ><br>> > RG<br>> ><br>
> ><br>><br>> ------------------------------------------------------------------------<br>> ><br>> ><br>
><br>> ------------------------------------------------------------------------<br>> ><br>> ><br>> _______________________________________________<br>
> > Pgrouting-users mailing list<br>> > <a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>>>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>>>>><br>
><br>> ><br>><br>> <a href="http://lists.postlbs.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.postlbs.org/mailman/listinfo/pgrouting-users</a><br>
> ><br>><br>><br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>
> Pgrouting-users mailing list<br>> <a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>><br>
> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a><br>> <mailto:<a href="mailto:Pgrouting-users@lists.postlbs.org">Pgrouting-users@lists.postlbs.org</a>>>><br>
><br>> <a href="http://lists.postlbs.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.postlbs.org/mailman/listinfo/pgrouting-users</a><br>><br>><br>><br>><br>><br>><br>
> ------------------------------------------------------------------------<br>><br>><br>><br>><br>><br></div></div>> ------------------------------------------------------------------------<br>
><br><br></blockquote></div><br>