Ejemplo n.º 1
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[3140] = {"item": 3140, "level": 2, "tag": ["tag"], "desc": {"en": u"Object taggin type", "fr": u"Type d'objet pour un tag"} }

        # Taginfo wiki extract database
        # http://taginfo.openstreetmap.org/download/taginfo-wiki.db.bz2
        con = lite.connect('taginfo-wiki.db')

        with con:
            cur = con.cursor()
            cur.execute("select tag, on_node, on_way, on_area, on_relation from wikipages where lang='en' and (on_node or on_way or on_area or on_relation)")
            rows = cur.fetchall()

            self.tag_supported = set()
            self.tag_node = set()
            self.tag_way = set()
            self.tag_area = set()
            self.tag_relation = set()
            for row in rows:
                if not "=" in row[0]:
                    self.tag_supported.add(row[0])
                    if row[1]:
                        self.tag_node.add(row[0])
                    if row[2]:
                        self.tag_way.add(row[0])
                    if row[3]:
                        self.tag_area.add(row[0])
                    if row[4]:
                        self.tag_relation.add(row[0])
Ejemplo n.º 2
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[2070] = {"item": 2070, "level": 2, "tag": ["tag", "fix:chair"], "desc": T_(u"Missing tag by cooccurrence") }

        bdd = update_cache("http://taginfo.openstreetmap.org/download/taginfo-db.db.bz2", 30, bz2_decompress=True)

        if not os.path.exists(bdd):
            self.info = {}
            for type in ['nodes', 'ways', 'relations']:
                self.info[type] = {}
            return

        # Taginfo wiki extract database
        con = sqlite3.connect(bdd)

        with con:
            cur = con.cursor()
            cur.execute(sql01)
            self.info = {}
            for type in ['nodes', 'ways', 'relations']:
                cur.execute(sql02 % {'type':'nodes'})
                rows = cur.fetchall()
                info = {}
                for row in rows:
                    if row[1] in info:
                        info[row[1]].append(row)
                    else:
                         info[row[1]] = [row]
                self.info[type] = info
Ejemplo n.º 3
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.Language = self.father.config.options.get("language")
        if not self.Language:
            # no language
            return False
        if not isinstance(self.Language,
                          basestring) and len(self.Language) != 1:
            # more than one language
            return False  # Checked by Name_Multilingual

        if not isinstance(self.Language, basestring):
            self.Language = None

        self.errors[50601] = {
            "item": 5060,
            "level": 1,
            "tag": ["name", "fix:chair"],
            "desc": T_(u"Default and local language name not the same")
        }
        self.errors[50602] = {
            "item": 5060,
            "level": 1,
            "tag": ["name", "fix:chair"],
            "desc": T_(u"Local language name without default name")
        }
        self.errors[50603] = {
            "item": 5060,
            "level": 1,
            "tag": ["name", "fix:chair"],
            "desc": T_(u"Language name without default name")
        }

        self.Language = self.father.config.options.get("language")
        self.LocalName = re.compile("^name:[a-z][a-z](_.*$|$)")
    def init(self, logger):
        """
        Chargement du dictionnaires des noms de communes de l'INSEE
        """
        Plugin.init(self, logger)
        self.errors[800] = {
            "item": 6030,
            "level": 1,
            "tag": ["place", "fix:survey"],
            "desc": T_(u"Place node without name tag")
        }
        self.errors[801] = {
            "item": 6040,
            "level": 1,
            "tag": ["place", "fix:chair"],
            "desc": T_(u"INSEE code cannot be found in INSEE database")
        }
        self.errors[802] = {
            "item": 6040,
            "level": 1,
            "tag": ["place", "fix:chair"],
            "desc": T_(u"Municipality name does not match INSEE code")
        }

        lst = self.father.ToolsReadList("dictionaries/FR/BddCommunes")
        self.communeNameIndexedByInsee = {}

        for x in lst:
            x = x.split("\t")
            code_insee = x[0]
            name_insee = x[1]
            self.communeNameIndexedByInsee[code_insee] = name_insee
Ejemplo n.º 5
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[103] = self.def_class(
            item=1010,
            level=2,
            tags=['geom', 'fix:chair'],
            title=T_('Duplicated nodes'),
            detail=T_('''A path passes several times by the same node.'''),
            fix=T_('''There are several types of issues:

* A way that makes one or more loops; the way must be split into several
sections.
* A path that goes back on itself (often at one end); the path must be
cut to isolate the wrong section and recreated properly afterwards.

There are certainly many other cases. In general, it is better to make
several roads / areas than a single complex one so that tools working
with OSM data can function properly.'''),
            trap=T_(
                '''These errors require a good command of your editing tool. Some
corrections are not necessarily intuitive.'''),
            example=T_(
                '''![](https://wiki.openstreetmap.org/w/images/5/5a/Osmose-eg-error-1010.png)

Double polygon connected by a string to remove.'''))
Ejemplo n.º 6
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[30310] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Not a Wikipedia URL"),
        }
        self.errors[30311] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Wikipedia URL instead of article title"),
        }
        self.errors[30312] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Missing Wikipedia language before article title"),
        }
        self.errors[30313] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Use human Wikipedia page title"),
        }
        self.errors[30314] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Missing primary Wikipedia tag"),
        }
        self.errors[30315] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Invalid wikipedia suffix"),
        }
        self.errors[30316] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Duplicate wikipedia tag as suffix and prefix"),
        }
        self.errors[30317] = {
            "item": 3031,
            "level": 2,
            "tag": ["value", "wikipedia", "fix:chair"],
            "desc": T_(u"Same wikipedia topic on other language"),
        }

        import re

        self.wiki_regexp = re.compile(u"(https?://)?([^\.]+)\.wikipedia.+/wiki/(.+)")
        self.lang_regexp = re.compile(u"[-a-z]+:.*")
        self.lang_restriction_regexp = re.compile(u"^[a-z]{2}$")

        self.Language = self.father.config.options.get("language")
        if not isinstance(self.Language, basestring):
            self.Language = None
Ejemplo n.º 7
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[50705] = self.def_class(
         item=5070,
         level=2,
         tags=['name', 'fix:chair'],
         title=T_('Unexpected punctuation in name'))
Ejemplo n.º 8
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[703] = { "item": 5010, "level": 2, "tag": ["name", "fix:chair"], "desc": T_(u"Word not found in dictionary") }
        self.errors[704] = { "item": 5010, "level": 1, "tag": ["value", "fix:chair"], "desc": T_(u"Encoding problem") }

        self.DictKnownWords = [""]
        self.DictCorrections = {}
        self.DictUnknownWords = []
        self.DictCommonWords = [""]
        self.DictEncoding = {}
        self.apostrophe = None

        self.init_dictionaries()

        # Inconsistencies: words and dict and bad dict
        #self.LogInformation(u"Mot(s) à corriger et à accepter")
        #for k in self.DictCorrectionsK:
        #    if k in self.DictKnownWords:
        #        self.DictKnownWords.remove(k)
        #        self.LogInformation(u"  " + k)

        # Inconsistencies:
        #self.LogInformation(u"Correction(s) absentes du dictionnaire")
        #for k in self.DictCorrectionsK:
        #    for v in self.DictCorrections[k].split("|"):
        #        if v not in self.DictKnownWords:
        #            self.LogInformation(u"  " + k + " => " + self.DictCorrections[k])
        #            self.DictCorrectionsK.remove(k)
        #            self.DictCorrections.pop(k)
        #            break

        self.DictKnownWords = set(self.DictKnownWords)
        self.DictUnknownWords = set(self.DictUnknownWords)
    def init(self, logger):
        Plugin.init(self, logger)
        tags = capture_tags = {}
        self.errors[50109001] = {'item': 5010, 'level': 2, 'tag': mapcss.list_(u'name', u'fix:chair'), 'desc': mapcss.tr(u'Arabic letter detected in Farsi name')}

        self.re_4234bf3b = re.compile(r'ك')
        self.re_5eeade1c = re.compile(r'ي')
Ejemplo n.º 10
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[50604] = { "item": 5060, "level": 1, "tag": ["name", "fix:chair"], "desc": T_(u"Default and local language name not the same") }
        self.errors[50605] = { "item": 5060, "level": 1, "tag": ["name", "fix:chair"], "desc": T_(u"Local language name without default name") }
        self.errors[50606] = { "item": 5060, "level": 1, "tag": ["name", "fix:chair"], "desc": T_(u"Language name without default name") }

        self.LocalName = re.compile("^name:[a-z][a-z](_.*$|$)")
Ejemplo n.º 11
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[4010] = {"item": 4010, "level": 2, "tag": ["deprecated", "tag", "fix:chair"], "desc": T_(u"Deprecated tag") }
        self.errors[40102] = {"item": 4010, "level": 2, "tag": ["deprecated", "value", "fix:chair"], "desc": T_(u"Deprecated value") }

        self.Deprecated = self.deprecated_list()
        self.DeprecatedSet = set(self.Deprecated)
Ejemplo n.º 12
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[705] = {
            "item": 5030,
            "level": 1,
            "tag": ["name", "fix:survey"],
            "desc": T_(u"The name tag contains two names")
        }

        self.NoExtra = False
        self.HighwayOnly = False
        self.streetSubNumber = False
        if self.father.config.options.get("country"):
            self.NoExtra = any(
                map(
                    lambda c: self.father.config.options.get("country").
                    startswith(c), ['DE', 'US', 'CA']))

            self.HighwayOnly = self.father.config.options.get(
                "country").startswith('BY')

            # In Thailand street added into existing street are named like "บ้านแพะแม่คือ ซอย 5/1"
            self.streetSubNumber = any(
                map(
                    lambda c: self.father.config.options.get("country").
                    startswith(c), ['TH', 'VN', 'MY']))

        self.streetSubNumberRe = re.compile(
            u".*[0-9๐๑๒๓๔๕๖๗๘๙]/[0-9๐๑๒๓๔๕๖๗๘๙].*")
Ejemplo n.º 13
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[30320] = { "item": 3032, "level": 1, "tag": ["tag", "highway", "fix:chair"], "desc": T_(u"Watch multiple tags") }
        self.errors[30323] = { "item": 3032, "level": 3, "tag": ["tag", "fix:chair"], "desc": T_(u"Watch multiple tags") }
        self.errors[30327] = { "item": 3032, "level": 2, "tag": ["tag", "fix:chair"], "desc": T_(u"Waterway with level") }
        self.errors[20800] = { "item": 2080, "level": 1, "tag": ["tag", "highway", "roundabout", "fix:chair"], "desc": T_(u"Tag highway missing on junction") }
        self.errors[20801] = { "item": 2080, "level": 1, "tag": ["tag", "highway", "fix:chair"], "desc": T_(u"Tag highway missing on oneway") }
        self.errors[20803] = { "item": 2080, "level": 2, "tag": ["tag", "highway", "fix:chair"], "desc": T_(u"Tag highway missing for tracktype or lanes") }
        self.errors[71301] = { "item": 7130, "level": 3, "tag": ["tag", "highway", "maxheight", "fix:survey"], "desc": T_(u"Missing maxheight tag") }
        self.errors[21101] = { "item": 2110, "level": 2, "tag": ["tag"], "desc": T_(u"Name present but missing main tag") }
        self.errors[21102] = { "item": 2110, "level": 2, "tag": ["tag"], "desc": T_(u"Missing relation type") }
        self.errors[1050] = { "item": 1050, "level": 1, "tag": ["highway", "roundabout", "fix:chair"], "desc": T_(u"Reverse roundabout") }
        self.errors[40201] = { "item": 4020, "level": 1, "tag": ["highway", "roundabout"], "desc": T_(u"Roundabout as area") }
        self.errors[21201] = { "item": 2120, "level": 3, "tag": ["indoor"], "desc": T_(u"Level or repeat_on tag missing") }
        self.errors[21202] = { "item": 2120, "level": 3, "tag": ["indoor"], "desc": T_(u"Indoor or buildingpart tag missing") }
        self.errors[20802] = { "item": 2080, "level": 2, "tag": ["highway"], "desc": T_(u"Missing tag ref for emergency access point") }
#        self.errors[70401] = { "item": 7040, "level": 2, "tag": ["tag", "power", "fix:chair"], "desc": T_(u"Bad power line kind") }
        self.errors[32200] = { "item": 3220, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"access=yes|permissive allow all transport modes") }
        self.errors[32201] = { "item": 3220, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"access=yes|permissive allow all transport modes") }
        self.errors[32301] = { "item": 3230, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Probably only for bottles, not any type of glass") }
        self.errors[32302] = { "item": 3230, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Suspicious name for a container") }
        self.driving_side_right = not(self.father.config.options.get("driving_side") == "left")
        self.driving_direction = "anticlockwise" if self.driving_side_right else "clockwise"
        name_parent = []
        for i in ('type', 'aerialway', 'aeroway', 'amenity', 'barrier', 'boundary', 'building', 'craft', 'entrance', 'emergency', 'geological', 'highway', 'historic', 'landuse', 'leisure', 'man_made', 'military', 'natural', 'office', 'place', 'power', 'public_transport', 'railway', 'route', 'shop', 'sport', 'tourism', 'waterway', 'mountain_pass', 'traffic_sign', 'mountain_pass', 'golf', 'piste:type', 'junction', 'healthcare', 'health_facility:type', 'indoor'):
            name_parent.append(i)
            name_parent.append("disused:" + i)
            name_parent.append("abandoned:" + i)
        self.name_parent = set(name_parent)
Ejemplo n.º 14
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[3140] = self.def_class(item=3140,
                                           level=2,
                                           tags=['tag'],
                                           title=T_('Object taggin type'))

        # Taginfo wiki extract database
        # http://taginfo.openstreetmap.org/download/taginfo-wiki.db.bz2
        con = lite.connect('taginfo-wiki.db')

        with con:
            cur = con.cursor()
            cur.execute(
                "select tag, on_node, on_way, on_area, on_relation from wikipages where lang='en' and (on_node or on_way or on_area or on_relation)"
            )
            rows = cur.fetchall()

            self.tag_supported = set()
            self.tag_node = set()
            self.tag_way = set()
            self.tag_area = set()
            self.tag_relation = set()
            for row in rows:
                if not "=" in row[0]:
                    self.tag_supported.add(row[0])
                    if row[1]:
                        self.tag_node.add(row[0])
                    if row[2]:
                        self.tag_way.add(row[0])
                    if row[3]:
                        self.tag_area.add(row[0])
                    if row[4]:
                        self.tag_relation.add(row[0])
Ejemplo n.º 15
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[32601] = self.def_class(
         item=3260,
         level=3,
         tags=['ref', 'fix:chair'],
         title=T_('Invalid value format of tag `ref:vatin`'))
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[11701] = {
         "item": 1170,
         "level": 2,
         "tag": ["relation", "multipolygon", "fix:chair"],
         "desc": T_(u"Inadequate role for multipolygon")
     }
     self.errors[11702] = {
         "item": 1170,
         "level": 2,
         "tag": ["relation", "multipolygon", "fix:chair"],
         "desc": T_(u"Inadequate member for multipolygon")
     }
     self.errors[11703] = {
         "item": 1170,
         "level": 1,
         "tag": ["relation", "multipolygon", "fix:imagery"],
         "desc": T_(u"Missing outer role for multipolygon")
     }
     self.errors[11704] = {
         "item": 1170,
         "level": 3,
         "tag": ["relation", "multipolygon", "fix:chair"],
         "desc": T_(u"This multipolygon is a simple polygon")
     }
Ejemplo n.º 17
0
    def init(self, logger):
        Plugin.init(self, logger)
        if self.father.config.options.get("project") != 'openstreetmap':
            return False
        self.errors[31901] = {
            "item": 3190,
            "level": 3,
            "tag": ["postcode", "fix:chair"],
            "desc": T_(u"Invalid postcode")
        }

        self.Country = None
        if self.father.config.options.get("country"):
            self.Country = self.father.config.options.get("country")
        self.CountryPostcodeArea = None
        self.CountryPostcodeStreet = None
        if not self.Country or self.Country == 'GB':  # Specific plugin for GB
            return
        postcode = self.list_postcode()
        if self.Country in postcode:
            if 'area' in postcode[self.Country] and postcode[
                    self.Country]['area'] is not None:
                self.CountryPostcodeArea = re.compile(
                    postcode[self.Country]['area'])
            if 'street' in postcode[self.Country] and postcode[
                    self.Country]['street'] is not None:
                self.CountryPostcodeStreet = re.compile(
                    postcode[self.Country]['street'])
            elif 'area' in postcode[self.Country] and postcode[
                    self.Country]['area'] is not None:
                self.CountryPostcodeStreet = self.CountryPostcodeArea
Ejemplo n.º 18
0
    def init(self, logger):
        Plugin.init(self, logger)
        if self.father.config.options.get("project") != 'openstreetmap':
            return False
        self.errors[31901] = self.def_class(
            item=3190,
            level=3,
            tags=['postcode', 'fix:chair'],
            title=T_('Invalid postcode'),
            detail=T_('''Check postcode as decribed on
[Wikipedia](https://en.wikipedia.org/wiki/List_of_postal_codes)'''),
            resource='https://en.wikipedia.org/wiki/List_of_postal_codes')

        self.Country = None
        if self.father.config.options.get("country"):
            self.Country = self.father.config.options.get("country")
        self.CountryPostcodeArea = None
        self.CountryPostcodeStreet = None
        if not self.Country or self.Country == 'GB':  # Specific plugin for GB
            return
        postcode = self.list_postcode()
        if self.Country in postcode:
            if 'street' in postcode[self.Country] and postcode[
                    self.Country]['street'] is not None:
                self.CountryPostcodeStreet = re.compile(
                    postcode[self.Country]['street'])
            if 'area' in postcode[self.Country]:
                self.CountryPostcodeArea = re.compile(
                    postcode[self.Country]['area'])
                if 'street' not in postcode[self.Country]:
                    self.CountryPostcodeStreet = self.CountryPostcodeArea
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[11701] = self.def_class(
         item=1170,
         level=2,
         tags=['relation', 'multipolygon', 'fix:chair'],
         title=T_('Inadequate role for multipolygon'),
         detail=T_(
             '''Possible roles are `outer`, `inner` or nothing (not recommended).'''
         ))
     self.errors[11702] = self.def_class(
         item=1170,
         level=2,
         tags=['relation', 'multipolygon', 'fix:chair'],
         title=T_('Inadequate member for multipolygon'),
         detail=T_('''Members must be ways.'''))
     self.errors[11703] = self.def_class(
         item=1170,
         level=1,
         tags=['relation', 'multipolygon', 'fix:imagery'],
         title=T_('Missing outer role for multipolygon'),
         detail=T_('''At least one outer ring must be present.'''),
         fix=T_(
             '''Find the way outside, it may be deleted, check the history.'''
         ))
     self.errors[11704] = self.def_class(
         item=1170,
         level=3,
         tags=['relation', 'multipolygon', 'fix:chair'],
         title=T_('This multipolygon is a simple polygon'),
         detail=T_(
             '''Multipolygon relation actually defines a simple polygon.''')
     )
Ejemplo n.º 20
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[3120] = {"item": 3120, "level": 3, "tag": ["natural", "fix:imagery"], "desc": T_(u"Tree tagging") }

        self.Tree = {}
        self.liste_des_arbres_fruitiers()
        self.liste_des_essences_europennes()
Ejemplo n.º 21
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[703] = { "item": 5010, "level": 2, "tag": ["name", "fix:chair"], "desc": T_(u"Word not found in dictionary") }
        self.errors[704] = { "item": 5010, "level": 1, "tag": ["value", "fix:chair"], "desc": T_(u"Encoding problem") }

        self.DictKnownWords = [""]
        self.DictCorrections = {}
        self.DictUnknownWords = []
        self.DictCommonWords = [""]
        self.DictEncoding = {}
        self.apostrophe = None

        self.init_dictionaries()

        # Inconsistencies: words and dict and bad dict
        #self.LogInformation(u"Mot(s) à corriger et à accepter")
        #for k in self.DictCorrectionsK:
        #    if k in self.DictKnownWords:
        #        self.DictKnownWords.remove(k)
        #        self.LogInformation(u"  " + k)

        # Inconsistencies:
        #self.LogInformation(u"Correction(s) absentes du dictionnaire")
        #for k in self.DictCorrectionsK:
        #    for v in self.DictCorrections[k].split("|"):
        #        if v not in self.DictKnownWords:
        #            self.LogInformation(u"  " + k + " => " + self.DictCorrections[k])
        #            self.DictCorrectionsK.remove(k)
        #            self.DictCorrections.pop(k)
        #            break

        self.DictKnownWords = set(self.DictKnownWords)
        self.DictUnknownWords = set(self.DictUnknownWords)
    def init(self, logger):
        Plugin.init(self, logger)
        tags = capture_tags = {}
        self.errors[50109001] = {'item': 5010, 'level': 2, 'tag': mapcss.list_(u'name', u'fix:chair'), 'desc': mapcss.tr(u'Arabic letter detected in Farsi name')}

        self.re_4234bf3b = re.compile(r'ك')
        self.re_5eeade1c = re.compile(r'ي')
Ejemplo n.º 23
0
    def init(self, logger):
        Plugin.init(self, logger)
        tags = capture_tags = {}
        self.errors[9007001] = {'item': 9007, 'level': 3, 'tag': ["tag", "relation"], 'desc': mapcss.tr(u'missing tag')}
        self.errors[9007002] = {'item': 9007, 'level': 2, 'tag': ["tag", "relation"], 'desc': mapcss.tr(u'relation without type')}

        self.re_67b11051 = re.compile(r'^restriction')
Ejemplo n.º 24
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.parking_lane = "parking:lane:"
        self.parking_condition = "parking:condition:"
        self.errors[31611] = self.def_class(item = 3161, level = 3, tags = ['highway', 'parking', 'fix:imagery'],
            title = T_('Bad parking:lane:[side]'),
            detail = T_(
'''The side was not recognized, see
`[parking:lane=*](https://wiki.openstreetmap.org/wiki/Key:parking:lane)`.'''),
            fix = T_(
'''Use `left`, `right` or `both`.'''))
        self.errors[31614] = self.def_class(item = 3161, level = 3, tags = ['highway', 'parking', 'fix:imagery'],
            title = T_('Too many parking:lane:[side]'),
            detail = T_(
'''There are more types of parking for sides than a street have
sides.'''))
        self.errors[31615] = self.def_class(item = 3161, level = 3, tags = ['highway', 'parking', 'fix:chair'],
            title = T_('Bad parking:lane:[side] value'),
            fix = T_(
'''See values at
`[parking:lane=*](https://wiki.openstreetmap.org/wiki/Key:parking:lane)`.'''))
        self.errors[31616] = self.def_class(item = 3161, level = 3, tags = ['highway', 'parking', 'fix:survey'],
            title = T_('parking:condition:[side] without parking:lane:[side] value'),
            detail = T_(
'''A parking condition is present but without parking kind.'''))
Ejemplo n.º 25
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[32001] = {
         "item":
         3200,
         "level":
         3,
         "tag": ["tag", "fix:chair"],
         "desc":
         T_(u"Bad usage of area=yes. Object is already an area by nature")
     }
     self.errors[32002] = {
         "item": 3200,
         "level": 3,
         "tag": ["tag", "fix:chair"],
         "desc": T_(u"area=yes on object without kind")
     }
     self.errors[32003] = {
         "item": 3200,
         "level": 3,
         "tag": ["tag", "fix:chair"],
         "desc": T_(u"Bad usage of area=no. Object must be a surface")
     }
     self.area_yes_good = set(
         ('aerialway', 'aeroway', 'amenity', 'barrier', 'highway',
          'historic', 'leisure', 'man_made', 'military', 'power',
          'public_transport', 'sport', 'tourism', 'waterway'))
     self.area_yes_bad = set(
         ('boundary', 'building', 'craft', 'geological', 'landuse',
          'natural', 'office', 'place', 'shop', 'indoor'))
Ejemplo n.º 26
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[3110] = {"item": 3110, "level": 3, "tag": ["fixme", "fix:chair"], "desc": T_(u"Possible improvement for note or comment tag") }
     self.FixmeFull = (
         "fix me", "grosso modo", "note de memoire", )
     self.FixmeWord = (
         "?",  "accurate",  "approximatif",  "approximation",
         "approximativement",  "attendre",  "bad",  "check",  "checkme",
         "completer",  "corriger",  "crappy",  "draft",  "effacer",
         "estimation",  "exact",  "gourre",  "incomplete",  "renderers",
         "rendering",  "semblant",  "semble",  "tag",  "tagged",  "tagguer",
         "todo",  "uncertain",  "verified",  "verifier",  "wip", )
     self.Opening_hours = (
         "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi", "dimanche",
         "janvier",  "fevrier",  "mars",  "avril",  "mai",  "juin",  "juillet",
         "aout",  "septembre",  "octobre",  "novembre",  "decembre", )
     self.Destruction = (
         "ferme",  "fermee",  "ancien",  "ancienne",  "brule",  "brulee",  "burn",  "closed",  "declasse",
         "declassee",  "demoli",  "demolished",  "demolition",  "destroyed",
         "detruit",  "no_longer",  "rase",  "rasee", )
     self.Construction = (
         "construction", "travaux", "ouvert", "ouverture")
     self.TagFull = (
         "arret de bus",  "http://",  "maison de retraite",  "reserve naturelle",
         "salle des fetes",  "voies de service",  "zone 30", )
     self.TagWord = (
         "football",  "basket",  "bassin",  "canal",  "cyclable",  "ecluse",
         "ehpad",  "entree",  "etang",  "garages",  "gare",  "gendarmerie",
         "gynmase",  "halles",  "handball",  "hangar",  "jardin",  "piste",
         "plot",  "prairie",  "prive",  "ruin",  "ruine",  "sortie",  "tel",  "toilettes",
         "transformateur",  "verger",  "volley", )
     self.Hours = re.compile("[0-9]{1,2}h")
     self.Date = re.compile("[0-9]{4,8}|(?:(?:[0-9]{1,2}/){2}/[0-9]{2,4})")
     self.Split = re.compile('[- _\(\),.:/''"+!;<>=\[\]]')
Ejemplo n.º 27
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[303241] = self.def_class(
         item=3032,
         level=1,
         tags=['tag', 'highway'],
         title=T_('Discordant maxspeed and source:maxspeed'))
Ejemplo n.º 28
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[3090] = self.def_class(
            item=3090,
            level=3,
            tags=['value', 'fix:chair'],
            title=T_('Bad date format'),
            detail=T_(
                '''The date entered is not in the expected format described at
[Key:start_date](https://wiki.openstreetmap.org/wiki/Key:start_date)'''))

        self.tag_date = [
            "date",
            "start_date",
            "end_date",
            "paved:date",
            "date_closed",
            "built_date",
            "opening_date",
            "check_date",
            "open_date",
            "construction:date",
            "temporary:date_on",  # Construction
            "mhs:inscription_date",  # Heritage
        ]
        self.default_date = datetime.datetime(9999, 12, 1)
        self.Year = re.compile(u"^[12][0-9][0-9][0-9]$")
        self.Day1 = re.compile(u"^[12][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$")
        self.Day2 = re.compile(u"^[0-9][0-9]/[0-9][0-9]/[12][0-9][0-9][0-9]$")
        self.Aprox = re.compile(
            u"^(?:early|mid|late|before|after|spring|summer|autumn|winter) [^ ]+"
        )
  def init(self, logger):
    Plugin.init(self, logger)

    self.ReYear = re.compile(r'20\d\d') # Update in 2099
    self.ReSimpleCondition = re.compile(r'^\w+$', re.ASCII)
    self.currentYear = date.today().year

    self.errors[33501] = self.def_class(item = 3350, level = 2, tags = ['highway', 'fix:chair'],
        title = T_('Bad conditional restriction'),
        detail = T_('''Conditional restrictions should follow `value @ condition; value2 @ condition2` syntax.
Combined restrictions should follow `value @ (condition1 AND condition2)`.
Parentheses `()` must be used around the condition if the condition itself contains semicolons `;`, i.e. `value @ (date;date)`.'''),
        resource="https://wiki.openstreetmap.org/wiki/Conditional_restrictions")
    self.errors[33502] = self.def_class(item = 3350, level = 3, tags = ['highway', 'fix:chair'],
        title = T_('Improve style of conditional'),
        detail = T_('''Although valid, it is recommended to format conditional restrictions with:
- spaces around the `@`;
- uppercase `AND` (in combined restrictions);
- parentheses around all-but-the-simplest conditions.
This helps to prevent errors and improves readability.
For example, use `no @ (weight > 5 AND wet)` rather than `no@weight>5 and wet`.'''),
        resource="https://wiki.openstreetmap.org/wiki/Conditional_restrictions")
    self.errors[33503] = self.def_class(item = 3350, level = 3, tags = ['highway', 'fix:chair'],
        title = T_('Expired conditional'),
        detail = T_('''This conditional was only valid up to a date in the past. It can likely be removed.'''),
        trap = T_('''Other tags might need to be updated too to reflect the new situation.'''))
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[11701] = {
         "item": 1170,
         "level": 2,
         "tag": ["relation", "multipolygon", "fix:chair"],
         "desc": T_(u"Inadequate role for multipolygon"),
     }
     self.errors[11702] = {
         "item": 1170,
         "level": 2,
         "tag": ["relation", "multipolygon", "fix:chair"],
         "desc": T_(u"Inadequate member for multipolygon"),
     }
     self.errors[11703] = {
         "item": 1170,
         "level": 1,
         "tag": ["relation", "multipolygon", "fix:imagery"],
         "desc": T_(u"Missing outer role for multipolygon"),
     }
     self.errors[11704] = {
         "item": 1170,
         "level": 3,
         "tag": ["relation", "multipolygon", "fix:chair"],
         "desc": T_(u"This multipolygon is a simple polygon"),
     }
Ejemplo n.º 31
0
    def init(self, logger):
        Plugin.init(self, logger)
        tags = capture_tags = {}
        self.errors[9010001] = {'item': 9010, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'unnecessary tag')}
        self.errors[9010002] = {'item': 9010, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'{0} makes no sense', u'{0.tag')}

        self.re_3ad9e1f5 = re.compile(r'^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$')
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[702] = {
            "item": 5020,
            "level": 2,
            "tag": ["name", "fix:chair"],
            "desc": T_(u"Badly written way type"),
        }

        self.ReTests = {}
        # Captial at start already checked by Toponymie plugin
        self.ReTests[(0, u"Allée")] = re.compile(u"^([A][Ll][Ll]?[EÉée][Ee]?|[Aa][Ll][Ll]\.) .*$")
        self.ReTests[(0, u"Allées")] = re.compile(u"^([A][Ll][Ll]?[EÉée][Ee]?[sS]) .*$")
        self.ReTests[(1, u"Boulevard")] = re.compile(u"^([B]([Oo][Uu][Ll][Ll]?[Ee]?)?[Vv]?([Aa][Rr])?[Dd]\.?) .*$")
        self.ReTests[(2, u"Avenue")] = self.generator(u"Av|enue")
        self.ReTests[(4, u"Chemin")] = self.generator(u"Che|min")
        self.ReTests[(5, u"Route")] = re.compile(u"^([R]([Oo][Uu])?[Tt][Ee]?\.?) .*$")
        self.ReTests[(6, u"Esplanade")] = re.compile(u"^([EÉ][Ss][Pp][Ll][Aa][Nn][Aa][Dd][Ee]) .*$")
        self.ReTests[(7, u"Rue")] = self.generator(u"R|ue")
        self.ReTests[(8, u"Giratoire")] = re.compile(u"^([G][Ii][Rr][Aa][Tt][Oo][Ii][Rr][Ee]) .*$")
        self.ReTests[(9, u"Rond-Point")] = re.compile(u"^([R][Oo][Nn][Dd]-[p][Oo][Ii][Nn][Tt]) .*$")
        self.ReTests[(9, u"Rondpoint")] = re.compile(u"^([R][Oo][Nn][Dd][Pp][Oo][Ii][Nn][Tt]) .*$")
        self.ReTests[(10, u"Carrefour")] = re.compile(u"^([C][Aa][Rr][Rr][Ee][Ff][Oo][Uu][Rr]) .*$")
        self.ReTests[(11, u"Place")] = self.generator(u"Pl|ace")
        self.ReTests[(12, u"Impasse")] = self.generator(u"Imp|asse")
        self.ReTests[(13, u"Quai")] = self.generator(u"Qu|ai")
        self.ReTests[(14, u"Square")] = self.generator(u"Sq|uare")
        self.ReTests = self.ReTests.items()
Ejemplo n.º 33
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[3060] = {
         "item": 3060,
         "level": 3,
         "tag": ["value", "fix:chair"],
         "desc": T_(u"Duplicated similar values")
     }
     self.BlackList = set(('ref', 'created_by', 'CLC:id', 'opening_hours',
                           'collection_times', 'phone', 'url', 'GNS:id',
                           'technology', 'cables', 'is_in', 'position'))
     self.BlackListRegex = set((
         re.compile('seamark:.+:colour'),
         re.compile('.+_ref'),
         re.compile('ref:.+'),
         re.compile('destination:.+'),
         re.compile('AND_.+'),
         re.compile('AND:.+'),
         re.compile('[Nn][Hh][Dd]:.+'),
         re.compile('massgis:.+'),
         re.compile('maxspeed(:.+)?'),
         re.compile('maxheight(:.+)?'),
         re.compile('maxwidth(:.+)?'),
         re.compile('maxweight(:.+)?'),
     ))
Ejemplo n.º 34
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.Language = self.father.config.options.get("language")
        if not self.Language:
            # no language
            return False
        elif isinstance(self.Language, list):
            # more than one language
            return False  # Checked by Name_Multilingual

        self.errors[50601] = self.def_class(
            item=5060,
            level=1,
            tags=['name', 'fix:chair'],
            title=T_('Default and local language name not the same'))
        self.errors[50602] = self.def_class(
            item=5060,
            level=1,
            tags=['name', 'fix:chair'],
            title=T_('Local language name without default name'))
        self.errors[50603] = self.def_class(
            item=5060,
            level=1,
            tags=['name', 'fix:chair'],
            title=T_('Language name without default name'))

        self.Language = self.father.config.options.get("language").split(
            '_')[0]
        self.LocalName = re.compile("^name:[a-z][a-z](_.*$|$)")
Ejemplo n.º 35
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[30326] = { "item": 3032, "level": 1, "tag": ["tag", "fix:chair"], "desc": T_(u"Watch multiple tags") }

        import re
        self.Punta = re.compile(u"punta .*", re.IGNORECASE)
        self.Panaderia = re.compile(u"panader.a (.*)", re.IGNORECASE)
Ejemplo n.º 36
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[32001] = { "item": 3200, "level": 3, "tag": ["tag", "fix:chair"], "desc": T_(u"Bad usage of area=yes. Object is already an area by nature") }
     self.errors[32002] = { "item": 3200, "level": 3, "tag": ["tag", "fix:chair"], "desc": T_(u"area=yes on object without kind") }
     self.errors[32003] = { "item": 3200, "level": 3, "tag": ["tag", "fix:chair"], "desc": T_(u"Bad usage of area=no. Object must be a surface") }
     self.area_yes_good = set(('aerialway', 'aeroway', 'amenity', 'barrier', 'highway', 'historic', 'leisure', 'man_made', 'military', 'power', 'public_transport', 'sport', 'tourism', 'waterway'))
     self.area_yes_bad = set(('boundary', 'building', 'craft', 'geological', 'landuse', 'natural', 'office', 'place', 'shop', 'indoor'))
Ejemplo n.º 37
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[3091] = { "item": 3091, "level": 2, "tag": ["value", "fix:chair"], "desc": T_(u"Numerical value") }
     self.tag_number = ["height", "maxheight", "maxheight:physical", "width", "maxwidth", "length", "maxlength", "maxweight", "maxspeed", "population", "admin_level", "ele"]
     self.Number = re.compile(u"^((?:[0-9]+(?:[.][0-9]+)?)|(?:[.][0-9]+))(?: ?(?:m|ft|cm|km|lbs|tons|t|T|mph|knots)|'(?:[0-9]*(?:[.][0-9]+)?\")?|\")?$")
     self.MaxspeedExtraValue = ["none", "signals", "national", "no", "unposted", "walk", "urban", "variable"]
     self.MaxspeedClassValue = re.compile(u'^[A-Z]*:.*$')
Ejemplo n.º 38
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[3120] = {"item": 3120, "level": 3, "tag": ["natural", "fix:imagery"], "desc": T_(u"Tree tagging") }

        self.Tree = {}
        self.liste_des_arbres_fruitiers()
        self.liste_des_essences_europennes()
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[30326] = { "item": 3032, "level": 1, "tag": ["tag", "fix:chair"], "desc": T_(u"Watch multiple tags") }

        import re
        self.Punta = re.compile(u"punta .*", re.IGNORECASE)
        self.Panaderia = re.compile(u"panader.a (.*)", re.IGNORECASE)
Ejemplo n.º 40
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.parking_lane = "parking:lane:"
     self.parking_condition = "parking:condition:"
     self.errors[31611] = {
         "item": 3161,
         "level": 3,
         "tag": ["highway", "parking", "fix:imagery"],
         "desc": T_(u"Bad parking:lane:[side]")
     }
     self.errors[31614] = {
         "item": 3161,
         "level": 3,
         "tag": ["highway", "parking", "fix:imagery"],
         "desc": T_(u"Too many parking:lane:[side]")
     }
     self.errors[31615] = {
         "item": 3161,
         "level": 3,
         "tag": ["highway", "parking", "fix:chair"],
         "desc": T_(u"Bad parking:lane:[side] value")
     }
     self.errors[31616] = {
         "item":
         3161,
         "level":
         3,
         "tag": ["highway", "parking", "fix:survey"],
         "desc":
         T_(u"parking:condition:[side] without parking:lane:[side] value")
     }
    def init(self, logger):
        Plugin.init(self, logger)
        tags = capture_tags = {}
        self.errors[20806] = {
            'item': 2080,
            'level': 3,
            'tag': mapcss.list_(u'parking', u'amenity', u'fix:chair'),
            'desc': mapcss.tr(u'Missing tag carpool on area')
        }
        self.errors[21600] = {
            'item': 2160,
            'level': 3,
            'tag': mapcss.list_(u'tag', u'railway'),
            'desc': mapcss.tr(u'Missing tag gauge on rail')
        }
        self.errors[40612] = {
            'item':
            4061,
            'level':
            2,
            'tag':
            mapcss.list_(u'parking', u'amenity', u'fix:chair'),
            'desc':
            mapcss.
            tr(u'Does this station still sell SP95, or has it been replaced by the SP95-E10?'
               )
        }

        self.re_045a0f34 = re.compile(r'(?i)co.?voiturage')
Ejemplo n.º 42
0
 def init(self, logger):
     Plugin.init(self, logger)
     if self.father.config.options.get("project") != 'openstreetmap':
         return False
     self.errors[706] = { "item": 3020, "level": 1, "tag": ["source", "fix:chair"], "desc": T_(u"Illegal or incomplete source tag") }
     self.errors[707] = { "item": 2040, "level": 3, "tag": ["source", "fix:chair"], "desc": T_(u"Missing source tag") }
     self.Country = self.father.config.options.get("country")
Ejemplo n.º 43
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[705] = self.def_class(item = 5030, level = 1, tags = ['name', 'fix:survey'],
            title = T_('The name tag contains two names'),
            detail = T_(
'''The tag `name=*` contains multiple names, separated by a semicolon,
a "/" or a "\\". This issue was probably produced by the fusion of two
way and the concatenation of the names of the streets.'''),
            fix = T_(
'''* If duplicate, delete a one.
* Otherwise, a survey is required: check if it is a street whose name
changes at a crossroads, if this is the case, cut the street and set the
proper names of both part.'''),
            trap = T_(
'''Some streets have not the same names on the each side, especially if
the houses by both sides are on different city. In this case, you can use
the tag `name:left=*` and `name:right=*`.'''))

        self.NoExtra = False
        self.HighwayOnly = False
        self.allowSlash = False
        if self.father.config.options.get("country"):
            self.NoExtra = any(map(lambda c: self.father.config.options.get("country").startswith(c), ['DE', 'US', 'CA']))

            self.HighwayOnly = self.father.config.options.get("country").startswith('BY')

            self.allowSlash = any(map(lambda c: self.father.config.options.get("country").startswith(c), ['CH', 'DJ']))

        self.streetSubNumberRe = re.compile(u".*[0-9๐๑๒๓๔๕๖๗๘๙]/[0-9๐๑๒๓๔๕๖๗๘๙].*")
Ejemplo n.º 44
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[10] = { "item": 2060, "level": 3, "tag": ["addr", "fix:survey"], "desc": T_(u"addr:housenumber does not start by a number") }
     self.errors[14] = { "item": 2060, "level": 3, "tag": ["addr", "fix:chair"], "desc": T_(u"Invalid tag on interpolation way") }
     self.errors[15] = { "item": 2060, "level": 3, "tag": ["addr", "fix:chair"], "desc": T_(u"Invalid addr:interpolation or addr:inclusion value") }
     self.CountryCZ = self.father.config.options.get("country") == "CZ"
     self.CountryHousenumberWithoutNumber = self.father.config.options.get("country") in ('RU', 'BG')
Ejemplo n.º 45
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[30320] = { "item": 3032, "level": 1, "tag": ["tag", "highway", "fix:chair"], "desc": T_(u"Watch multiple tags") }
        self.errors[30323] = { "item": 3032, "level": 3, "tag": ["tag", "fix:chair"], "desc": T_(u"Watch multiple tags") }
        self.errors[30327] = { "item": 3032, "level": 2, "tag": ["tag", "fix:chair"], "desc": T_(u"Waterway with level") }
        self.errors[20800] = { "item": 2080, "level": 1, "tag": ["tag", "highway", "roundabout", "fix:chair"], "desc": T_(u"Tag highway missing on junction") }
        self.errors[20801] = { "item": 2080, "level": 1, "tag": ["tag", "highway", "fix:chair"], "desc": T_(u"Tag highway missing on oneway") }
        self.errors[20301] = { "item": 2030, "level": 1, "tag": ["tag", "highway", "cycleway", "fix:survey"], "desc": T_(u"Opposite cycleway without oneway") }
        self.errors[71301] = { "item": 7130, "level": 3, "tag": ["tag", "highway", "maxheight", "fix:survey"], "desc": T_(u"Missing maxheight tag") }
        self.errors[21101] = { "item": 2110, "level": 3, "tag": ["tag"], "desc": T_(u"Missing object kind") }
        self.errors[1050] = { "item": 1050, "level": 1, "tag": ["highway", "roundabout", "fix:chair"], "desc": T_(u"Reverse roundabout") }
        self.errors[40201] = { "item": 4020, "level": 1, "tag": ["highway", "roundabout"], "desc": T_(u"Roundabout as area") }
        self.errors[21201] = { "item": 2120, "level": 3, "tag": ["indoor"], "desc": T_(u"Level or repeat_on tag missing") }
        self.errors[21202] = { "item": 2120, "level": 3, "tag": ["indoor"], "desc": T_(u"Indoor or buildingpart tag missing") }
        self.errors[20802] = { "item": 2080, "level": 2, "tag": ["highway"], "desc": T_(u"Missing tag ref for emergency access point") }
#        self.errors[70401] = { "item": 7040, "level": 2, "tag": ["tag", "power", "fix:chair"], "desc": T_(u"Bad power line kind") }
        self.errors[32200] = { "item": 3220, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"access=yes|permissive allow all transport modes") }
        self.errors[32201] = { "item": 3220, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"access=yes|permissive allow all transport modes") }
        self.driving_side_right = not(self.father.config.options.get("driving_side") == "left")
        self.driving_direction = "anticlockwise" if self.driving_side_right else "clockwise"
        name_parent = []
        for i in ('type', 'aerialway', 'aeroway', 'amenity', 'barrier', 'boundary', 'building', 'craft', 'entrance', 'emergency', 'geological', 'highway', 'historic', 'landuse', 'leisure', 'man_made', 'military', 'natural', 'office', 'place', 'power', 'public_transport', 'railway', 'route', 'shop', 'sport', 'tourism', 'waterway', 'mountain_pass', 'traffic_sign', 'mountain_pass', 'golf', 'piste:type', 'junction', 'healthcare', 'health_facility:type', 'indoor'):
            name_parent.append(i)
            name_parent.append("disused:" + i)
            name_parent.append("abandoned:" + i)
        self.name_parent = set(name_parent)
Ejemplo n.º 46
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[705] = { "item": 5030, "level": 1, "tag": ["name", "fix:survey"], "desc": T_(u"The name tag contains two names") }

        import re
        self.Re1 = re.compile(u"^.*;.*$")
        self.Re2 = re.compile(u"^.*/.*$")
        self.Re3 = re.compile(u"^.*\+.+$")
Ejemplo n.º 47
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[904] = { "item": 4040, "level": 1, "tag": ["name", "highway", "ref", "fix:chair"], "desc": T_(u"Highway reference in name tag") }

        #self.ReRefRoute = re.compile(u"^[NDCEAM] ?[0-9]+(| ?[a-z]| ?bis)$")
        self.ReRefRoute1 = re.compile(u"(?:^|.*[^RV] +)([RV]?([NDCEAM] ?[0-9]+[^ ]*)).*")
        self.ReRefRoute2 = re.compile(u".*[nN][o°] ?[0-9]+[^ ]*")
        self.MultipleSpace = re.compile(u" +")
Ejemplo n.º 48
0
    def init(self, logger):
        Plugin.init(self, logger)
        tags = capture_tags = {}
        self.errors[9005001] = {'item': 9005, 'level': 3, 'tag': ["tag", "value"], 'desc': mapcss.tr(u'{0} with multiple values', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}
        self.errors[9005002] = {'item': 9005, 'level': 3, 'tag': ["tag", "value"], 'desc': mapcss.tr(u'empty value in semicolon-separated \'\'{0}\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}

        self.re_53db61ac = re.compile(r'.+;(.+)?')
        self.re_579c7c6a = re.compile(r'^(;.*|.*;;.*|.*;)$')
Ejemplo n.º 49
0
    def init(self, logger):
        Plugin.init(self, logger)
        tags = capture_tags = {}
        self.errors[30911] = {'item': 3091, 'level': 2, 'tag': mapcss.list_(u'tag'), 'desc': mapcss.tr(u'Colour code should start with \'#\' followed by 3 or 6 digits')}

        self.re_1b3f6ace = re.compile(r'^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$')
        self.re_30dca0d4 = re.compile(r'^#')
        self.re_7d65c79d = re.compile(r'^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$')
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[504] = {
         "item": 6020,
         "level": 3,
         "tag": ["boundary", "fix:chair"],
         "desc": T_(u"Duplicated way in relation"),
     }
Ejemplo n.º 51
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.parking_lane = "parking:lane:"
     self.parking_condition = "parking:condition:"
     self.errors[31611] = { "item": 3161, "level": 3, "tag": ["highway", "parking", "fix:imagery"], "desc": T_(u"Bad parking:lane:[side]") }
     self.errors[31614] = { "item": 3161, "level": 3, "tag": ["highway", "parking", "fix:imagery"], "desc": T_(u"Too many parking:lane:[side]") }
     self.errors[31615] = { "item": 3161, "level": 3, "tag": ["highway", "parking", "fix:chair"], "desc": T_(u"Bad parking:lane:[side] value") }
     self.errors[31616] = { "item": 3161, "level": 3, "tag": ["highway", "parking", "fix:survey"], "desc": T_(u"parking:condition:[side] without parking:lane:[side] value") }
Ejemplo n.º 52
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[31801] = {
         "item": 3180,
         "level": 2,
         "tag": ["relation", "restriction"],
         "desc": T_(u"Useless non u-turn restriction, it's forbidden by local law"),
     }
     self.Country = self.father.config.options.get("country")
Ejemplo n.º 53
0
    def init(self, logger):
        Plugin.init(self, logger)

        import re
        # From RFC 1738 paragraph 2.1
        self.HasScheme = re.compile(r"^[a-zA-Z0-9.+-]+://")

        self.errors[30931] = {"item": 3093, "level": 2, "tag": ["value", "fix:chair"], "desc": T_(u"The URL contains a space")}
        self.errors[30932] = {"item": 3093, "level": 2, "tag": ["value", "fix:chair"], "desc": T_(u"The URL does not have a valid scheme")}
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[900] = { "item": 4030, "level": 1, "tag": ["tag", "fix:chair"], "desc": T_(u"Tag conflict") }
     self.CONFLICT = {}
     self.CONFLICT[0] = set(['aerialway', 'aeroway', 'amenity', 'highway', 'railway', 'waterway', 'landuse'])
     self.CONFLICT[1] = set(['aerialway', 'aeroway', 'amenity', 'highway', 'leisure', 'railway', 'natural'])
     self.CONFLICT[2] = set(['aerialway', 'aeroway', 'amenity', 'highway', 'leisure', 'railway', 'waterway', 'place'])
     self.CONFLICT[3] = set(['building', 'place'])
     self.CONFLICT[4] = set(['information', 'place'])
Ejemplo n.º 55
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[4070] = { "item": 4070, "level": 2, "tag": ["tag", "fix:survey"], "desc": T_(u"Finished construction") }

        self.tag_construction = ["highway", "landuse", "building"]
        self.tag_date = ["opening_date", "check_date", "open_date", "construction:date", "temporary:date_on", "date_on"]
        self.default_date = datetime.datetime(9999, 12, 1)
        self.today = datetime.datetime.today()
        self.date_limit = datetime.datetime.today() - datetime.timedelta(days=2 * 365)
Ejemplo n.º 56
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[705] = { "item": 5030, "level": 1, "tag": ["name", "fix:survey"], "desc": T_(u"The name tag contains two names") }

        self.NoExtra = self.father.config.options.get("country") in ('DE',)

        # In Thailand street added into existing street are named like "บ้านแพะแม่คือ ซอย 5/1", or in USA "County Road 39 4/10"
        self.streetSubNumber = self.father.config.options.get("country") in ('TH', 'VN', 'US')
        self.streetSubNumberRe = re.compile(u".*[0-9๐๑๒๓๔๕๖๗๘๙]/[0-9๐๑๒๓๔๕๖๗๘๙].*")
Ejemplo n.º 57
0
    def init(self, logger):
        Plugin.init(self, logger)
        self.errors[3040] = { "item": 3040, "level": 1, "tag": ["value", "fix:chair"], "desc": T_(u"Bad value in a tag") }

        import re
        self.Values_open = re.compile("^[a-z0-9_]+( *; *[a-z0-9_]+)*$")
        self.check_list_open = set( (
            'abutters', 'access', 'admin_level', 'aerialway', 'aeroway', 'amenity',
            'barrier', 'bicycle', 'boat', 'border_type', 'boundary', 'bridge', 'building', 'construction',
            'covered', 'craft', 'crossing', 'cutting',
            'disused', 'drive_in', 'drive_through',
            'electrified', 'embankment', 'emergency',
            'fenced', 'foot', 'ford',
            'geological', 'goods',
            'hgv', 'highway', 'historic',
            'internet_access',
            'landuse', 'lanes', 'leisure',
            'man_made', 'military', 'mooring', 'motorboat', 'mountain_pass', 'natural', 'noexit',
            'office',
            'power', 'public_transport',
            'railway', 'route',
            'sac_scale', 'service', 'shop', 'smoothness', 'sport', 'surface',
            'tactile_paving', 'toll', 'tourism', 'tracktype', 'traffic_calming', 'trail_visibility',
            'tunnel',
            'usage',
            'vehicle',
            'wall', 'waterway', 'wheelchair', 'wood'
            ) )
        self.check_list_open_node = self.check_list_open
        self.check_list_open_way = self.check_list_open
        self.check_list_open_relation = self.check_list_open.copy()
        self.check_list_open_relation.add('type')
        self.exceptions_open = { "type": ( "associatedStreet",
                                           "turnlanes:lengths",
                                           "turnlanes:turns",
                                           "restriction:hgv", "restriction:caravan", "restriction:motorcar", "restriction:bus", "restriction:agricultural", "restriction:bicycle", "restriction:hazmat",
                                           "TMC" ),
                                 "service": ( "drive-through", ),
                                 "aerialway": ( "j-bar", "t-bar", ),
                                 "surface": ( "concrete:plates", "concrete:lanes",
                                            "paving_stones:20", "paving_stones:30", "paving_stones:50",
                                            "cobblestone:10", "cobblestone:20", "cobblestone:flattened"),
                                 "shop": ( "e-cigarette" ),
                                 "barrier": ( "full-height_turnstile" ),
                                 "man_made": ( "MDF" ),
                                }
        self.check_list_closed = set( (
            'area',
            'narrow',
            'oneway',
            ) )
        self.allow_closed = { "area": ( "yes", "no", ),
                            "narrow": ( "yes", "no", ),
                            "oneway": ( "yes", "no", "1", "-1", "reversible", "alternating"),
                          }
Ejemplo n.º 58
0
 def init(self, logger):
     Plugin.init(self, logger)
     self.errors[31601] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Bad lanes value") }
     self.errors[31603] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Conflict between usage of *:lanes or *:lanes:(forward|backward|both_ways)") }
     self.errors[31604] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Conflict between lanes number") }
     self.errors[31605] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Invalid usage of *:lanes:(backward|both_ways) on oneway highway") }
     self.errors[31606] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Unknown turn lanes value") }
     self.errors[31607] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Bad turn lanes order") }
     self.errors[31608] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Conflict between lanes number of same sufix ('', forward, backward or both_ways)") }
     self.errors[31609] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Bad access lanes value, should not be an integer but a restriction") }
     self.errors[31600] = { "item": 3160, "level": 2, "tag": ["highway", "fix:chair"], "desc": T_(u"Turn lanes merge_to_* need an aside lane on good side") }