This is the first time I post a question here. I was following the tutorial from Anita Graser http://anitagraser.com/2013/07/06/pgrouting-2-0-for-windows-quick-guide/ , on a roads table which contains only 2 columns ( id , geom ). I added the columns ( source and target ) and ran the :
select pgr_createTopology('roads', 0.0001, 'geom', 'id');
the result was OK and the columns were populated. I ran the :
SELECT seq, id1 AS node, id2 AS edge, cost, geom FROM pgr_dijkstra( 'SELECT id, source, target, st_length(geom) as cost FROM roads', 2, 52, false, false ) as di JOIN roads r ON di.id2 = r.id ;
and the results were far from satisfying, none of the exemples I tried gave me the shortest path.
Can someone please explain to me where is the problem ?