Changeset 74198a2 in osmose-backend


Ignore:
Timestamp:
Oct 13, 2014 8:05:25 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
e8800eb
Parents:
b411839 (diff), 97e6e2f (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 branch 'frodrigo/master'

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • analysers/Analyser_Merge.py

    radecc10 rdd060c2  
    450450                tags = self.tagFactory(res) 
    451451                giscurs.execute(sql02.replace("%(official)s", tableOfficial), { 
    452                     "ref": tags[self.mapping.osmRef] if self.mapping.osmRef != "NULL" else None, 
     452                    "ref": tags.get(self.mapping.osmRef) if self.mapping.osmRef != "NULL" else None, 
    453453                    "tags": tags, 
    454454                    "fields": dict(zip(dict(res).keys(), map(lambda x: unicode(x), dict(res).values()))), 
  • plugins/TagFix_Housenumber.py

    r2bce23c r7149ed9  
    2828        Plugin.init(self, logger) 
    2929        self.errors[10] = { "item": 2060, "level": 3, "tag": ["addr", "fix:survey"], "desc": T_(u"addr:housenumber does not start by a number") } 
     30        self.errors[14] = { "item": 2060, "level": 3, "tag": ["addr", "fix:chair"], "desc": T_(u"On interpolation addr:* go to object with addr:housenumber") } 
     31        self.errors[15] = { "item": 2060, "level": 3, "tag": ["addr", "fix:chair"], "desc": T_(u"Invalid addr:interpolation value") } 
    3032 
    3133    def node(self, data, tags): 
     34        err = [] 
    3235        if "addr:housenumber" in tags and (len(tags["addr:housenumber"]) == 0 or not tags["addr:housenumber"][0].isdigit()): 
    33             return [(10, 1, {})] 
     36            err.append((10, 1, {})) 
     37 
     38        return err 
    3439 
    3540    def way(self, data, tags, nds): 
    36         return self.node(data, tags) 
     41        err = self.node(data, tags) 
     42        interpolation = tags.get("addr:interpolation") 
     43        if interpolation: 
     44            if len(filter(lambda x: x.startswith("addr:") and x != "addr:interpolation", tags.keys())) > 0: 
     45                err.append((11, 1, {})) 
     46            if interpolation not in ('even', 'odd', 'all', 'alphabetic') and not interpolation.isdigit(): 
     47                err.append((12, 1, {})) 
     48 
     49        return err 
    3750 
    3851    def relation(self, data, tags, members): 
     
    5366        assert a.node(None, {"addr:housenumber": ""}) 
    5467        assert a.node(None, {"addr:housenumber": "?"}) 
     68 
     69 
     70        assert a.way(None, {"addr:stret": "Lomlim", "addr:interpolation": "even"}, None) 
     71        assert not a.way(None, {"addr:interpolation": "even"}, None) 
     72        assert not a.way(None, {"addr:interpolation": "4"}, None) 
     73        assert a.way(None, {"addr:interpolation": "invalid"}, None) 
  • plugins/TagFix_MultipleTag.py

    r561ded7 rb2b1452  
    7373            err.append((20801, 0, {})) 
    7474 
    75         if tags.get("area") == "yes" and not (len(key_set & self.area_yes_good) > 0 or ("railway" in tags and tags["railway"] == "platform")): 
    76             err.append((30323, 1001, {"en": u"Bad usage of area=yes. Object can be a surface", "fr": u"Mauvais usage de area=yes. L'objet ne peut pas être une surface"})) 
    77         if tags.get("area") == "yes" and len(set(key_set & self.area_yes_bad)) > 0: 
    78             err.append((30323, 1001, {"en": u"Bad usage of area=yes. Object is already an area by nature", "fr": u"Mauvais usage de area=yes. L'objet est déjà une surface par nature"})) 
     75        if tags.get("area") == "yes": 
     76            if len(set(key_set & self.area_yes_bad)) > 0: 
     77                err.append((30323, 1001, {"en": u"Bad usage of area=yes. Object is already an area by nature", "fr": u"Mauvais usage de area=yes. L'objet est déjà une surface par nature"})) 
     78            elif not (len(key_set & self.area_yes_good) > 0 or ("railway" in tags and tags["railway"] == "platform")): 
     79                err.append((30323, 1001, {"en": u"Bad usage of area=yes. Object can be a surface", "fr": u"Mauvais usage de area=yes. L'objet ne peut pas être une surface"})) 
    7980        if tags.get("area") == "no" and not "aeroway" in tags and not "building" in tags and not "landuse" in tags and not "leisure" in tags and not "natural": 
    8081            err.append((30323, 1002, {"en": u"Bad usage of area=no. Object must be a surface", "fr": u"Mauvais usage de area=no. L'objet doit être une surface"})) 
     
    135136 
    136137        assert a.node(None, {"name": "foo"}) 
     138 
     139        assert not a.way(None, {"name": "foo", "place": "town"}, None) 
     140        assert a.way(None, {"name": "foo", "place": "town", "area": "yes"}, None) 
  • tests/results/sax.test.FR.xml

    r8eed907 r97e6e2f  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <analysers timestamp="2014-10-11T16:33:11Z"> 
    3 <analyser timestamp="2014-10-11T16:33:11Z"> 
     2<analysers timestamp="2014-10-13T17:58:41Z"> 
     3<analyser timestamp="2014-10-13T17:58:41Z"> 
    44<class item="3161" tag="highway,parking,fix:survey" id="31616" level="3"> 
    55<classtext lang="fr" title="parking:condition:[coté] sans parking:lane:[coté]" /> 
     
    110110<classtext lang="pt" title="Tipo do objeto FANTOIR não corresponde a um recurso OSM" /> 
    111111</class> 
    112 <class item="3031" tag="value,wikipedia,fix:chair" id="30317" level="2"> 
    113 <classtext lang="fr" title="Titre Wikipédia identique dans un autre langage" /> 
    114 <classtext lang="en" title="Same wikipedia topic on other language" /> 
    115 <classtext lang="pt" title="Mesmo artigo na wikipedia noutra língua" /> 
     112<class item="2060" tag="addr,fix:chair" id="14" level="3"> 
     113<classtext lang="en" title="On interpolation addr:* go to object with addr:housenumber" /> 
     114</class> 
     115<class item="2060" tag="addr,fix:chair" id="15" level="3"> 
     116<classtext lang="en" title="Invalid addr:interpolation value" /> 
    116117</class> 
    117118<class item="3090" tag="value,fix:chair" id="3090" level="3"> 
     
    336337<classtext lang="en" title="Useless non u-turn restriction, it's forbidden by local law" /> 
    337338<classtext lang="pt" title="A não ser que seja uma não restrição de inversão de marcha, é proibida pela lei local" /> 
     339</class> 
     340<class item="3031" tag="value,wikipedia,fix:chair" id="30317" level="2"> 
     341<classtext lang="fr" title="Titre Wikipédia identique dans un autre langage" /> 
     342<classtext lang="en" title="Same wikipedia topic on other language" /> 
     343<classtext lang="pt" title="Mesmo artigo na wikipedia noutra língua" /> 
    338344</class> 
    339345<class item="4020" tag="highway,roundabout,fix:chair" id="102" level="2"> 
  • tests/results/sax.test.fr.xml

    r8eed907 r97e6e2f  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <analysers timestamp="2014-10-11T16:33:16Z"> 
    3 <analyser timestamp="2014-10-11T16:33:17Z"> 
     2<analysers timestamp="2014-10-13T17:58:46Z"> 
     3<analyser timestamp="2014-10-13T17:58:47Z"> 
    44<class item="3161" tag="highway,parking,fix:survey" id="31616" level="3"> 
    55<classtext lang="fr" title="parking:condition:[coté] sans parking:lane:[coté]" /> 
     
    9292<classtext lang="es" title="addr:housenumber no comienza por un número" /> 
    9393</class> 
    94 <class item="3031" tag="value,wikipedia,fix:chair" id="30317" level="2"> 
    95 <classtext lang="fr" title="Titre Wikipédia identique dans un autre langage" /> 
    96 <classtext lang="en" title="Same wikipedia topic on other language" /> 
    97 <classtext lang="pt" title="Mesmo artigo na wikipedia noutra língua" /> 
     94<class item="2060" tag="addr,fix:chair" id="14" level="3"> 
     95<classtext lang="en" title="On interpolation addr:* go to object with addr:housenumber" /> 
     96</class> 
     97<class item="2060" tag="addr,fix:chair" id="15" level="3"> 
     98<classtext lang="en" title="Invalid addr:interpolation value" /> 
    9899</class> 
    99100<class item="2080" tag="tag,highway,roundabout,fix:chair" id="20800" level="1"> 
     
    129130<classtext lang="pl" title="Wartość numeryczna" /> 
    130131<classtext lang="es" title="Valor numérico" /> 
     132</class> 
     133<class item="3031" tag="value,wikipedia,fix:chair" id="30317" level="2"> 
     134<classtext lang="fr" title="Titre Wikipédia identique dans un autre langage" /> 
     135<classtext lang="en" title="Same wikipedia topic on other language" /> 
     136<classtext lang="pt" title="Mesmo artigo na wikipedia noutra língua" /> 
    131137</class> 
    132138<class item="1050" tag="highway,roundabout,fix:chair" id="1050" level="1"> 
  • tests/results/sax.test.xml

    r8eed907 r97e6e2f  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <analysers timestamp="2014-10-11T16:33:07Z"> 
    3 <analyser timestamp="2014-10-11T16:33:07Z"> 
     2<analysers timestamp="2014-10-13T17:58:37Z"> 
     3<analyser timestamp="2014-10-13T17:58:37Z"> 
    44<class item="3161" tag="highway,parking,fix:survey" id="31616" level="3"> 
    55<classtext lang="fr" title="parking:condition:[coté] sans parking:lane:[coté]" /> 
     
    9292<classtext lang="es" title="addr:housenumber no comienza por un número" /> 
    9393</class> 
    94 <class item="3031" tag="value,wikipedia,fix:chair" id="30317" level="2"> 
    95 <classtext lang="fr" title="Titre Wikipédia identique dans un autre langage" /> 
    96 <classtext lang="en" title="Same wikipedia topic on other language" /> 
    97 <classtext lang="pt" title="Mesmo artigo na wikipedia noutra língua" /> 
     94<class item="2060" tag="addr,fix:chair" id="14" level="3"> 
     95<classtext lang="en" title="On interpolation addr:* go to object with addr:housenumber" /> 
     96</class> 
     97<class item="2060" tag="addr,fix:chair" id="15" level="3"> 
     98<classtext lang="en" title="Invalid addr:interpolation value" /> 
    9899</class> 
    99100<class item="3090" tag="value,fix:chair" id="3090" level="3"> 
     
    119120<classtext lang="pl" title="Wartość numeryczna" /> 
    120121<classtext lang="es" title="Valor numérico" /> 
     122</class> 
     123<class item="3031" tag="value,wikipedia,fix:chair" id="30317" level="2"> 
     124<classtext lang="fr" title="Titre Wikipédia identique dans un autre langage" /> 
     125<classtext lang="en" title="Same wikipedia topic on other language" /> 
     126<classtext lang="pt" title="Mesmo artigo na wikipedia noutra língua" /> 
    121127</class> 
    122128<class item="1050" tag="highway,roundabout,fix:chair" id="1050" level="1"> 
Note: See TracChangeset for help on using the changeset viewer.