Changeset 89cb6e2 in osmose-backend


Ignore:
Timestamp:
Oct 7, 2014 10:40:10 PM (5 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Branches:
master
Children:
1b438a8
Parents:
ae30a2f
Message:

Fix Structural_Restriction id -> ref

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/Structural_Restriction.py

    r6a27639 r89cb6e2  
    3838            for member in members: 
    3939                if member['role'] == 'from': 
    40                     from_.add(member['id']) 
     40                    from_.add(member['ref']) 
    4141                elif member['role'] == 'to': 
    42                     to.add(member['id']) 
     42                    to.add(member['ref']) 
    4343            if from_ == to: 
    4444                return [(31801, 0, {})] 
     
    5353        a.init(None) 
    5454 
    55         assert not a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'id': 1}, {'role': 'to', 'id': 2}]) 
    56         assert not a.relation(None, {'type': 'restriction', 'restriction': 'text'}, [{'role':'from', 'id': 1}, {'role': 'to', 'id': 1}]) 
     55        assert not a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role': 'to', 'ref': 229614650, 'type': 'way'}, {'role': 'via', 'ref': 160840160, 'type': 'way'}, {'role': 'from', 'ref': 229614674, 'type': 'way'}]) 
     56        assert not a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'ref': 1}, {'role': 'to', 'ref': 2}]) 
     57        assert not a.relation(None, {'type': 'restriction', 'restriction': 'text'}, [{'role':'from', 'ref': 1}, {'role': 'to', 'ref': 1}]) 
    5758 
    58         self.check_err(a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'id': 1}, {'role': 'to', 'id': 1}])) 
     59        self.check_err(a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'ref': 1}, {'role': 'to', 'ref': 1}])) 
Note: See TracChangeset for help on using the changeset viewer.