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

Vicky Vergara vicky at georepublic.de
Thu May 17 11:22:17 PDT 2018


Hello Andy,
I did have my share of first steps with pgRouting some years ago,
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)
https://docs.pgrouting.org/2.6/en/sampledata.html
(I did both things when I was in my baby steps on pgRouting)

The straight answer to your question is yes, you need a cost (&
reverse_cost is optional)



On Thu, May 17, 2018 at 7:25 AM, andy <aborruso at gmail.com> wrote:

> Hi Vicky,
> these are my first steps in pgrouting, and I’m sorry for some stupid
> question.
>
> On Thu, 17 May 2018 at 12:07, Vicky Vergara vicky at georepublic.de
> <http://mailto:vicky@georepublic.de> wrote:
>
> I dont know your data, but suppose
>> id = 1, source = A, target = B, cost > 0, reverse_cost = -1 and that
>> vertex A is not reachable
>> then "manually" would be:
>> UPDATE TABLE foo set source = target, target = source WHERE source IS IN
>> (<set of unreachable vertices>)
>>
> I have created my network with pgr_createTopology.
>
> Now for one to many I must apply something like
>
> SELECT * FROM pgr_dijkstra(
>     'SELECT id, source, target, cost, reverse_cost  FROM edge_table',
>     2, ARRAY[3,5],
>     FALSE
> );
>
> I do not have a cost and reverse_cost columns in my edge_table and than I
> have SQL error.
> Do I must create them?
>
> Thank you
>> --
> ___________________
>
> 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
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pgrouting-users
>



-- 

Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44,
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky at georepublic.de
Web: https://georepublic.info

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20180517/0737788d/attachment-0001.html>


More information about the Pgrouting-users mailing list