I have a river network shapefile and I use pgRouting 2.0 to route it. I use the following sql code to make it routable,
alter table tc_15000_w_area add column source integer;
alter table tc_15000_w_area add column target integer;
select pgr_createTopology('tc_15000_w_area', 0.0001, 'the_geom', 'gid');
All I want is a routable table contains source/target and the direction from all sources to targets is the same as the direction of the river. Here's the schematic photo,
the purple line is the river
the red dots are nodes(vertices)
the red numbers are numbers of the nodes
every river segment has its source(node) and target
But I check the resulting table, I find that node#11 is always the target. This will make at least one of the edges has wrong direction(flow direction).
Can pgRouting assign numbers of source and target and make the direction from source to target the same as the flow direction? If not, what can I do?
I have used different tolerances in sql code, but got the same result, and I also got the same result using pgRouting version 1.x under PostgreSQL 8.4.