previous fix only worked by accident because way and relation ids were the samemaster
parent
fa99248c7a
commit
d3452eafda
|
@ -116,8 +116,10 @@ func (d *Deleter) deleteRelation(id int64, deleteRefs bool, deleteMembers bool)
|
|||
if _, ok := d.deletedWays[member.Id]; ok {
|
||||
continue
|
||||
}
|
||||
if err := d.deleteRelation(member.Id, false, false); err != nil {
|
||||
return err
|
||||
for _, r := range d.diffCache.Ways.Get(member.Id) {
|
||||
if err := d.deleteRelation(r, false, false); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := d.deleteWay(member.Id, false); err != nil {
|
||||
return err
|
||||
|
|
|
@ -190,9 +190,9 @@
|
|||
<create>
|
||||
<node id="201001" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="10"/>
|
||||
<node id="201002" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="11"/>
|
||||
<node id="201003" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="10"/>
|
||||
<node id="201004" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="11"/>
|
||||
<way id="201001" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<node id="201003" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="11"/>
|
||||
<node id="201004" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="10"/>
|
||||
<way id="201051" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<nd ref="201001"/>
|
||||
<nd ref="201002"/>
|
||||
<nd ref="201003"/>
|
||||
|
@ -200,8 +200,8 @@
|
|||
<nd ref="201001"/>
|
||||
<tag k="highway" v="residential"/>
|
||||
</way>
|
||||
<relation id="201001" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201001" role="outer"/>
|
||||
<relation id="201091" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201051" role="outer"/>
|
||||
<tag k="type" v="multipolygon"/>
|
||||
<tag k="landuse" v="park"/>
|
||||
</relation>
|
||||
|
@ -210,8 +210,8 @@
|
|||
<!-- test modification of one relation (201102) does not duplicate
|
||||
relation (201101) with shared way (checks #65) -->
|
||||
<modify>
|
||||
<relation id="201102" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201101" role="outer"/>
|
||||
<relation id="201192" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201151" role="outer"/>
|
||||
<tag k="type" v="multipolygon"/>
|
||||
<tag k="landuse" v="forest"/>
|
||||
</relation>
|
||||
|
|
|
@ -1055,9 +1055,9 @@
|
|||
<!-- test if additional create inserts duplicate elements (checks #66) -->
|
||||
<node id="201001" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="10"/>
|
||||
<node id="201002" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="11"/>
|
||||
<node id="201003" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="10"/>
|
||||
<node id="201004" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="11"/>
|
||||
<way id="201001" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<node id="201003" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="11"/>
|
||||
<node id="201004" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="10"/>
|
||||
<way id="201051" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<nd ref="201001"/>
|
||||
<nd ref="201002"/>
|
||||
<nd ref="201003"/>
|
||||
|
@ -1065,8 +1065,8 @@
|
|||
<nd ref="201001"/>
|
||||
<tag k="highway" v="residential"/>
|
||||
</way>
|
||||
<relation id="201001" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201001" role="outer"/>
|
||||
<relation id="201091" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201051" role="outer"/>
|
||||
<tag k="type" v="multipolygon"/>
|
||||
<tag k="landuse" v="park"/>
|
||||
</relation>
|
||||
|
@ -1075,9 +1075,9 @@
|
|||
relation (201101) with shared way (checks #65) -->
|
||||
<node id="201101" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="10"/>
|
||||
<node id="201102" version="1" timestamp="2011-11-11T00:11:11Z" lat="32" lon="11"/>
|
||||
<node id="201103" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="10"/>
|
||||
<node id="201104" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="11"/>
|
||||
<way id="201101" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<node id="201103" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="11"/>
|
||||
<node id="201104" version="1" timestamp="2011-11-11T00:11:11Z" lat="34" lon="10"/>
|
||||
<way id="201151" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<nd ref="201101"/>
|
||||
<nd ref="201102"/>
|
||||
<nd ref="201103"/>
|
||||
|
@ -1085,13 +1085,13 @@
|
|||
<nd ref="201101"/>
|
||||
<tag k="highway" v="residential"/>
|
||||
</way>
|
||||
<relation id="201101" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201101" role="outer"/>
|
||||
<relation id="201191" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201151" role="outer"/>
|
||||
<tag k="type" v="multipolygon"/>
|
||||
<tag k="landuse" v="park"/>
|
||||
</relation>
|
||||
<relation id="201102" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201101" role="outer"/>
|
||||
<relation id="201192" version="1" timestamp="2011-11-11T00:11:11Z">
|
||||
<member type="way" ref="201151" role="outer"/>
|
||||
<tag k="type" v="multipolygon"/>
|
||||
<tag k="landuse" v="forest"/>
|
||||
</relation>
|
||||
|
|
|
@ -319,9 +319,9 @@ def test_no_duplicates():
|
|||
"""
|
||||
highways = t.query_duplicates(t.db_conf, 'osm_roads')
|
||||
# one duplicate for test_node_way_inserted_twice is expected
|
||||
assert highways == [[18001, 2]]
|
||||
assert highways == [[18001, 2]], highways
|
||||
landusages = t.query_duplicates(t.db_conf, 'osm_landusages')
|
||||
assert not landusages
|
||||
assert not landusages, landusages
|
||||
|
||||
def test_updated_landusage():
|
||||
"""Multipolygon relation was modified"""
|
||||
|
@ -480,9 +480,9 @@ def test_no_duplicate_insert():
|
|||
Relation is not inserted again if a nother relation with the same way was modified
|
||||
Checks #65
|
||||
"""
|
||||
assert t.query_row(t.db_conf, 'osm_landusages', -201101)['type'] == 'park'
|
||||
assert t.query_row(t.db_conf, 'osm_landusages', -201102)['type'] == 'forest'
|
||||
assert t.query_row(t.db_conf, 'osm_roads', 201101)['type'] == 'residential'
|
||||
assert t.query_row(t.db_conf, 'osm_landusages', -201191)['type'] == 'park'
|
||||
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_deploy_and_revert_deploy():
|
||||
|
|
Loading…
Reference in New Issue