I have set pgrouting and inserted my data with osm2pgrouting .
I would like to know how can I find out which way is one way. Also I read that if I assign the reverse_cost of an one way to -1 only the this road is considered as one way, is it true?
http://www.webrian.ch/2011/07/set-up-pgrouting-with-openstreetmap.html describes one possible solution. The challenge is that osm2pgrouting does not import one-way information. The author uses GRASS to find one-ways from the data. This solution sets reverse_cost to -1 to mark one-ways.
In pgRoutingDocs there is "How to handle one-way streets" The idea there is to set the cost against the one-way direction very high (instead of -1).
Note: Only if the reverse parameter is set to true, the algorithms will use the reverse_cost field.
Osm2po, another OSM import tool, handles one-way information better. reverse_cost fields are filled automatically (to a very high value).
Thank you for the answer, but I think that something might be wrong:
The osm2pgrouting code (Export2DB.cpp, called by osm2pgrouting.cpp) writes :
but after exporting france.osm I notice that
So I guess that the condition (way->oneway) is not precise enough... But "I might be wrong"!
=> Hell I did not send that answer?! In the meantime I forked and modified the osm2pgrouting git repo. for it to consider the "oneway" tag values "true", "1" and "yes"... Maybe some more modifications are to come : the osm wiki states something like 'some ways, like motorways, are automatically considered as oneway edges'. Still, this statement can be taken into account afterwards with a single sql command... HF!