@@ -101,8 +101,7 @@ std::unique_ptr<tagtransform_t> c_tagtransform_t::clone() const
101101}
102102
103103bool c_tagtransform_t::check_key (std::vector<taginfo> const &infos,
104- char const *k, bool *filter, int *flags,
105- bool strict)
104+ char const *k, bool *filter, int *flags)
106105{
107106 // go through the actual tags found on the item and keep the ones in the export list
108107 for (auto const &info : infos) {
@@ -119,29 +118,26 @@ bool c_tagtransform_t::check_key(std::vector<taginfo> const &infos,
119118 }
120119
121120 // if we didn't find any tags that we wanted to export
122- // and we aren't strictly adhering to the list
123- if (!strict) {
124- if (m_options->hstore_mode != hstore_column::none) {
125- /* ... but if hstore_match_only is set then don't take this
121+ if (m_options->hstore_mode != hstore_column::none) {
122+ /* ... but if hstore_match_only is set then don't take this
126123 as a reason for keeping the object */
127- if (!m_options->hstore_match_only ) {
128- *filter = false ;
129- }
130- /* with hstore, copy all tags... */
131- return true ;
124+ if (!m_options->hstore_match_only ) {
125+ *filter = false ;
132126 }
127+ /* with hstore, copy all tags... */
128+ return true ;
129+ }
133130
134- if (!m_options->hstore_columns .empty ()) {
135- /* does this column match any of the hstore column prefixes? */
136- for (auto const &column : m_options->hstore_columns ) {
137- if (boost::starts_with (k, column)) {
138- /* ... but if hstore_match_only is set then don't take this
131+ if (!m_options->hstore_columns .empty ()) {
132+ /* does this column match any of the hstore column prefixes? */
133+ for (auto const &column : m_options->hstore_columns ) {
134+ if (boost::starts_with (k, column)) {
135+ /* ... but if hstore_match_only is set then don't take this
139136 as a reason for keeping the object */
140- if (!m_options->hstore_match_only ) {
141- *filter = false ;
142- }
143- return true ;
137+ if (!m_options->hstore_match_only ) {
138+ *filter = false ;
144139 }
140+ return true ;
145141 }
146142 }
147143 }
@@ -150,7 +146,7 @@ bool c_tagtransform_t::check_key(std::vector<taginfo> const &infos,
150146}
151147
152148bool c_tagtransform_t::filter_tags (osmium::OSMObject const &o, int *polygon,
153- int *roads, taglist_t &out_tags, bool strict )
149+ int *roads, taglist_t &out_tags)
154150{
155151 // assume we dont like this set of tags
156152 bool filter = true ;
@@ -170,27 +166,25 @@ bool c_tagtransform_t::filter_tags(osmium::OSMObject const &o, int *polygon,
170166 for (auto const &item : o.tags ()) {
171167 char const *const k = item.key ();
172168 char const *const v = item.value ();
173- // if we want to do more than the export list says
174- if (!strict) {
175- if (o.type () == osmium::item_type::relation &&
176- std::strcmp (" type" , k) == 0 ) {
177- out_tags.add_tag (k, v);
169+
170+ if (o.type () == osmium::item_type::relation &&
171+ std::strcmp (" type" , k) == 0 ) {
172+ out_tags.add_tag (k, v);
173+ continue ;
174+ }
175+ /* Allow named islands to appear as polygons */
176+ if (std::strcmp (" natural" , k) == 0 &&
177+ std::strcmp (" coastline" , v) == 0 ) {
178+ add_area_tag = 1 ;
179+
180+ /* Discard natural=coastline tags (we render these from a shapefile instead) */
181+ if (!m_options->keep_coastlines ) {
178182 continue ;
179183 }
180- /* Allow named islands to appear as polygons */
181- if (std::strcmp (" natural" , k) == 0 &&
182- std::strcmp (" coastline" , v) == 0 ) {
183- add_area_tag = 1 ;
184-
185- /* Discard natural=coastline tags (we render these from a shapefile instead) */
186- if (!m_options->keep_coastlines ) {
187- continue ;
188- }
189- }
190184 }
191185
192186 // go through the actual tags found on the item and keep the ones in the export list
193- if (check_key (infos, k, &filter, &flags, strict )) {
187+ if (check_key (infos, k, &filter, &flags)) {
194188 out_tags.add_tag (k, v);
195189 }
196190 }
0 commit comments