Following my Other Question about non-network integrating routing, I have tried the with-points functions using the code proposed in the answer.
The problem is I don't get the shortest path using these functions
For clarification the pink polyline represents the With-points result and the green one represents Dijkstra's result
Edited
The code I used to calculate the with_points route is
SELECT *
FROM pgr_withPoints(
'SELECT id, source, target, st_length(the_geom) as cost FROM vr',
'SELECT pnt.id AS pid,
edg.edge_id,
edg.fraction
FROM points_table AS pnt
CROSS JOIN LATERAL (
SELECT id AS edge_id,
ST_LineLocatePoint(the_geom, pnt.geom) AS fraction
FROM vr
ORDER BY
the_geom <-> pnt.geom
LIMIT 1
) AS edg',
-888888, -607,
details := TRUE
);
vr is my edge table, -888888 and -607 are start and end point id
