[pgrouting-users] Build the "right" direction in a network, from a fixed starting point

andy aborruso at gmail.com
Thu May 17 14:57:27 PDT 2018


Hi Vicky,

On Thu, 17 May 2018 at 20:22, Vicky Vergara vicky at georepublic.de
<http://mailto:vicky@georepublic.de> wrote:


> I suggest that you follow the workshop,
> https://workshop.pgrouting.org/2.4.11/en/index.html
> and/or use the sample data of the documentation and do the examples on the
> documentation (there is a "tutorial" in the documentation, maybe out of
> date, but gives an idea)
>
> Thank you.


> The straight answer to your question is yes, you need a cost (&
> reverse_cost is optional)
>
Now I have a route with a cost:
seq path_seq end_vid node edge cost agg_cost
1 1 2 1 1 1875.887941 0.0
2 2 2 2 -1 0.0 1875.887941
3 1 3 1 2 1551.56248159 0.0
4 2 3 3 -1 0.0 1551.56248159
5 1 4 1 3 1506.74402482 0.0
6 2 4 4 -1 0.0 1506.74402482
7 1 5 1 3 1506.74402482 0.0
8 2 5 4 4 1208.08883443 1506.74402482
9 3 5 5 -1 0.0 2714.83285924
10 1 6 1 1 1875.887941 0.0
11 2 6 2 5 1447.12212188 1875.887941
12 3 6 6 -1 0.0 3323.01006288

The command I have used:

SELECT * FROM pgr_dijkstra('SELECT ogc_fid as id, source, target,
st_length(wkb_geometry)
                           as "cost" FROM linee',1,ARRAY[2,3,4,5,6])

The starting point is 1, but I’m able to read in the data that 3 is not
reachable from 1.

What’s wrong in my reasoning ?

Thank you

[image: immagine.png]

​
-- 
___________________

Andrea Borruso
website: https://medium.com/tantotanto
38° 7' 48" N, 13° 21' 9" E, EPSG:4326
___________________

"cercare e saper riconoscere chi e cosa,
 in mezzo all’inferno, non è inferno,
e farlo durare, e dargli spazio"

Italo Calvino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20180517/34d09c72/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: immagine.png
Type: image/png
Size: 18287 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20180517/34d09c72/attachment-0001.png>


More information about the Pgrouting-users mailing list