How do I calculate the path, pass coordinates and, if possible, in the return function, have the route coordinate list? (I'm trying to plot the route with the ipyleaflet library in a jupyter notebook, and I need the return of the route's coordinate list. I'm new to this and I don't know how to do it)
I tried with an example query that I searched for in a book but I got an empty answer
SELECT r.seq, r.node, w.name As street, w.x1, w.x2, r.cost::numeric(10,4), ( SUM(w.length_m) OVER(ORDER BY r.seq) )::numeric(10,2) As dist_m
FROM pgr_dijkstra('SELECT gid AS id, source, target, cost, reverse_cost FROM ways', (SELECT id FROM ways_vertices_pgr ORDER BY the_geom <-> ST_SetSRID( ST_Point(-3.7482, -38.5486), 4326) limit 1 ) , (SELECT id FROM ways_vertices_pgr
ORDER BY the_geom <-> ST_SetSRID( ST_Point(-3.7532, -38.5170), 4326) limit 1 ), true) AS r
LEFT JOIN ways AS w ON r.edge = w.gid;