Changeset 19119eb in osmose-backend


Ignore:
Timestamp:
May 26, 2013 10:35:55 PM (6 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
e166177
Parents:
e62d4bb
git-author:
Frédéric Rodrigo <frodrigo@…> (26/05/2013 20:52:34)
git-committer:
Frédéric Rodrigo <frodrigo@…> (26/05/2013 22:35:55)
Message:

Detect invalid reference in plugin TagFix_MultipleTag_FR

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/TagFix_MultipleTag_FR.py

    rd849641 r19119eb  
    2121 
    2222from plugins.Plugin import Plugin 
     23import re 
    2324 
    2425 
     
    3233        self.errors[50201] = { "item": 5020, "level": 2, "tag": ["tag", "name"], "desc": {"fr": u"Nom à améliorer depuis le cadastre"} } 
    3334        self.errors[30324] = { "item": 3032, "level": 2, "tag": ["highway", "maxspeed"], "desc": {"fr": u"maxspeed incohérent", "en": u"incoherent maxspeed"} } 
     35        self.errors[30325] = { "item": 3032, "level": 2, "tag": ["highway", "ref"], "desc": {"fr": u"Référence invalide", "en": u"Invalid reference"} } 
    3436 
    3537        self.school = { 
     
    4143            "secondaire": "secondaire", 
    4244        } 
     45        self.Ref = re.compile(u"^([ANDMC]|RN|RD|VC|CR|CE)[- ]?[0-9]", re.IGNORECASE) 
    4346 
    4447    def node(self, data, tags): 
     
    7376                    err.append((30324, 4, {"fr": "Une Zone 30 est limité à 30 km/h"})) 
    7477 
     78        if "highway" in tags and "ref" in tags and not self.Ref.match(tags["ref"]): 
     79            err.append((30325, 4, {"en": tags["ref"]})) 
     80 
    7581        return err 
    7682 
     
    8894    if not a.node(None, {"name":"Chemin Rural dit de la Borne Trouée"}): 
    8995        print "nofail 2" 
     96    if not a.node(None, {"highway":"e", "ref": "3"}): 
     97        print "nofail 3" 
Note: See TracChangeset for help on using the changeset viewer.