[pgrouting-dev] osm2pgrouting oneway misreading
Sylvain Housseman
hsylvio at gmail.com
Mon Oct 1 09:44:10 PDT 2012
Dear all,
I think that something is wrong with osm2pgrouting:
The code (Export2DB.cpp, called by osm2pgrouting.cpp) writes :
if(way->oneway)
row_data += TO_STR(way->length*1000000);
else
row_data += TO_STR(way->length);
(this row_data will be the reverse_cost value)
but after exporting france.osm I unfortunately observe that this
condition never seems to be met:
franceRouting=> select count (*) from ways where reverse_cost <> length;
count
-------
0
(1 row)
So I guess that the condition (way->oneway) is not appropriated...
Does any version deal with this problem (or did I forget something when
launching osm2pgrouting)?
Thanks again for these great tools;
HSylvio.
BTW, the osm wiki page (http://wiki.openstreetmap.org/wiki/Key:oneway)
explains that
"Some tags (such as junction
<http://wiki.openstreetmap.org/wiki/Key:junction>=roundabout
<http://wiki.openstreetmap.org/wiki/Tag:junction%3Droundabout>, highway
<http://wiki.openstreetmap.org/wiki/Key:highway>=motorway
<http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway> and others)
imply *oneway*=yes. You don't need to add a oneway tag
...
Values
* *oneway*=yes (discouraged alternative: "true", "1")
* *oneway*=no (discouraged alternative: "false", "0")
* *oneway*=-1 (discouraged alternative: "reverse")
"
I did not understand yet how the XMLParser works, but could the problem
be solved by changing the type of "bool oneway" to a string or char[?]
in the "Way" class?
Best,
HSylvio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-dev/attachments/20121001/2a721297/attachment.html>
More information about the pgrouting-dev
mailing list