@@ -57,13 +57,20 @@ void osmdata_t::node(osmium::Node const &node)
5757 m_mid->node (node);
5858
5959 if (node.deleted ()) {
60- node_delete (node.id ());
61- } else {
62- if (m_append) {
63- node_modify (node);
60+ m_output->node_delete (node.id ());
61+ return ;
62+ }
63+
64+ bool const has_tags_or_attrs = m_with_extra_attrs || !node.tags ().empty ();
65+ if (m_append) {
66+ if (has_tags_or_attrs) {
67+ m_output->node_modify (node);
6468 } else {
65- node_add (node);
69+ m_output-> node_delete (node. id () );
6670 }
71+ m_dependency_manager->node_changed (node.id ());
72+ } else if (has_tags_or_attrs) {
73+ m_output->node_add (node);
6774 }
6875}
6976
@@ -78,13 +85,20 @@ void osmdata_t::way(osmium::Way &way)
7885 m_mid->way (way);
7986
8087 if (way.deleted ()) {
81- way_delete (way.id ());
82- } else {
83- if (m_append) {
84- way_modify (&way);
88+ m_output->way_delete (way.id ());
89+ return ;
90+ }
91+
92+ bool const has_tags_or_attrs = m_with_extra_attrs || !way.tags ().empty ();
93+ if (m_append) {
94+ if (has_tags_or_attrs) {
95+ m_output->way_modify (&way);
8596 } else {
86- way_add (& way);
97+ m_output-> way_delete ( way. id () );
8798 }
99+ m_dependency_manager->way_changed (way.id ());
100+ } else if (has_tags_or_attrs) {
101+ m_output->way_add (&way);
88102 }
89103}
90104
@@ -110,70 +124,23 @@ void osmdata_t::relation(osmium::Relation const &rel)
110124 m_mid->relation (rel);
111125
112126 if (rel.deleted ()) {
113- relation_delete (rel.id ());
114- } else {
115- if (m_append) {
116- relation_modify (rel);
117- } else {
118- relation_add (rel);
119- }
120- }
121- }
122-
123- void osmdata_t::after_relations () { m_mid->after_relations (); }
124-
125- void osmdata_t::node_add (osmium::Node const &node) const
126- {
127- if (m_with_extra_attrs || !node.tags ().empty ()) {
128- m_output->node_add (node);
129- }
130- }
131-
132- void osmdata_t::way_add (osmium::Way *way) const
133- {
134- if (m_with_extra_attrs || !way->tags ().empty ()) {
135- m_output->way_add (way);
127+ m_output->relation_delete (rel.id ());
128+ return ;
136129 }
137- }
138130
139- void osmdata_t::relation_add (osmium::Relation const &rel) const
140- {
141- if (m_with_extra_attrs || !rel.tags ().empty ()) {
131+ bool const has_tags_or_attrs = m_with_extra_attrs || !rel.tags ().empty ();
132+ if (m_append) {
133+ if (has_tags_or_attrs) {
134+ m_output->relation_modify (rel);
135+ } else {
136+ m_output->relation_delete (rel.id ());
137+ }
138+ } else if (has_tags_or_attrs) {
142139 m_output->relation_add (rel);
143140 }
144141}
145142
146- void osmdata_t::node_modify (osmium::Node const &node) const
147- {
148- m_output->node_modify (node);
149- m_dependency_manager->node_changed (node.id ());
150- }
151-
152- void osmdata_t::way_modify (osmium::Way *way) const
153- {
154- m_output->way_modify (way);
155- m_dependency_manager->way_changed (way->id ());
156- }
157-
158- void osmdata_t::relation_modify (osmium::Relation const &rel) const
159- {
160- m_output->relation_modify (rel);
161- }
162-
163- void osmdata_t::node_delete (osmid_t id) const
164- {
165- m_output->node_delete (id);
166- }
167-
168- void osmdata_t::way_delete (osmid_t id) const
169- {
170- m_output->way_delete (id);
171- }
172-
173- void osmdata_t::relation_delete (osmid_t id) const
174- {
175- m_output->relation_delete (id);
176- }
143+ void osmdata_t::after_relations () { m_mid->after_relations (); }
177144
178145void osmdata_t::start () const
179146{
0 commit comments