Skip to content

Commit 66e3db3

Browse files
committed
Again: ignore relations with more than 32k members
Reintroduce fix from 8763ce9 which got moved to the wrong place in some refactoring. > There is a hard restriction in the pgsql middle tables, where > relation members are indexed using a smallint. To remain > consistent, drop all relations which exceed this size. Fixes #1607
1 parent a55eacd commit 66e3db3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/osmdata.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ void osmdata_t::after_ways() { m_mid->after_ways(); }
8888

8989
void osmdata_t::relation(osmium::Relation const &rel)
9090
{
91+
if (rel.members().size() > 32767) {
92+
log_warn(
93+
"Relation id {} ignored, because it has more than 32767 members",
94+
rel.id());
95+
return;
96+
}
97+
9198
if (m_append && !rel.deleted()) {
9299
m_output->select_relation_members(rel.id());
93100
}
@@ -97,9 +104,6 @@ void osmdata_t::relation(osmium::Relation const &rel)
97104
if (rel.deleted()) {
98105
relation_delete(rel.id());
99106
} else {
100-
if (rel.members().size() > 32767) {
101-
return;
102-
}
103107
if (m_append) {
104108
relation_modify(rel);
105109
} else {

0 commit comments

Comments
 (0)