Changeset 02081f1 in osmose-backend


Ignore:
Timestamp:
Oct 19, 2014 7:05:16 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
7ed7144
Parents:
f9744c0
git-author:
Jocelyn Jaubert <jocelyn.jaubert@…> (19/10/2014 19:01:42)
git-committer:
Jocelyn Jaubert <jocelyn.jaubert@…> (19/10/2014 19:05:16)
Message:

Add support for knots in maxspeed in plugin Number

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/Number.py

    r6023684 r02081f1  
    2929        self.errors[3091] = { "item": 3091, "level": 2, "tag": ["value", "fix:chair"], "desc": T_(u"Numerical value") } 
    3030        self.tag_number = ["height", "maxheight", "maxheight:physical", "width", "maxwidth", "length", "maxlength", "maxweight", "maxspeed", "population", "admin_level", "ele"] 
    31         self.Number = re.compile(u"^((?:[0-9]+(?:[.][0-9]+)?)|(?:[.][0-9]+))(?: ?(?:m|ft|cm|km|lbs|tons|t|T|mph))?$") 
     31        self.Number = re.compile(u"^((?:[0-9]+(?:[.][0-9]+)?)|(?:[.][0-9]+))(?: ?(?:m|ft|cm|km|lbs|tons|t|T|mph|knots))?$") 
    3232        self.MaxspeedExtraValue = ["none", "signals", "national", "no", "unposted", "walk", "urban", "variable"] 
    3333        self.MaxspeedClassValue = re.compile(u'^[A-Z]*:.*$') 
     
    6464            self.check_err(a.node(None, {"height":d}), ("height='%s'" % d)) 
    6565 
    66         for d in ["foo", "18kph", "1"]: 
     66        for d in ["foo", "18kph", "1", "30 km/h", "30 c"]: 
    6767            self.check_err(a.node(None, {"maxspeed":d}), ("maxspeed='%s'" % d)) 
    6868 
    69         for d in ["50", "FR:urban"]: 
     69        for d in ["50", "FR:urban", "35 mph", "10 knots"]: 
    7070            assert not a.node(None, {"maxspeed":d}), ("maxspeed='%s'" % d) 
    7171 
Note: See TracChangeset for help on using the changeset viewer.