Changeset 479997a in osmose-backend


Ignore:
Timestamp:
Jan 22, 2013 8:00:42 PM (7 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
a62221f
Parents:
23107f7
git-author:
Frédéric Rodrigo <frodrigo@…> (22/01/2013 19:58:29)
git-committer:
Frédéric Rodrigo <frodrigo@…> (22/01/2013 20:00:42)
Message:

Fix incomplatiple plugin on compatible combination

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/TagRemove_Incompatibles.py

    r4f06076 r479997a  
    2828        Plugin.init(self, logger) 
    2929        self.errors[900] = { "item": 4030, "level": 1, "tag": ["tag"], "desc": {"en": u"Tag conflict", "fr": u"Tag en conflit"} } 
    30         self.CONFLICT1 = set(['aerialway', 'aeroway', 'amenity', 'highway', 'landuse', 'leisure', 'natural', 'railway', 'waterway', 'place']) 
     30        self.CONFLICT = {} 
     31        self.CONFLICT[0] = set(['aerialway', 'aeroway', 'amenity', 'highway', 'leisure', 'railway', 'waterway', 'landuse']) 
     32        self.CONFLICT[1] = set(['aerialway', 'aeroway', 'amenity', 'highway', 'leisure', 'railway', 'waterway', 'natural']) 
     33        self.CONFLICT[2] = set(['aerialway', 'aeroway', 'amenity', 'highway', 'leisure', 'railway', 'waterway', 'place']) 
    3134 
    3235    def node(self, data, tags): 
     
    3740            del tags['railway'] 
    3841            del tags['highway'] 
    39         conflict = set(tags).intersection(self.CONFLICT1) 
    40         if len(conflict) > 1: 
    41             return [(900, 1, {"fr": "Conflit entre les tags %s" % (", ".join(conflict)), "en": "Conflict between tags %s" % (", ".join(conflict))})] 
     42        for i in range(0, len(self.CONFLICT)): 
     43            conflict = set(tags).intersection(self.CONFLICT[i]) 
     44            if len(conflict) > 1: 
     45                return [(900, 1, {"fr": "Conflit entre les tags %s" % (", ".join(conflict)), "en": "Conflict between tags %s" % (", ".join(conflict))})] 
    4246 
    4347        if 'bridge' in tags and 'tunnel' in tags and tags['bridge'] == 'yes' and tags['tunnel'] == 'yes': 
Note: See TracChangeset for help on using the changeset viewer.