@@ -69,16 +69,16 @@ void output_pgsql_t::pgsql_out_way(osmium::Way const &way, taglist_t *tags,
6969 if (!wkb.empty ()) {
7070 m_expire.from_geometry (projected_geom, way.id ());
7171 if (m_enable_way_area) {
72- double const area = calculate_area (m_options. reproject_area ,
73- geom, projected_geom);
72+ double const area = calculate_area (
73+ get_options ()-> reproject_area , geom, projected_geom);
7474 util::double_to_buffer tmp{area};
7575 tags->set (" way_area" , tmp.c_str ());
7676 }
7777 m_tables[t_poly]->write_row (way.id (), *tags, wkb);
7878 }
7979 } else {
8080 double const split_at =
81- m_options. projection ->target_latlon () ? 1 : 100 * 1000 ;
81+ get_options ()-> projection ->target_latlon () ? 1 : 100 * 1000 ;
8282 auto const geoms = geom::split_multi (geom::segmentize (
8383 geom::transform (geom::create_linestring (way), *m_proj), split_at));
8484 for (auto const &sgeom : geoms) {
@@ -139,14 +139,16 @@ void output_pgsql_t::stop()
139139{
140140 for (auto &t : m_tables) {
141141 t->task_set (thread_pool ().submit ([&]() {
142- t->stop (m_options.slim && !m_options.droptemp ,
143- m_options.enable_hstore_index , m_options.tblsmain_index );
142+ t->stop (get_options ()->slim && !get_options ()->droptemp ,
143+ get_options ()->enable_hstore_index ,
144+ get_options ()->tblsmain_index );
144145 }));
145146 }
146147
147- if (m_options.expire_tiles_zoom_min > 0 ) {
148- m_expire.output_and_destroy (m_options.expire_tiles_filename .c_str (),
149- m_options.expire_tiles_zoom_min );
148+ if (get_options ()->expire_tiles_zoom_min > 0 ) {
149+ m_expire.output_and_destroy (
150+ get_options ()->expire_tiles_filename .c_str (),
151+ get_options ()->expire_tiles_zoom_min );
150152 }
151153}
152154
@@ -239,7 +241,7 @@ void output_pgsql_t::pgsql_process_relation(osmium::Relation const &rel)
239241 taglist_t outtags;
240242
241243 rolelist_t xrole;
242- if (!m_options. tag_transform_script .empty ()) {
244+ if (!get_options ()-> tag_transform_script .empty ()) {
243245 xrole = get_rolelist (rel, m_buffer);
244246 }
245247
@@ -260,7 +262,7 @@ void output_pgsql_t::pgsql_process_relation(osmium::Relation const &rel)
260262 // for boundaries the way_area tag may be added.
261263 if (!make_polygon) {
262264 double const split_at =
263- m_options. projection ->target_latlon () ? 1 : 100 * 1000 ;
265+ get_options ()-> projection ->target_latlon () ? 1 : 100 * 1000 ;
264266 auto geom = geom::line_merge (geom::create_multilinestring (m_buffer));
265267 auto projected_geom = geom::transform (geom, *m_proj);
266268 if (!projected_geom.is_null () && split_at > 0.0 ) {
@@ -279,15 +281,16 @@ void output_pgsql_t::pgsql_process_relation(osmium::Relation const &rel)
279281
280282 // multipolygons and boundaries
281283 if (make_boundary || make_polygon) {
282- auto const geoms = geom::split_multi (
283- geom::create_multipolygon (rel, m_buffer), !m_options.enable_multi );
284+ auto const geoms =
285+ geom::split_multi (geom::create_multipolygon (rel, m_buffer),
286+ !get_options ()->enable_multi );
284287 for (auto const &sgeom : geoms) {
285288 auto const projected_geom = geom::transform (sgeom, *m_proj);
286289 m_expire.from_geometry (projected_geom, -rel.id ());
287290 auto const wkb = geom_to_ewkb (projected_geom);
288291 if (m_enable_way_area) {
289- double const area = calculate_area (m_options. reproject_area ,
290- sgeom, projected_geom);
292+ double const area = calculate_area (
293+ get_options ()-> reproject_area , sgeom, projected_geom);
291294 util::double_to_buffer tmp{area};
292295 outtags.set (" way_area" , tmp.c_str ());
293296 }
@@ -329,11 +332,11 @@ void output_pgsql_t::node_delete(osmid_t osm_id)
329332void output_pgsql_t::pgsql_delete_way_from_output (osmid_t osm_id)
330333{
331334 /* Optimisation: we only need this is slim mode */
332- if (!m_options. slim ) {
335+ if (!get_options ()-> slim ) {
333336 return ;
334337 }
335338 /* in droptemp mode we don't have indices and this takes ages. */
336- if (m_options. droptemp ) {
339+ if (get_options ()-> droptemp ) {
337340 return ;
338341 }
339342
@@ -395,8 +398,8 @@ void output_pgsql_t::start()
395398{
396399 for (auto &t : m_tables) {
397400 // setup the table in postgres
398- t->start (m_options. database_options .conninfo (),
399- m_options. tblsmain_data );
401+ t->start (get_options ()-> database_options .conninfo (),
402+ get_options ()-> tblsmain_data );
400403 }
401404}
402405
@@ -422,9 +425,9 @@ output_pgsql_t::output_pgsql_t(
422425
423426 export_list exlist;
424427
425- m_enable_way_area = read_style_file (m_options. style , &exlist);
428+ m_enable_way_area = read_style_file (get_options ()-> style , &exlist);
426429
427- m_tagtransform = tagtransform_t::make_tagtransform (&m_options , exlist);
430+ m_tagtransform = tagtransform_t::make_tagtransform (get_options () , exlist);
428431
429432 // for each table
430433 for (size_t i = 0 ; i < t_MAX; ++i) {
@@ -434,7 +437,7 @@ output_pgsql_t::output_pgsql_t(
434437 (i == t_point) ? osmium::item_type::node : osmium::item_type::way);
435438
436439 // figure out what name we are using for this and what type
437- std::string name = m_options. prefix ;
440+ std::string name = get_options ()-> prefix ;
438441 std::string type;
439442 switch (i) {
440443 case t_point:
@@ -459,20 +462,22 @@ output_pgsql_t::output_pgsql_t(
459462 }
460463
461464 m_tables[i] = std::make_unique<table_t >(
462- name, type, columns, m_options.hstore_columns ,
463- m_options.projection ->target_srs (), m_options.append ,
464- m_options.hstore_mode , copy_thread, m_options.output_dbschema );
465+ name, type, columns, get_options ()->hstore_columns ,
466+ get_options ()->projection ->target_srs (), get_options ()->append ,
467+ get_options ()->hstore_mode , copy_thread,
468+ get_options ()->output_dbschema );
465469 }
466470}
467471
468472output_pgsql_t ::output_pgsql_t (
469473 output_pgsql_t const *other, std::shared_ptr<middle_query_t > const &mid,
470474 std::shared_ptr<db_copy_thread_t > const ©_thread)
471- : output_t (mid, other->m_thread_pool, other->m_options ),
475+ : output_t (mid, other->m_thread_pool, * other->get_options () ),
472476 m_tagtransform(other->m_tagtransform->clone ()),
473- m_enable_way_area(other->m_enable_way_area), m_proj(m_options.projection),
474- m_expire(m_options.expire_tiles_zoom, m_options.expire_tiles_max_bbox,
475- m_options.projection),
477+ m_enable_way_area(other->m_enable_way_area),
478+ m_proj(get_options()->projection),
479+ m_expire(get_options()->expire_tiles_zoom,
480+ get_options()->expire_tiles_max_bbox, get_options()->projection),
476481 m_buffer(1024 , osmium::memory::Buffer::auto_grow::yes),
477482 m_rels_buffer(1024 , osmium::memory::Buffer::auto_grow::yes)
478483{
0 commit comments