[pgrouting-users] osm2pgrouting oneway misreading
Tao Romera Martinez
taoromera at gmail.com
Wed Oct 3 18:41:59 PDT 2012
Good, Sylvain. Good luck with your fork!
2012/10/2 Sylvain Housseman <hsylvio at gmail.com>:
> Thank you, Tao!
> I started changing the code as described below.
> I added outputs, and "oneway" key contains many values corresponding to the
> various versions of osm specs, such as:
> Edge 140678882 has oneway entry with value yes
> Edge 140678886 has oneway entry with value no
> Edge 140678888 has oneway entry with value -1
> Edge 140503091 has oneway entry with value true
> but there also are aberrations such as
> Edge 138507974 has oneway entry with value Bing which I will consider as a
> I am downloading a most recent version of this .osm for testings and I'll
> make osm2pgrouting work (more) properly (except if someone already made the
> job; plz tell it!)
> Thanks again for the answer Tao, but even if osm2pgrouting is far from
> optimized I want to believe in open-source...
> See you soon on GitHub then...
> Le 02/10/2012 09:34, Tao Romera Martinez a écrit :
>> Hi Sylvain,
>> I think I was not able to import data using osm2pgrouting, so I
>> instead used osm2po.
>> Here is the memo I made for myself on how to use it:
>> IMPORTING DATA FROM OSM INTO THE DATABASE
>> 1. Download osm2po from
>> 2. Install in for example /usr/share/osm2po:
>> sudo unzip /home/tao/Downloads/osm2po-4.4.4a.zip
>> 3. Download osm file
>> 4. Copy file to your osm2po folder:
>> sudo cp /home/tao/Downloads/map.osm ./
>> 4. Convert OSM file to DB file:
>> sudo java -jar osm2po-core-4.4.4a-signed.jar prefix=at <file>.osm
>> 5. Import DB file into database (username = postgres):
>> psql -U postgres -d <your_DB> -q -f "/usr/share/osm2po/at/at_2po_4pgr.sql"
>> Good luck,
>> 2012/10/2 Sylvain Housseman <hsylvio at gmail.com>:
>>> Dear all,
>>> I think that something is wrong with osm2pgrouting:
>>> The code (Export2DB.cpp, called by osm2pgrouting.cpp) writes :
>>> row_data += TO_STR(way->length*1000000);
>>> 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
>>> never seems to be met:
>>> franceRouting=> select count (*) from ways where reverse_cost <>
>>> (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;
>>> BTW, the osm wiki page (http://wiki.openstreetmap.org/wiki/Key:oneway)
>>> explains that
>>> "Some tags (such as junction=roundabout, highway=motorway and others)
>>> oneway=yes. You don't need to add a oneway tag
>>> 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
>>> solved by changing the type of "bool oneway" to a string or char[?] in
>>> "Way" class?
>>> Pgrouting-users mailing list
>>> Pgrouting-users at lists.osgeo.org
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
More information about the Pgrouting-users