diff --git a/NEWS b/NEWS index 6e10eb76..710a956f 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/src/database/Export2DB.cpp b/src/database/Export2DB.cpp index 3d65e8e1..e9ad856a 100644 --- a/src/database/Export2DB.cpp +++ b/src/database/Export2DB.cpp @@ -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 0735a21e..bc602c3b 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 8764267d..05742465 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; } diff --git a/src/osm_elements/osm_element.cpp b/src/osm_elements/osm_element.cpp index 49fd339c..df3f1034 100644 --- a/src/osm_elements/osm_element.cpp +++ b/src/osm_elements/osm_element.cpp @@ -155,7 +155,8 @@ getHstore(const std::map &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 68df9fb3..53f54ae5 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 009ba7f3..c15dab57 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())) { infile.close(); +#if 0 std::cout << passwd << "\n"; +#endif vm.at("password").value() = passwd; return; }