@@ -418,23 +418,25 @@ std::shared_ptr<output_t> output_pgsql_t::clone(
418418 return std::make_shared<output_pgsql_t >(this , mid, copy_thread);
419419}
420420
421- output_pgsql_t ::output_pgsql_t (
422- std::shared_ptr<middle_query_t > const &mid ,
423- std::shared_ptr< thread_pool_t > thread_pool, options_t const &o,
424- std::shared_ptr< db_copy_thread_t > const ©_thread)
425- : output_t (mid, std::move(thread_pool), o), m_proj(o.projection) ,
426- m_expire (o.expire_tiles_zoom, o.expire_tiles_max_bbox, o .projection),
421+ output_pgsql_t ::output_pgsql_t (std::shared_ptr< middle_query_t > const &mid,
422+ std::shared_ptr<thread_pool_t > thread_pool ,
423+ options_t const &options)
424+ : output_t (mid, std::move(thread_pool), options), m_proj(options.projection),
425+ m_expire (options.expire_tiles_zoom, options.expire_tiles_max_bbox ,
426+ options .projection),
427427 m_buffer(32768 , osmium::memory::Buffer::auto_grow::yes),
428428 m_rels_buffer(1024 , osmium::memory::Buffer::auto_grow::yes)
429429{
430- log_debug (" Using projection SRS {} ({})" , o .projection ->target_srs (),
431- o .projection ->target_desc ());
430+ log_debug (" Using projection SRS {} ({})" , options .projection ->target_srs (),
431+ options .projection ->target_desc ());
432432
433433 export_list exlist;
434434
435- m_enable_way_area = read_style_file (get_options ()->style , &exlist);
435+ m_enable_way_area = read_style_file (options.style , &exlist);
436+
437+ m_tagtransform = tagtransform_t::make_tagtransform (&options, exlist);
436438
437- m_tagtransform = tagtransform_t::make_tagtransform ( get_options (), exlist );
439+ auto copy_thread = std::make_shared< db_copy_thread_t >(options. conninfo );
438440
439441 // for each table
440442 for (size_t i = 0 ; i < t_MAX; ++i) {
@@ -444,7 +446,7 @@ output_pgsql_t::output_pgsql_t(
444446 (i == t_point) ? osmium::item_type::node : osmium::item_type::way);
445447
446448 // figure out what name we are using for this and what type
447- std::string name = get_options ()-> prefix ;
449+ std::string name = options. prefix ;
448450 std::string type;
449451 switch (i) {
450452 case t_point:
@@ -469,10 +471,9 @@ output_pgsql_t::output_pgsql_t(
469471 }
470472
471473 m_tables[i] = std::make_unique<table_t >(
472- name, type, columns, get_options ()->hstore_columns ,
473- get_options ()->projection ->target_srs (), get_options ()->append ,
474- get_options ()->hstore_mode , copy_thread,
475- get_options ()->output_dbschema );
474+ name, type, columns, options.hstore_columns ,
475+ options.projection ->target_srs (), options.append ,
476+ options.hstore_mode , copy_thread, options.output_dbschema );
476477 }
477478}
478479
0 commit comments