File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -100,20 +100,35 @@ class flex_table_t
100100 // / Does this table take objects of the specified type?
101101 bool matches_type (osmium::item_type type) const noexcept
102102 {
103+ // This table takes any type -> okay
103104 if (m_id_type == osmium::item_type::undefined) {
104105 return true ;
105106 }
107+
108+ // Type and table type match -> okay
106109 if (type == m_id_type) {
107110 return true ;
108111 }
112+
113+ // Relations can be written as linestrings into way tables -> okay
114+ if (type == osmium::item_type::relation &&
115+ m_id_type == osmium::item_type::way) {
116+ return true ;
117+ }
118+
119+ // Area tables can take ways or relations, but not nodes
109120 return m_id_type == osmium::item_type::area &&
110121 type != osmium::item_type::node;
111122 }
112123
113124 // / Map way/node/relation ID to id value used in database table column
114125 osmid_t map_id (osmium::item_type type, osmid_t id) const noexcept
115126 {
116- if (m_id_type == osmium::item_type::area &&
127+ if (m_id_type == osmium::item_type::undefined) {
128+ return id;
129+ }
130+
131+ if (m_id_type != osmium::item_type::relation &&
117132 type == osmium::item_type::relation) {
118133 return -id;
119134 }
You can’t perform that action at this time.
0 commit comments