I'm trying to make working pgrouting 2 but no luck. Generally it is working but routing table is completely wrong.
I did import osm database using osm2po():
java -Xmx1024m -jar osm2po-core-4.7.7-signed.jar cmd=tjsp prefix=cr tileSize=x czech-republic-latest.osm.pbf
Then i import result sql into postgres table with enabled pgrouting. After that i renamed "id" to "gid" and "geom_way" to "the_geom".
After that i locate start and end point ID's which match what i want ( when i select result GID from cr_2po_4pgr it match extactly the street i'm looking for.
Then i run this:
SELECT seq, id1 AS node, id2 AS to, cost FROM pgr_astar ( 'SELECT gid as id, source, target, cost, x1, y1,x2, y2 FROM cr_2po_4pgr', $start, $end, false, false );
where $start and $end is gid of starting and ending street. Result route is completely useless, look like random jumps over maps, visiting streets and cities which are over 200km from start/destionation points.
I assume that "to" field is gid from cr_2po_4pgr or i'm i wrong ?