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 http://osm2po.de/download.php?lnk=osm2po-4.4.4a.zip
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,
Tao
2012/10/2 Sylvain Housseman <hsylvio@gmail.com>:
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=roundabout, highway=motorway 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.
_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users