Skip to content

Commit 2e0d830

Browse files
committed
Refactoring: Remove parameter from filter_rel_member_tags()
The parameter 'allow_typeless' is always false.
1 parent 4460a91 commit 2e0d830

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed

src/tagtransform-c.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -217,26 +217,24 @@ bool c_tagtransform_t::filter_tags(osmium::OSMObject const &o, int *polygon,
217217
bool c_tagtransform_t::filter_rel_member_tags(
218218
taglist_t const &rel_tags, osmium::memory::Buffer const &,
219219
rolelist_t const &, int *make_boundary, int *make_polygon, int *roads,
220-
taglist_t &out_tags, bool allow_typeless)
220+
taglist_t &out_tags)
221221
{
222-
//if it has a relation figure out what kind it is
223222
std::string const *type = rel_tags.get("type");
223+
if (!type) {
224+
return true;
225+
}
226+
224227
bool is_route = false;
225228
bool is_boundary = false;
226229
bool is_multipolygon = false;
227-
if (type) {
228-
//what kind of relation is it
229-
if (*type == "route") {
230-
is_route = true;
231-
} else if (*type == "boundary") {
232-
is_boundary = true;
233-
} else if (*type == "multipolygon") {
234-
is_multipolygon = true;
235-
} else if (!allow_typeless) {
236-
return true;
237-
}
238-
} //you didnt have a type and it was required
239-
else if (!allow_typeless) {
230+
231+
if (*type == "route") {
232+
is_route = true;
233+
} else if (*type == "boundary") {
234+
is_boundary = true;
235+
} else if (*type == "multipolygon") {
236+
is_multipolygon = true;
237+
} else {
240238
return true;
241239
}
242240

src/tagtransform-c.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class c_tagtransform_t : public tagtransform_t
2727
osmium::memory::Buffer const &members,
2828
rolelist_t const &member_roles,
2929
int *make_boundary, int *make_polygon,
30-
int *roads, taglist_t &out_tags,
31-
bool allow_typeless = false) override;
30+
int *roads, taglist_t &out_tags) override;
3231

3332
private:
3433
bool check_key(std::vector<taginfo> const &infos, char const *k,

src/tagtransform-lua.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ bool lua_tagtransform_t::filter_tags(osmium::OSMObject const &o, int *polygon,
151151
bool lua_tagtransform_t::filter_rel_member_tags(
152152
taglist_t const &rel_tags, osmium::memory::Buffer const &members,
153153
rolelist_t const &member_roles, int *make_boundary, int *make_polygon,
154-
int *roads, taglist_t &out_tags, bool)
154+
int *roads, taglist_t &out_tags)
155155
{
156156
size_t const num_members = member_roles.size();
157157
lua_getglobal(L, m_rel_mem_func.c_str());

src/tagtransform-lua.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ class lua_tagtransform_t : public tagtransform_t
3636
osmium::memory::Buffer const &members,
3737
rolelist_t const &member_roles,
3838
int *make_boundary, int *make_polygon,
39-
int *roads, taglist_t &out_tags,
40-
bool allow_typeless = false) override;
39+
int *roads, taglist_t &out_tags) override;
4140

4241
private:
4342
void open_style();

src/tagtransform.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ class tagtransform_t
3636
osmium::memory::Buffer const &members,
3737
rolelist_t const &member_roles,
3838
int *make_boundary, int *make_polygon,
39-
int *roads, taglist_t &out_tags,
40-
bool allow_typeless = false) = 0;
39+
int *roads, taglist_t &out_tags) = 0;
4140
};
4241

4342
#endif // OSM2PGSQL_TAGTRANSFORM_HPP

0 commit comments

Comments
 (0)