I want to compute the shortest path between two points origin=(34.052299,-118.1812657) destination=(34.141132,-117.853179).
Below is my workflow.
Step 1: Find the nearest nodes.
origin: the following returns 590279764
SELECT id
FROM nodes
ORDER BY st_distance(the_geom, st_setsrid(st_makepoint(-118.1812657, 34.052299), 4326))
LIMIT 1
destination: the following returns 123007528
SELECT id
FROM nodes
ORDER BY st_distance(the_geom, st_setsrid(st_makepoint(-117.853179, 34.141132), 4326))
LIMIT 1
Step 2: Compute shortest path between origin and destination.
SELECT *
FROM pgr_dijkstra(
'SELECT gid as id, source, target, length AS cost FROM ways',
590279764, 123007528, false, false
);
However when I execute this I get the following error.
ERROR: Start vertex was not found.
********** Error **********
ERROR: Start vertex was not found.
SQL state: XX000
Why is this happening?