Changeset 1bc20f8 in osmose-backend


Ignore:
Timestamp:
Jul 2, 2014 8:45:07 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
3ff18a2
Parents:
5f697a7 (diff), 26b4711 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'frodrigo/master'

Conflicts:

analysers/analyser_osmosis_relation_associatedStreet.py

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • analysers/analyser_osmosis_relation_associatedStreet.py

    r5f697a7 r6b1955a  
    531531        self.callback50 = lambda res: {"class":5, "subclass":1, "data":[self.node_full, self.relation, self.positionAsText]} 
    532532        self.callback51 = lambda res: {"class":5, "subclass":1, "data":[self.way_full, self.relation, self.positionAsText]} 
    533         self.callbackC2 = lambda res: {"class":12, "subclass":1, "data":[lambda t: self.typeMapping[res[1]], None, self.positionAsText]} 
     533        self.callbackC2 = lambda res: {"class":12, "subclass":1, "data":[lambda t: self.typeMapping[res[1]](t), None, self.positionAsText]} 
    534534 
    535535    def analyser_osmosis(self): 
     
    539539        self.run(sql61) 
    540540        self.run(sql62, lambda res: {"class":6, "subclass":1, 
    541             "data":[lambda t: self.typeMapping[res[1]], None, self.positionAsText], 
     541            "data":[lambda t: self.typeMapping[res[1]](t), None, self.positionAsText], 
    542542            "text":{"fr": u"Multiples numéros \"%s\" dans la voie \"%s\"" % (res[4], res[3]), "en": u"Multiple numbers \"%s\" in way \"%s\"" % (res[4], res[3])} } ) 
    543543        self.run(sql70) 
     
    545545        self.run(sql90) 
    546546        self.run(sqlA0, lambda res: {"class":8, "subclass":1, "data":[self.relation_full, self.relation_full, self.positionAsText]} ) 
    547         self.run(sqlB0, lambda res: {"class":9, "subclass":1, "data":[lambda t: self.typeMapping[res[1]], None, self.positionAsText, self.relation_full]} ) 
     547        self.run(sqlB0, lambda res: {"class":9, "subclass":1, "data":[lambda t: self.typeMapping[res[1]](t), None, self.positionAsText, self.relation_full]} ) 
     548        pass 
    548549 
    549550    def analyser_osmosis_all(self): 
  • merge_data/pitch_FR.mapping.csv

    r3d2b472 r8cbece2  
    898992,Salle de patinage sur roulette,,sport=skating, 
    909093,Salle de raquetball,leisure=pitch,, 
    91 94,Salle de tennis de table,leisure=pitch,, 
     9194,Salle de tennis de table,leisure=pitch,sport=table_tennis, 
    929295,Salle de trampoline,,, 
    939396,Salle de volley ball,leisure=pitch,sport=volleyball, 
     
    155155177,Salle de spectacle / Zenith,,, 
    156156178,Hippodrome,,sport=horse_racing, 
    157 180,Refuge de montagne,amenity=shelter,, 
     157180,Refuge de montagne,amenity=shelter,,tourism=alpine_hut 
    158158181,Boucle de randonnée,,, 
    159159183,Salle ou terrain de paintball,,sport=shooting,type=paintball 
  • plugins/Name_Multiple.py

    r14f8392 r26b4711  
    2121 
    2222from plugins.Plugin import Plugin 
     23import re 
    2324 
    2425 
     
    2930        self.errors[705] = { "item": 5030, "level": 1, "tag": ["name", "fix:survey"], "desc": T_(u"The name tag contains two names") } 
    3031 
    31         import re 
    32         self.Re1 = re.compile(u"^.*;.*$") 
    33         self.Re2 = re.compile(u"^.*/.*$") 
    34         self.Re3 = re.compile(u"^.*\+.+$") 
     32        # In Thailand street added into exisint street are named like บ้านแพะแม่คือ ซอย 5/1 
     33        self.thailand = self.father.config.options.get("country") == 'TH' 
     34        self.thailandRe = re.compile(u"^.*[0-9]/[0-9]+$") 
    3535 
    3636    def way(self, data, tags, nds): 
     
    4040            return 
    4141 
    42         if self.Re1.match(tags["name"]): 
     42        if ';' in tags["name"]: 
    4343            return [(705,0,{"en": "name=%s" % tags["name"]})] 
    44         if self.Re2.match(tags["name"]): 
     44        print self.thailandRe.match(tags["name"]) 
     45        if '/' in tags["name"] and not (self.thailand and self.thailandRe.match(tags["name"])): 
    4546            return [(705,1,{"en": "name=%s" % tags["name"]})] 
    46         if self.Re3.match(tags["name"]): 
     47        if '+' in tags["name"]: 
    4748            return [(705,2,{"en": "name=%s" % tags["name"]})] 
    4849 
     
    5455        TestPluginCommon.setUp(self) 
    5556        self.p = Name_Multiple(None) 
     57        class _config: 
     58            options = {"country": "TH"} 
     59        class father: 
     60            config = _config() 
     61        self.p.father = father() 
    5662        self.p.init(None) 
    5763 
     
    6167        self.check_err(self.p.way(None, {"name": "aueuie + ueuaeuie"}, None)) 
    6268        assert not self.p.way(None, {"name": "aueuie + ueuaeuie", "aeroway": "yes"}, None) 
     69        assert not self.p.way(None, {"name": "บ้านแพะแม่คือ ซอย 5/10"}, None) 
Note: See TracChangeset for help on using the changeset viewer.