@@ -23,7 +23,10 @@ osmdata_t::osmdata_t(std::unique_ptr<dependency_manager_t> dependency_manager,
2323 std::vector<std::shared_ptr<output_t >> outs,
2424 options_t const &options)
2525: m_dependency_manager(std::move(dependency_manager)), m_mid(std::move(mid)),
26- m_outs (std::move(outs)), m_with_extra_attrs(options.extra_attributes)
26+ m_outs (std::move(outs)), m_conninfo(options.database_options.conninfo()),
27+ m_num_procs(options.num_procs), m_append(options.append),
28+ m_droptemp(options.droptemp), m_parallel_indexing(options.parallel_indexing),
29+ m_with_extra_attrs(options.extra_attributes)
2730{
2831 assert (m_dependency_manager);
2932 assert (m_mid);
@@ -375,14 +378,11 @@ void osmdata_t::stop() const
375378 out->sync ();
376379 }
377380
378- // should be the same for all outputs
379- auto const *opts = m_outs[0 ]->get_options ();
380-
381381 // In append mode there might be dependent objects pending that we
382382 // need to process.
383- if (opts-> append && m_dependency_manager->has_pending ()) {
384- multithreaded_processor proc{opts-> database_options . conninfo () , m_mid,
385- m_outs, (std::size_t )opts-> num_procs };
383+ if (m_append && m_dependency_manager->has_pending ()) {
384+ multithreaded_processor proc{m_conninfo , m_mid, m_outs ,
385+ (std::size_t )m_num_procs };
386386
387387 proc.process_ways (m_dependency_manager->get_pending_way_ids ());
388388 proc.process_relations (
@@ -397,10 +397,9 @@ void osmdata_t::stop() const
397397 // Clustering, index creation, and cleanup.
398398 // All the intensive parts of this are long-running PostgreSQL commands
399399 {
400- osmium::thread::Pool pool{opts->parallel_indexing ? opts->num_procs : 1 ,
401- 512 };
400+ osmium::thread::Pool pool{m_parallel_indexing ? m_num_procs : 1 , 512 };
402401
403- if (opts-> droptemp ) {
402+ if (m_droptemp ) {
404403 // When dropping middle tables, make sure they are gone before
405404 // indexing starts.
406405 m_mid->stop (pool);
@@ -410,7 +409,7 @@ void osmdata_t::stop() const
410409 out->stop (&pool);
411410 }
412411
413- if (!opts-> droptemp ) {
412+ if (!m_droptemp ) {
414413 // When keeping middle tables, there is quite a large index created
415414 // which is better done after the output tables have been copied.
416415 // Note that --disable-parallel-indexing needs to be used to really
0 commit comments