do not insert relations with unsupported types during diff import
parent
1b347cde96
commit
4195e24dee
|
@ -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 {
|
||||
|
|
|
@ -217,4 +217,12 @@
|
|||
</relation>
|
||||
</modify>
|
||||
|
||||
<!-- test that relations with unsupported types are not inserted with updates -->
|
||||
<create>
|
||||
<relation id="201291" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201251" role="platform"/>
|
||||
<tag k="type" v="unmapped_relation_type"/>
|
||||
</relation>
|
||||
</create>
|
||||
|
||||
</osmChange>
|
||||
|
|
|
@ -1096,4 +1096,18 @@
|
|||
<tag k="landuse" v="forest"/>
|
||||
</relation>
|
||||
|
||||
<!-- test that relations with unsupported types are not inserted with updates -->
|
||||
<node id="201201" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="20"/>
|
||||
<node id="201202" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="21"/>
|
||||
<node id="201203" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="21"/>
|
||||
<node id="201204" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="20"/>
|
||||
<way id="201251" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<nd ref="201201"/>
|
||||
<nd ref="201202"/>
|
||||
<nd ref="201203"/>
|
||||
<nd ref="201204"/>
|
||||
<nd ref="201201"/>
|
||||
<tag k="landuse" v="park"/>
|
||||
</way>
|
||||
|
||||
</osm>
|
||||
|
|
|
@ -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"""
|
||||
|
|
Loading…
Reference in New Issue