[pgrouting-users] directions problem

Valeria Muñoz valemunoz at gmail.com
Thu Feb 12 10:43:46 EST 2009


hi Stephen

i got

"oneway";"count"
-1;1451
0;21403
1;2640


0=both ways
-1=B->A
1= A->B

RG.

2009/2/12 Stephen Woodbridge <woodbri at swoodbridge.com>

> Valeria,
>
> What do you get for this query:
>
> select distinct oneway, count(*) as count from calle group by oneway, order
> by oneway;
>
> If you have a street A------->B then the oneway flag probable needs 3
> values. 0 for both ways, 1? for A to B, and maybe 2? for B to A. You need to
> figure out which values are which.
>
> Then you need cost or reverse cost based on the value of oneway.
>
> -Steve
>
> Valeria Muñoz wrote:
>
>> hi Daniel, thanks for the link..
>>  I did the following:
>>  * UPDATE calle SET to_cost=length(the_geom),
>> reverse_cost=length(the_geom); *
>> * *
>> * UPDATE calle SET reverse_cost=reverse_cost + 1000000 WHERE oneway!=0 ,
>>  oneway!=0 are one way streets. *
>>
>> my query:
>>
>> SELECT edge_id as gid,cost as length FROM shortest_path_astar('SELECT gid
>> AS id,source::int4, target::int4, to_cost::double precision as cost,
>> reverse_cost::double precision, x1,y1,x2,y2 FROM
>> calle',3412,3411,false,true)**
>>
>>  this do not works 100%, with some street works with others no...
>>  I am missing something?
>>  RG
>>
>> 2009/2/11 Daniel Kastl <kastl at orkney.co.jp <mailto:kastl at orkney.co.jp>>
>>
>>    So I guess pgRouting doesn't know that there is a one way street.
>>    You might want to read this:
>>    http://pgrouting.postlbs.org/wiki/OneWayStreets
>>
>>    Daniel
>>
>>
>>    Valeria Muñoz schrieb:
>>     > HI!!
>>     >
>>     >       I have a little problem with my routing, the best path from
>>    A to
>>     > B do not respect the traffic direction.
>>     > attached image.
>>     >
>>     > please check in the example vicente perez rosales street
>>     >
>>     > Query
>>     >
>>     > rt.gid,rt.the_geom AS tg, AsText(rt.the_geom) AS wkt,
>>     > length(rt.the_geom) AS length, calle.gid FROM calle, (SELECT gid,
>>     > the_geom FROM dijkstra_sp_delta( 'calle', 3414, 3406, 3000) ) as rt
>>     > WHERE calle.gid=rt.gid;
>>     >
>>     >
>>     > RG
>>     >
>>     >
>>
>>  ------------------------------------------------------------------------
>>     >
>>     >
>>
>>  ------------------------------------------------------------------------
>>     >
>>     > _______________________________________________
>>     > Pgrouting-users mailing list
>>     > Pgrouting-users at lists.postlbs.org
>>    <mailto:Pgrouting-users at lists.postlbs.org>
>>     > http://lists.postlbs.org/mailman/listinfo/pgrouting-users
>>     >
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.postlbs.org
>> http://lists.postlbs.org/mailman/listinfo/pgrouting-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20090212/e0e4e268/attachment.html


More information about the Pgrouting-users mailing list