Changeset 5242fe8 in osmose-backend


Ignore:
Timestamp:
Jan 15, 2013 8:57:17 PM (7 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
af33a1b1
Parents:
5e4f30c
Message:

Separate errors by admin_level for relation type=boundary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • analysers/analyser_osmbin_open_relations.py

    r5e4f30c r5242fe8  
    6565        self.error_file.begin() 
    6666        self.error_file.analyser() 
    67         self.error_file.classs(1, 6010, 3, ["geom","boundary"], {"fr": "Relation ouverte type=boundary", "en": "Open relation type=boundary"}) 
    68         self.error_file.classs(2, 6010, 3, ["geom"], {"fr": "Relation ouverte type=multipolygon", "en": "Open relation type=multipolygon"}) 
     67        self.error_file.classs(1, 6010, 3, ["geom","boundary"], 
     68                               {"fr": "Relation ouverte type=boundary", 
     69                                "en": "Open relation type=boundary"}) 
     70        self.error_file.classs(2, 6010, 3, ["geom"], 
     71                               {"fr": "Relation ouverte type=multipolygon", 
     72                                "en": "Open relation type=multipolygon"}) 
     73        for admin_level in xrange(0, 15): 
     74            self.error_file.classs(100 + admin_level, 6010, 3, ["geom","boundary"], 
     75                                   {"fr": "Relation ouverte type=boundary admin_level=%d" % admin_level, 
     76                                    "en": "Open relation type=boundary admin_level=%d" % admin_level}) 
     77 
    6978        self.classs = {"boundary": 1, "multipolygon": 2} 
    7079 
     
    7887            return 
    7988 
    80         classs = self.classs[data["tag"]["type"]] 
    81  
    8289        try: 
    8390            ways = get_ways(data["id"], self.bin) 
     
    9097 
    9198        bnds = ways_bounds(ways) 
     99 
     100        classs = self.classs[data["tag"]["type"]] 
     101 
     102        if "admin_level" in data["tag"]: 
     103            try: 
     104                admin_level = int(data["tag"]["admin_level"]) 
     105                if admin_level >= 0 and admin_level < 15: 
     106                    classs = 100 + admin_level 
     107            except: 
     108                pass 
    92109 
    93110        for nid, cpt in bnds: 
Note: See TracChangeset for help on using the changeset viewer.