I've import osm file into database by with this command:
osm2pgsql.exe -c -C 3000 -G -d OSM -U postgres --hstore -S default.style data.osm.pbf
After import I've add required columns:
ALTER TABLE planet_osm_line ADD COLUMN source INTEGER;
ALTER TABLE planet_osm_line ADD COLUMN target INTEGER;
and run pgr_createTopology function over this table:
select pgr_createTopology ('planet_osm_line', .001, 'way', 'osm_id');
Next I find out ids of nearest vertices from generated table planet_osm_line_vertices_pgr (for example vertices with ids 100 and 200) and apply them into routing function like this:
SELECT * FROM pgr_dijkstra('
SELECT osm_id AS id,
source,
target,
st_length(way) AS cost
FROM planet_osm_line',
100,
200,
directed := true)
But this give me nothing rows. Can you tell me what I do wrong?