/*
こちらは、length_m as cost を使っている
query := `
SELECT seq, source, target, x1, y1, x2, y2, agg_cost
FROM pgr_dijkstra(
'SELECT gid as id, source, target, length_m as cost FROM ways',
$1::bigint,
$2::bigint,
directed:=false
) a
INNER JOIN ways b ON (a.edge = b.gid)
ORDER BY seq
`
*/
// こちらは、cost, reverse_cost を使っている
query := `
SELECT seq, source, target, x1, y1, x2, y2, agg_cost
FROM pgr_dijkstra(
'SELECT gid as id, source, target, cost, reverse_cost FROM ways',
$1::bigint,
$2::bigint,
directed:=false
) a
INNER JOIN ways b ON (a.edge = b.gid)
ORDER BY seq
`
こちらは、"length_m as cost" を使っては駄目だった。
cost, reverse_cost を使わなければならなかった。
もう、これで完成だ、と思っても次々問題が出てきて、本当に疲れる・・・