From a120fc23c3c3ef785d44a7a8e4f2f3c2124da95f Mon Sep 17 00:00:00 2001 From: Peter Yates Date: Wed, 4 Jul 2012 15:42:07 +0100 Subject: [PATCH] Remove backslashes from osm ways, as per: Some of the road/way names in the OSM data seem to contain a backslash ("\") which they should not. This case is not tested and fixed by the "osm2pgrouting" tool so far and this most probably causes the error you get. What you could do is inserting the following line in the in the "exportWays" method in the "Export2DB.cpp" file (in the "src" folder of your "osm2pgrouting" folder) and after that build the tool again ("make"): http://gis.stackexchange.com/questions/12070/error-during-importing-a-map-with-osm2pgrouting --- src/Export2DB.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Export2DB.cpp b/src/Export2DB.cpp index ca7ca12a..6b9cfa62 100644 --- a/src/Export2DB.cpp +++ b/src/Export2DB.cpp @@ -304,11 +304,12 @@ void Export2DB::exportWays(std::vector& ways, Configuration* config) row_data += "\t"; if(!way->name.empty()) { - std::string escaped_name = way->name; - boost::replace_all(escaped_name, "\t", "\\\t"); - boost::replace_all(escaped_name, "\n", ""); - boost::replace_all(escaped_name, "\r", ""); - row_data += escaped_name.substr(0,199); + std::string escaped_name = way->name; + boost::replace_all(escaped_name, "\t", "\\\t"); + boost::replace_all(escaped_name, "\n", ""); + boost::replace_all(escaped_name, "\r", ""); + boost::replace_all(escaped_name, "\\", ""); + row_data += escaped_name.substr(0,199); } row_data += "\n"; PQputline(mycon, row_data.c_str());