This is an automated email from the git hooks/post-receive script. sebastic pushed a commit to branch master in repository osm2pgrouting.
commit 07096a4f20c0c67ee4ebf64ed451567371fb7df6 Author: Bas Couwenberg <[email protected]> Date: Sun Oct 15 10:32:24 2017 +0200 New upstream version 2.3.1 --- NEWS | 5 +++++ Readme.md | 6 +++--- src/database/Export2DB.cpp | 16 ++++++++-------- src/osm_elements/OSMDocument.cpp | 19 +++++++++---------- src/osm_elements/osm2pgrouting.cpp | 4 ++-- src/osm_elements/osm_element.cpp | 3 ++- src/parser/OSMDocumentParserCallback.cpp | 14 ++++++++------ src/utilities/handle_pgpass.cpp | 2 ++ 8 files changed, 39 insertions(+), 30 deletions(-) diff --git a/NEWS b/NEWS index 6e10eb7..710a956 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,10 @@ osm2pgRouting 2.3.0 +* Fix: When keys have spaces +* Fix: Generating relations + +osm2pgRouting 2.3.0 + * Cost should not return the same value * Added a points of Interest table * Some default one_way values are taken into consideration diff --git a/Readme.md b/Readme.md index 41bebd6..b4316dc 100644 --- a/Readme.md +++ b/Readme.md @@ -32,9 +32,7 @@ make make install ``` -If you have libraries installed in non-standard locations, you might need to pass in parameters to cmake. Commonly useful parameters are - -Install some prerqeuisites +Install some prerequisites: ``` sudo apt-get install expat @@ -44,6 +42,8 @@ sudo apt-get install libboost-program-options-dev sudo apt install libpqxx-dev ``` +If you have libraries installed in non-standard locations, you might need to pass in parameters to cmake. Commonly useful parameters are + CMAKE options: -DBOOST_ROOT:PATH=/path/to/boost folder that contains include, lib, bin directories for boost diff --git a/src/database/Export2DB.cpp b/src/database/Export2DB.cpp index 6df5313..e9ad856 100644 --- a/src/database/Export2DB.cpp +++ b/src/database/Export2DB.cpp @@ -167,16 +167,16 @@ void Export2DB::dropTables() const { pqxx::work Xaction(db_conn); Xaction.exec(ways().drop()); - std::cout << "TABLE: " << ways().addSchema() << " droped ... OK.\n"; + std::cout << "TABLE: " << ways().addSchema() << " dropped ... OK.\n"; Xaction.exec(vertices().drop()); - std::cout << "TABLE: " << vertices().addSchema() << " droped ... OK.\n"; + std::cout << "TABLE: " << vertices().addSchema() << " dropped ... OK.\n"; Xaction.exec(pois().drop()); - std::cout << "TABLE: " << pois().addSchema() << " droped ... OK.\n"; + std::cout << "TABLE: " << pois().addSchema() << " dropped ... OK.\n"; Xaction.exec(configuration().drop()); - std::cout << "TABLE: " << configuration().addSchema() << " droped ... OK.\n"; + std::cout << "TABLE: " << configuration().addSchema() << " dropped ... OK.\n"; Xaction.commit(); } catch (const std::exception &e) { @@ -188,13 +188,13 @@ void Export2DB::dropTables() const { pqxx::connection db_conn(conninf); pqxx::work Xaction(db_conn); Xaction.exec(osm_nodes().drop()); - std::cout << "TABLE: " << osm_nodes().addSchema() << " droped ... OK.\n"; + std::cout << "TABLE: " << osm_nodes().addSchema() << " dropped ... OK.\n"; Xaction.exec(osm_ways().drop()); - std::cout << "TABLE: " << osm_ways().addSchema() << " droped ... OK.\n"; + std::cout << "TABLE: " << osm_ways().addSchema() << " dropped ... OK.\n"; Xaction.exec(osm_relations().drop()); - std::cout << "TABLE: " << osm_relations().addSchema() << " droped ... OK.\n"; + std::cout << "TABLE: " << osm_relations().addSchema() << " dropped ... OK.\n"; Xaction.commit(); } catch (const std::exception &e) { @@ -598,7 +598,7 @@ void Export2DB::process_pois() const { execute(pois().sql(4)); std::cout << "\nTo process pointsOfInterest table:" - "\nosm2pgr_pois_update(radius deault 200, within default 50)\n" + "\nosm2pgr_pois_update(radius default 200, within default 50)\n" "\n - Using areas of (radius)mts on POIS" "\n - Using edges that are at least (within) mts of each POI" "\nPOIS that do not have a closest edge is considered as too far\n"; diff --git a/src/osm_elements/OSMDocument.cpp b/src/osm_elements/OSMDocument.cpp index 0735a21..bc602c3 100644 --- a/src/osm_elements/OSMDocument.cpp +++ b/src/osm_elements/OSMDocument.cpp @@ -92,17 +92,15 @@ void OSMDocument::AddWay(const Way &w) { if (m_ways.empty() && m_vm.count("addnodes")) { wait_child(); osm_table_export(m_nodes, "osm_nodes"); - std::cout << "\nFinal osm_nodes:\t" << m_nodes.size(); export_pois(); + std::cout << "\nFinal osm_nodes:\t" << m_nodes.size() << "\n"; } if (m_vm.count("addnodes")) { if ((m_ways.size() % m_chunk_size) == 0) { wait_child(); - if (m_ways.size() % 200000 == 0) { - std::cout << "\nCurrent osm_ways:\t" << m_ways.size(); - } + std::cout << "\rCurrent osm_ways:\t" << m_ways.size(); osm_table_export(m_ways, "osm_ways"); } } @@ -115,15 +113,15 @@ OSMDocument::AddRelation(const Relation &r) { if (m_vm.count("addnodes") && m_relations.empty()) { wait_child(); osm_table_export(m_ways, "osm_ways"); - std::cout << "\nFinal osm_ways:\t" << m_ways.size(); + std::cout << "\nFinal osm_ways:\t" << m_ways.size() << "\n"; } if (m_vm.count("addnodes")) { - wait_child(); - if (m_relations.size() % 100000 == 0) { - std::cout << "\nCurrent osm_relations:\t" << m_relations.size(); + if (m_relations.size() % m_chunk_size == 0) { + wait_child(); + std::cout << "\rCurrent osm_relations:\t" << m_relations.size(); + osm_table_export(m_relations, "osm_relations"); } - osm_table_export(m_relations, "osm_relations"); } m_relations.push_back(r); } @@ -132,9 +130,10 @@ void OSMDocument::endOfFile() const { if (m_vm.count("addnodes")) { wait_child(); + std::cout << "\nFinal osm_relations:\t" << m_relations.size(); osm_table_export(m_relations, "osm_relations"); - std::cout << "\nEnd Of file\n\n\n"; } + std::cout << "\nEnd Of file\n\n\n"; } diff --git a/src/osm_elements/osm2pgrouting.cpp b/src/osm_elements/osm2pgrouting.cpp index ca7250a..0574246 100644 --- a/src/osm_elements/osm2pgrouting.cpp +++ b/src/osm_elements/osm2pgrouting.cpp @@ -96,7 +96,7 @@ int main(int argc, char* argv[]) { } if (vm.count("version")) { - std::cout << "This is osm2pgrouting Version 2.3\n"; + std::cout << "This is osm2pgrouting Version 2.3.1\n"; return 0; } @@ -133,7 +133,7 @@ int main(int argc, char* argv[]) { << endl; pqxx::connection C(connection_str); if (C.is_open()) { - cout << "database connection successfull: " << C.dbname() << endl; + cout << "database connection successful: " << C.dbname() << endl; } else { cout << "Can't open database" << endl; return 1; diff --git a/src/osm_elements/osm_element.cpp b/src/osm_elements/osm_element.cpp index 49fd339..df3f103 100644 --- a/src/osm_elements/osm_element.cpp +++ b/src/osm_elements/osm_element.cpp @@ -155,7 +155,8 @@ getHstore(const std::map<std::string, std::string> &values) { if (values.empty()) return std::string(); for (const auto item : values) { - hstore += item.first + hstore += + addquotes(item.first, true) + " => " + addquotes(item.second, true) + ","; } diff --git a/src/parser/OSMDocumentParserCallback.cpp b/src/parser/OSMDocumentParserCallback.cpp index 68df9fb..53f54ae 100644 --- a/src/parser/OSMDocumentParserCallback.cpp +++ b/src/parser/OSMDocumentParserCallback.cpp @@ -56,6 +56,7 @@ namespace osm2pgr { void OSMDocumentParserCallback::show_progress() { +#if 0 try { if (m_line == 0) return; assert(m_rDocument.lines()); @@ -66,6 +67,7 @@ OSMDocumentParserCallback::show_progress() { } catch(...) { m_line = 1; } +#endif } @@ -141,12 +143,14 @@ OSMDocumentParserCallback::StartElement( auto tag = last_relation->add_tag(Tag(atts)); m_rDocument.add_config(last_relation, tag); } - } else if (strcmp(name, "osm") == 0) { + } + if (strcmp(name, "osm") == 0) { } } void OSMDocumentParserCallback::EndElement(const char* name) { if (strcmp(name, "osm") == 0) { + m_rDocument.endOfFile(); return; } if (strcmp(name, "node") == 0) { @@ -169,7 +173,8 @@ void OSMDocumentParserCallback::EndElement(const char* name) { delete last_way; return; - } else if (strcmp(name, "relation") == 0) { + } + if (strcmp(name, "relation") == 0) { if (m_rDocument.config_has_tag(last_relation->tag_config())) { for (auto it = last_relation->way_refs().begin(); it != last_relation->way_refs().end(); ++it) { auto way_id = *it; @@ -187,13 +192,10 @@ void OSMDocumentParserCallback::EndElement(const char* name) { } } } + m_rDocument.AddRelation(*last_relation); } - m_rDocument.AddRelation(*last_relation); delete last_relation; - } else if (strcmp(name, "osm") == 0) { - m_rDocument.endOfFile(); - show_progress(); } } diff --git a/src/utilities/handle_pgpass.cpp b/src/utilities/handle_pgpass.cpp index 009ba7f..c15dab5 100644 --- a/src/utilities/handle_pgpass.cpp +++ b/src/utilities/handle_pgpass.cpp @@ -85,7 +85,9 @@ handle_pgpass(po::variables_map &vm) { && (user == "*" || user == username) && (dbase == "*" || host == vm["dbname"].as<std::string>())) { infile.close(); +#if 0 std::cout << passwd << "\n"; +#endif vm.at("password").value() = passwd; return; } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osm2pgrouting.git _______________________________________________ Pkg-grass-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

