@@ -340,7 +340,7 @@ void middle_pgsql_t::node_set(osmium::Node const &node)
340340 if (!m_options->flat_node_file .empty ()) {
341341 m_persistent_cache->set (node.id (), node.location ());
342342 } else {
343- m_db_copy.new_line (m_tables[NODE_TABLE] .copy_target ());
343+ m_db_copy.new_line (m_tables (osmium::item_type::node) .copy_target ());
344344
345345 m_db_copy.add_columns (node.id (), node.location ().y (),
346346 node.location ().x ());
@@ -381,7 +381,7 @@ void middle_pgsql_t::node_delete(osmid_t osm_id)
381381 if (!m_options->flat_node_file .empty ()) {
382382 m_persistent_cache->set (osm_id, osmium::Location{});
383383 } else {
384- m_db_copy.new_line (m_tables[NODE_TABLE] .copy_target ());
384+ m_db_copy.new_line (m_tables (osmium::item_type::node) .copy_target ());
385385 m_db_copy.delete_object (osm_id);
386386 }
387387}
@@ -403,7 +403,7 @@ idlist_t middle_pgsql_t::get_rels_by_way(osmid_t osm_id)
403403
404404void middle_pgsql_t::way_set (osmium::Way const &way)
405405{
406- m_db_copy.new_line (m_tables[WAY_TABLE] .copy_target ());
406+ m_db_copy.new_line (m_tables (osmium::item_type::way) .copy_target ());
407407
408408 m_db_copy.add_column (way.id ());
409409
@@ -494,7 +494,7 @@ middle_query_pgsql_t::rel_way_members_get(osmium::Relation const &rel,
494494void middle_pgsql_t::way_delete (osmid_t osm_id)
495495{
496496 assert (m_options->append );
497- m_db_copy.new_line (m_tables[WAY_TABLE] .copy_target ());
497+ m_db_copy.new_line (m_tables (osmium::item_type::way) .copy_target ());
498498 m_db_copy.delete_object (osm_id);
499499}
500500
@@ -507,7 +507,7 @@ void middle_pgsql_t::relation_set(osmium::Relation const &rel)
507507 parts[osmium::item_type_to_nwr_index (m.type ())].push_back (m.ref ());
508508 }
509509
510- m_db_copy.new_line (m_tables[REL_TABLE] .copy_target ());
510+ m_db_copy.new_line (m_tables (osmium::item_type::relation) .copy_target ());
511511
512512 // id, way offset, relation offset
513513 m_db_copy.add_columns (rel.id (), parts[0 ].size (),
@@ -568,30 +568,30 @@ void middle_pgsql_t::relation_delete(osmid_t osm_id)
568568{
569569 assert (m_options->append );
570570
571- m_db_copy.new_line (m_tables[REL_TABLE] .copy_target ());
571+ m_db_copy.new_line (m_tables (osmium::item_type::relation) .copy_target ());
572572 m_db_copy.delete_object (osm_id);
573573}
574574
575575void middle_pgsql_t::after_nodes ()
576576{
577577 m_db_copy.sync ();
578578 if (m_options->flat_node_file .empty ()) {
579- auto const &table = m_tables[NODE_TABLE] ;
579+ auto const &table = m_tables (osmium::item_type::node) ;
580580 analyze_table (m_db_connection, table.schema (), table.name ());
581581 }
582582}
583583
584584void middle_pgsql_t::after_ways ()
585585{
586586 m_db_copy.sync ();
587- auto const &table = m_tables[WAY_TABLE] ;
587+ auto const &table = m_tables (osmium::item_type::way) ;
588588 analyze_table (m_db_connection, table.schema (), table.name ());
589589}
590590
591591void middle_pgsql_t::after_relations ()
592592{
593593 m_db_copy.sync ();
594- auto const &table = m_tables[REL_TABLE] ;
594+ auto const &table = m_tables (osmium::item_type::relation) ;
595595 analyze_table (m_db_connection, table.schema (), table.name ());
596596
597597 // release the copy thread and its database connection
@@ -804,12 +804,13 @@ middle_pgsql_t::middle_pgsql_t(options_t const *options)
804804 log_debug (" You don't have a bucket index. See manual for details." );
805805 }
806806
807- m_tables[NODE_TABLE] =
807+ m_tables (osmium::item_type::node) =
808808 table_desc{*options, sql_for_nodes (options->flat_node_file .empty ())};
809- m_tables[WAY_TABLE] =
809+ m_tables (osmium::item_type::way) =
810810 table_desc{*options, sql_for_ways (has_bucket_index,
811811 options->way_node_index_id_shift )};
812- m_tables[REL_TABLE] = table_desc{*options, sql_for_relations ()};
812+ m_tables (osmium::item_type::relation) =
813+ table_desc{*options, sql_for_relations ()};
813814}
814815
815816std::shared_ptr<middle_query_t >
0 commit comments