<div dir="ltr"><div>Hi,</div><div><br></div><div>I want to compute the shortest path between two points origin=(34.052299,-118.1812657) and destination: (34.141132,-117.853179).</div><div><br></div><div>Here is what I tried to do.</div>
<div><br></div><div><div><b>Step 1:</b> Find the nearest nodes.</div><div><br></div><div><u>origin: the following returns 590279764</u></div><div><u><br></u></div><div><div>SELECT id</div><div>FROM nodes</div><div>ORDER BY st_distance(the_geom, st_setsrid(st_makepoint(-118.1812657, 34.052299), 4326))</div>
<div>LIMIT 1</div></div><div><br></div><div><u>destination: the following returns 123007528</u></div><div><div><br></div><div><div>SELECT id</div><div>FROM nodes</div><div>ORDER BY st_distance(the_geom, st_setsrid(st_makepoint(-117.853179, 34.141132), 4326))</div>
<div>LIMIT 1</div></div></div><div><br></div><div><b>Step 2:</b> Compute shortest path between origin and destination.</div><div><br></div><div><div>SELECT *</div><div>FROM pgr_dijkstra(</div><div><span class="" style="white-space:pre"> </span>'SELECT gid as id, source, target, length AS cost FROM ways',</div>
<div><span class="" style="white-space:pre"> </span>590279764, 123007528, false, false</div><div>);</div></div><div><br></div><div>However when I execute this I get the following error.</div><div><br></div><div><div><font color="#ff0000">ERROR: Start vertex was not found.</font></div>
<div><font color="#ff0000"><br></font></div><div><font color="#ff0000">********** Error **********</font></div><div><font color="#ff0000"><br></font></div><div><font color="#ff0000">ERROR: Start vertex was not found.</font></div>
<div><font color="#ff0000">SQL state: XX000</font></div></div><div><br></div><div>Why is this happening?</div><div><br></div><div>Kind regards,</div><div>Cathal</div><div><br></div><div><br></div>
</div></div>