Changeset 5d29962 in osmose-backend


Ignore:
Timestamp:
Dec 31, 2012 7:32:01 PM (7 years ago)
Author:
Fred <fred.rodrigo@…>
Branches:
master
Children:
81ea215
Parents:
9b5d50d
Message:

run analyser_osmbin_open_relations over all boundary and multipolygon relations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • analysers/analyser_osmbin_open_relations.py

    rfeccd33 r5d29962  
    6464        self.outxml.startDocument() 
    6565        self.outxml.startElement("analyser", {"timestamp":time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())}) 
    66         self.outxml.startElement("class", {"id":"1", "item":"6010"}) 
     66        self.outxml.startElement("class", {"id":"1", "item":"6010", "level": "1", "tag": "geom,boundary"}) 
     67        self.outxml.startElement("class", {"id":"2", "item":"6010", "level": "2", "tag": "geom"}) 
    6768        self.outxml.Element("classtext", {"lang":"fr", "title":"Relation ouverte"}) 
    6869        self.outxml.Element("classtext", {"lang":"en", "title":"Open relation"}) 
    6970        self.outxml.endElement("class") 
     71        self.classs = {"boundary": "1", "multipolygon": "2"} 
    7072 
    7173    def __del__(self): 
     
    7577    def RelationCreate(self, data): 
    7678 
    77         if data[u"tag"].get(u"boundary", None) <> u"administrative": 
     79        if data[u"tag"].get(u"type", None) != u"boundary" and data[u"tag"].get(u"type", None) != u"multipolygon": 
    7880            return 
    79         if data[u"tag"].get(u"type", None) == u"boundary_segment": 
    80             return 
    81         if data[u"tag"].get(u"type", None) == u"multilinestring": 
    82             return 
     81 
     82        classs = self.classs[data["tag"]["type"]] 
    8383 
    8484        try: 
     
    9696            ndata = self.bin.NodeGet(nid) 
    9797            if ndata: 
    98                 self.outxml.startElement("error", {"class":"1"}) 
     98                self.outxml.startElement("error", {"class":classs}) 
    9999                data["member"] = [] 
    100100                self.outxml.RelationCreate(data) 
Note: See TracChangeset for help on using the changeset viewer.