diff --git a/diff/process.go b/diff/process.go index 3f7f46f..a77f664 100644 --- a/diff/process.go +++ b/diff/process.go @@ -290,7 +290,11 @@ func Update(oscFile string, geometryLimiter *limit.Limiter, expireor expire.Expi } // insert new relation progress.AddRelations(1) - relations <- rel + // filter out unsupported relation types, otherwise they might + // get inserted with the tags from an outer way + if relTagFilter.Filter(&rel.Tags) { + relations <- rel + } } for wayId, _ := range wayIds { diff --git a/test/complete_db.osc b/test/complete_db.osc index 5f411d2..b3c8c1c 100644 --- a/test/complete_db.osc +++ b/test/complete_db.osc @@ -217,4 +217,12 @@ + + + + + + + + diff --git a/test/complete_db.osm b/test/complete_db.osm index 4839da7..1c84f7c 100644 --- a/test/complete_db.osm +++ b/test/complete_db.osm @@ -1096,4 +1096,18 @@ + + + + + + + + + + + + + + diff --git a/test/complete_db_test.py b/test/complete_db_test.py index a4daa44..5d51b02 100644 --- a/test/complete_db_test.py +++ b/test/complete_db_test.py @@ -484,6 +484,13 @@ def test_no_duplicate_insert(): assert t.query_row(t.db_conf, 'osm_landusages', -201192)['type'] == 'forest' assert t.query_row(t.db_conf, 'osm_roads', 201151)['type'] == 'residential' +def test_unsupported_relation(): + """ + Unsupported relation type is not inserted with update + """ + assert not t.query_row(t.db_conf, 'osm_landusages', -201291) + assert t.query_row(t.db_conf, 'osm_landusages', 201251)['type'] == 'park' + ####################################################################### def test_deploy_and_revert_deploy(): """Revert deploy succeeds"""