Changeset 12b54e7 in osmose-backend


Ignore:
Timestamp:
May 26, 2013 10:35:54 PM (6 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
3821411
Parents:
20ca776
git-author:
Frédéric Rodrigo <frodrigo@…> (24/05/2013 22:14:26)
git-committer:
Frédéric Rodrigo <frodrigo@…> (26/05/2013 22:35:54)
Message:

Add power line kind detection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/TagFix_MultipleTag.py

    r6e28851 r12b54e7  
    3434        self.errors[71301] = { "item": 7130, "level": 3, "tag": ["tag", "highway", "maxheight"], "desc": {"en": u"Mising maxheight tag", "fr": u"Manque le tag maxheight"} } 
    3535        self.errors[1050] = { "item": 1050, "level": 1, "tag": ["highway", "roundabout"], "desc": {"fr":"Rond-point à l'envers", "en":"Reverse roundabout"} } 
     36        self.errors[70401] = { "item": 7040, "level": 2, "tag": ["tag", "power"], "desc": {"en": u"Bad power line kind", "fr": u"Mauvais type de ligne"} } 
    3637        self.driving_side_right = not(self.father.config.options.get("driving_side") == "left") 
    3738        self.driving_direction = "anticlockwise" if self.driving_side_right else "clockwise" 
     
    7778            err.append((71301, 0, {})) 
    7879 
     80        if "power" in tags and tags["power"] in ("line", "minor_line") and "voltage" in tags: 
     81            voltage = max(map(int, filter(lambda x: x.isdigit(), map(lambda x: x.strip(), tags["voltage"].split(";"))))) 
     82            print voltage 
     83            if voltage > 45000 and tags["power"] == "minor_line": 
     84                err.append((70401, 0, {"fix": {"~": {"power": "line"}}})) 
     85            elif voltage <= 45000 and tags["power"] == "line": 
     86                err.append((70401, 1, {"fix": {"~": {"power": "minor_line"}}})) 
     87 
    7988        return err 
    8089 
     
    99108    if a.way(None, {"highway":"", "cycleway": "opposite", "oneway": "yes"}, None): 
    100109        print "fail" 
    101     if not a.way(None, {"highway":"", "tunnel": "yes"}, None): 
    102         print "fail" 
     110    if not a.way(None, {"highway":"primary", "tunnel": "yes"}, None): 
     111        print "fail3" 
     112    if not a.way(None, {"power":"line", "voltage": "1"}, None): 
     113        print "fail4" 
Note: See TracChangeset for help on using the changeset viewer.