@@ -28,7 +28,6 @@ output_multi_t::output_multi_t(
2828 export_list.normal_columns (m_osm_type),
2929 m_options.hstore_columns , m_processor->srid (),
3030 m_options.append , m_options.hstore_mode , copy_thread}),
31- ways_done_tracker(new id_tracker{}),
3231 m_expire(m_options.expire_tiles_zoom, m_options.expire_tiles_max_bbox,
3332 m_options.projection),
3433 buffer(1024 , osmium::memory::Buffer::auto_grow::yes),
@@ -44,10 +43,6 @@ output_multi_t::output_multi_t(
4443 m_processor(other->m_processor), m_proj(other->m_proj),
4544 m_osm_type(other->m_osm_type),
4645 m_table(new table_t {*other->m_table , copy_thread}),
47- // NOTE: we need to know which ways were used by relations so each thread
48- // must have a copy of the original marked done ways, its read only so its
49- // ok
50- ways_done_tracker(other->ways_done_tracker),
5146 m_expire(m_options.expire_tiles_zoom, m_options.expire_tiles_max_bbox,
5247 m_options.projection),
5348 buffer(1024 , osmium::memory::Buffer::auto_grow::yes),
@@ -72,50 +67,7 @@ void output_multi_t::start()
7267
7368bool output_multi_t::has_pending () const
7469{
75- return !ways_pending_tracker.empty () || !rels_pending_tracker.empty ();
76- }
77-
78- void output_multi_t::enqueue_ways (pending_queue_t &job_queue, osmid_t id,
79- size_t output_id, size_t &added)
80- {
81- osmid_t const prev = ways_pending_tracker.last_returned ();
82- if (id_tracker::is_valid (prev) && prev >= id) {
83- if (prev > id) {
84- job_queue.push (pending_job_t (id, output_id));
85- }
86- // already done the job
87- return ;
88- }
89-
90- // make sure we get the one passed in
91- if (!ways_done_tracker->is_marked (id) && id_tracker::is_valid (id)) {
92- job_queue.push (pending_job_t (id, output_id));
93- ++added;
94- }
95-
96- // grab the first one or bail if its not valid
97- osmid_t popped = ways_pending_tracker.pop_mark ();
98- if (!id_tracker::is_valid (popped)) {
99- return ;
100- }
101-
102- // get all the ones up to the id that was passed in
103- while (popped < id) {
104- if (!ways_done_tracker->is_marked (popped)) {
105- job_queue.push (pending_job_t (popped, output_id));
106- ++added;
107- }
108- popped = ways_pending_tracker.pop_mark ();
109- }
110-
111- // make sure to get this one as well and move to the next
112- if (popped > id) {
113- if (!ways_done_tracker->is_marked (popped) &&
114- id_tracker::is_valid (popped)) {
115- job_queue.push (pending_job_t (popped, output_id));
116- ++added;
117- }
118- }
70+ return !rels_pending_tracker.empty ();
11971}
12072
12173void output_multi_t::pending_way (osmid_t id, int exists)
@@ -332,15 +284,7 @@ void output_multi_t::process_way(osmium::Way *way)
332284 auto const geom = m_processor->process_way (*way, &m_builder);
333285
334286 if (!geom.empty ()) {
335- // if we are also interested in relations we need to mark
336- // this way pending just in case it shows up in one
337- if (m_processor->interests (geometry_processor::interest_relation)) {
338- ways_pending_tracker.mark (way->id ());
339- } else {
340- // We wouldn't be interested in this as a relation, so no need to mark it pending.
341- // TODO: Does this imply anything for non-multipolygon relations?
342- copy_to_table (way->id (), geom, outtags);
343- }
287+ copy_to_table (way->id (), geom, outtags);
344288 }
345289 }
346290}
0 commit comments