<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hello Andy,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I did have my share of first steps with pgRouting some years ago,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I suggest that you follow the workshop,<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><a href="https://workshop.pgrouting.org/2.4.11/en/index.html">https://workshop.pgrouting.org/2.4.11/en/index.html</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">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)<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><a href="https://docs.pgrouting.org/2.6/en/sampledata.html">https://docs.pgrouting.org/2.6/en/sampledata.html</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">(I did both things when I was in my baby steps on pgRouting)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The straight answer to your question is yes, you need a cost (& reverse_cost is optional)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 17, 2018 at 7:25 AM, andy <span dir="ltr"><<a href="mailto:aborruso@gmail.com" target="_blank">aborruso@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="m_-303947157067636510markdown-here-wrapper"><p style="margin:0px 0px 1.2em!important">Hi Vicky,<br>these are my first steps in pgrouting, and I’m sorry for some stupid question.</p><span class="">
<p style="margin:0px 0px 1.2em!important">On Thu, 17 May 2018 at 12:07, Vicky Vergara <a href="http://mailto:vicky@georepublic.de" target="_blank">vicky@georepublic.de</a> wrote:</p>
<p style="margin:0px 0px 1.2em!important"></p></span><span class=""><div class="m_-303947157067636510markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I dont know your data, but suppose<br><div style="font-family:arial,helvetica,sans-serif">id = 1, source = A, target = B, cost > 0, reverse_cost = -1 and that vertex A is not reachable<br></div><div style="font-family:arial,helvetica,sans-serif">then "manually" would be:<br></div><div style="font-family:arial,helvetica,sans-serif">UPDATE TABLE foo set source = target, target = source WHERE source IS IN (<set of unreachable vertices>)</div></div></blockquote><p></p></div><p style="margin:0px 0px 1.2em!important"></p>
</span><p style="margin:0px 0px 1.2em!important">I have created my network with <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">pgr_createTopology</code>.</p>
<p style="margin:0px 0px 1.2em!important">Now for one to many I must apply something like</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="m_-303947157067636510hljs m_-303947157067636510language-sql" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248) none repeat scroll 0% 0%"><span class="m_-303947157067636510hljs-operator"><span class="m_-303947157067636510hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">SELECT</span> * <span class="m_-303947157067636510hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">FROM</span> pgr_dijkstra(
<span class="m_-303947157067636510hljs-string" style="color:rgb(221,17,68)">'SELECT id, source, target, cost, reverse_cost FROM edge_table'</span>,
<span class="m_-303947157067636510hljs-number" style="color:rgb(0,128,128)">2</span>, <span class="m_-303947157067636510hljs-built_in" style="color:rgb(0,134,179)">ARRAY</span>[<span class="m_-303947157067636510hljs-number" style="color:rgb(0,128,128)">3</span>,<span class="m_-303947157067636510hljs-number" style="color:rgb(0,128,128)">5</span>],
<span class="m_-303947157067636510hljs-literal">FALSE</span>
);</span>
</code></pre>
<p style="margin:0px 0px 1.2em!important">I do not have a <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">cost</code> and <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">reverse_cost</code> columns in my <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">edge_table</code> and than I have SQL error.<br>Do I must create them?</p>
<p style="margin:0px 0px 1.2em!important">Thank you</p>
<div title="MDH:PGRpdj5IaSBWaWNreSw8L2Rpdj48ZGl2PnRoZXNlIGFyZSBteSBmaXJzdCBzdGVwcyBpbiBwZ3Jv
dXRpbmcsIGFuZCBJJ20gc29ycnkgZm9yIHNvbWUgc3R1cGlkIHF1ZXN0aW9uLjxicj48L2Rpdj48
ZGl2PjwvZGl2Pjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+PGRpdiBkaXI9Imx0ciI+T24g
VGh1LCAxNyBNYXkgMjAxOCBhdCAxMjowNywgVmlja3kgVmVyZ2FyYSAmbHQ7dmlja3lAZ2VvcmVw
dWJsaWMuZGUmZ3Q7IHdyb3RlOjxicj48L2Rpdj48Ymx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kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5gYGBzcWw8L2Rpdj48ZGl2PlNFTEVDVCAqIEZS
T00gcGdyX2RpamtzdHJhKDxicj4mbmJzcDsmbmJzcDsmbmJzcDsgJ1NFTEVDVCBpZCwgc291cmNl
LCB0YXJnZXQsIGNvc3QsIHJldmVyc2VfY29zdCZuYnNwOyBGUk9NIGVkZ2VfdGFibGUnLDxicj4m
bmJzcDsmbmJzcDsmbmJzcDsgMiwgQVJSQVlbMyw1XSw8YnI+Jm5ic3A7Jm5ic3A7Jm5ic3A7IEZB
TFNFPGJyPik7PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PkkgZG8gbm90
IGhhdmUgYSBgY29zdGAgYW5kIGAKcmV2ZXJzZV9jb3N0YCBjb2x1bW5zIGluIG15IGBlZGdlX3Rh
YmxlYCBhbmQgdGhhbiBJIGhhdmUgU1FMIGVycm9yLjwvZGl2PjxkaXY+RG8gSSBtdXN0IGNyZWF0
ZSB0aGVtPzwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+VGhhbmsgeW91PGJyPjwvZGl2PjxkaXY+
PGJyPjwvZGl2PjxkaXY+Jm5ic3A7PC9kaXY+PC9kaXY+PGJyPg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div><span class="">-- <br><div dir="ltr" class="m_-303947157067636510gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><span style="font-size:small">___________________</span><br></div><div dir="ltr"><span style="font-size:small"><br></span></div><div dir="ltr">Andrea Borruso<br>
website: <a href="https://medium.com/tantotanto" target="_blank">https://medium.com/tantotanto</a><br>38° 7' 48" N, 13° 21' 9" E, EPSG:4326<br><span style="font-size:small">___________________</span><br>
<br>
"cercare e saper riconoscere chi e cosa,<br>
in mezzo all’inferno, non è inferno, <br>
e farlo durare, e dargli spazio"<br>
<br>
Italo Calvino<br></div></div></div></div></div></div></div></div></div></div></div></div></div></span></div>
<br>______________________________<wbr>_________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.<wbr>org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/pgrouting-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/pgrouting-<wbr>users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><pre>Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44,
81739 München, Germany
Vicky Vergara
Operations Research
eMail: vicky@<a href="http://georepublic.de" target="_blank">georepublic.de</a>
Web: <a href="https://georepublic.info" target="_blank">https://georepublic.info</a>
Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9
Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl
<span></span></pre></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>