diff --git a/mapcss/item_map.py b/mapcss/item_map.py index 742c06748..cde26bb50 100644 --- a/mapcss/item_map.py +++ b/mapcss/item_map.py @@ -118,7 +118,8 @@ 'tags': ['tag']}, 'addresses': {'class': {'Object has no {0}, however, it has {1} and {2} whose value looks like a housenumber.': 9000002, 'Same value of {0} and {1}': 9000003, - 'Way with {0}. Tag each housenumber separately if possible.': 9000001}, + 'Way with {0}. Tag each housenumber separately if possible.': 9000001, + '{0} without number': 9000004}, 'item': 9000, 'not_for': ['CA'], 'prefix': 'Josm_', @@ -222,7 +223,8 @@ 'item': 9005, 'prefix': 'Josm_', 'tags': ['tag', 'value']}, - 'numeric': {'class': {'numerical key': 9006001, + 'numeric': {'class': {'Unnecessary amount of decimal places': 9006021, + 'numerical key': 9006001, 'unusual value of {0}': 9006010, 'unusual value of {0}: kilometers is default; point is decimal separator; if units, put space then unit': 9006020, 'unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit': 9006018, @@ -294,7 +296,8 @@ 'religion': {'class': {'missing tag': 9008001, 'unknown christian denomination': 9008002, 'unknown jewish denomination': 9008004, - 'unknown muslim denomination': 9008003}, + 'unknown muslim denomination': 9008003, + '{0}': 9008005}, 'item': 9008, 'prefix': 'Josm_', 'tags': ['tag']}, @@ -309,13 +312,16 @@ 'item': 9009, 'prefix': 'Josm_', 'tags': ['tag']}, - 'transport': {'class': {'Check if the note can be deleted': 9014006, + 'transport': {'class': {'A bus stop is supposed to be a node': 9014019, + 'Check if the note can be deleted': 9014006, 'Check the network tag': 9014014, 'Check the operator tag': 9014013, 'Is it a bus stop or a bus station?': 9014002, 'Missing from/to tag on a public_transport route relation': 9014018, + 'Missing interval tag to specify the main interval': 9014023, 'Missing legacy tag on a public transport stop': 9014004, 'Missing network tag on a public_transport relation': 9014015, + 'Missing opening_hours tag': 9014024, 'Missing operator tag on a public_transport relation': 9014016, 'Missing public_transport tag on a public transport stop': 9014003, 'Missing public_transport:version tag on a public_transport route relation': 9014011, @@ -323,13 +329,17 @@ 'Missing transportation mode, add a tag route = bus/coach/tram/etc': 9014009, 'Missing transportation mode, change tag route to route_master': 9014010, 'Stop without name': 9014001, + 'The color of the public transport line should be in a colour tag': 9014020, + 'The duration is invalid (try a number of minutes)': 9014022, + 'The interval is invalid (try a number of minutes)': 9014021, 'The network should be on the transport lines and not on the stops': 9014007, 'The operator should be on the transport lines and not on the stops': 9014008, 'The stops may not be in the right order': 9014012}, 'item': 9014, 'prefix': 'Josm_', 'tags': ['tag', 'public_transport']}, - 'unnecessary': {'class': {'unnecessary tag': 9010001, + 'unnecessary': {'class': {'descriptive name': 9010003, + 'unnecessary tag': 9010001, '{0} makes no sense': 9010002}, 'item': 9010, 'prefix': 'Josm_', diff --git a/plugins/Colour.py b/plugins/Colour.py index 969787cea..cd1da9dd6 100644 --- a/plugins/Colour.py +++ b/plugins/Colour.py @@ -26,8 +26,9 @@ def node(self, data, tags): # *[building:colour][building:colour=~/^#/][building:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[roof:colour][roof:colour=~/^#/][roof:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] + # *[colour][colour=~/^#/][colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[ref:colour][ref:colour=~/^#/][ref:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] - if (u'building:colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): + if (u'building:colour' in keys) or (u'colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): match = False if not match: capture_tags = {} @@ -37,6 +38,10 @@ def node(self, data, tags): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'roof:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'roof:colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'roof:colour'))) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'colour'))) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'ref:colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'ref:colour'))) @@ -49,8 +54,9 @@ def node(self, data, tags): # *[building:colour][building:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[roof:colour][roof:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] + # *[colour][colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[ref:colour][ref:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] - if (u'building:colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): + if (u'building:colour' in keys) or (u'colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): match = False if not match: capture_tags = {} @@ -60,6 +66,10 @@ def node(self, data, tags): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'roof:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'roof:colour'))) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'colour'))) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'ref:colour'))) @@ -84,8 +94,9 @@ def way(self, data, tags, nds): # *[building:colour][building:colour=~/^#/][building:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[roof:colour][roof:colour=~/^#/][roof:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] + # *[colour][colour=~/^#/][colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[ref:colour][ref:colour=~/^#/][ref:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] - if (u'building:colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): + if (u'building:colour' in keys) or (u'colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): match = False if not match: capture_tags = {} @@ -95,6 +106,10 @@ def way(self, data, tags, nds): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'roof:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'roof:colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'roof:colour'))) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'colour'))) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'ref:colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'ref:colour'))) @@ -113,8 +128,9 @@ def way(self, data, tags, nds): # *[building:colour][building:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[roof:colour][roof:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] + # *[colour][colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[ref:colour][ref:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] - if (u'building:colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): + if (u'building:colour' in keys) or (u'colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): match = False if not match: capture_tags = {} @@ -124,6 +140,10 @@ def way(self, data, tags, nds): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'roof:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'roof:colour'))) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'colour'))) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'ref:colour'))) @@ -153,8 +173,9 @@ def relation(self, data, tags, members): # *[building:colour][building:colour=~/^#/][building:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[roof:colour][roof:colour=~/^#/][roof:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] + # *[colour][colour=~/^#/][colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[ref:colour][ref:colour=~/^#/][ref:colour!~/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] - if (u'building:colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): + if (u'building:colour' in keys) or (u'colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): match = False if not match: capture_tags = {} @@ -164,6 +185,10 @@ def relation(self, data, tags, members): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'roof:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'roof:colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'roof:colour'))) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'colour'))) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_30dca0d4), mapcss._tag_capture(capture_tags, 1, tags, u'ref:colour')) and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_1b3f6ace), mapcss._tag_capture(capture_tags, 2, tags, u'ref:colour'))) @@ -176,8 +201,9 @@ def relation(self, data, tags, members): # *[building:colour][building:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[roof:colour][roof:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] + # *[colour][colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] # *[ref:colour][ref:colour=~/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/] - if (u'building:colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): + if (u'building:colour' in keys) or (u'colour' in keys) or (u'ref:colour' in keys) or (u'roof:colour' in keys): match = False if not match: capture_tags = {} @@ -187,6 +213,10 @@ def relation(self, data, tags, members): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'roof:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'roof:colour'))) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'colour'))) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ref:colour') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7d65c79d), mapcss._tag_capture(capture_tags, 1, tags, u'ref:colour'))) diff --git a/plugins/Josm_FranceSpecificRules.py b/plugins/Josm_FranceSpecificRules.py index 9866bcbb6..166f255d9 100644 --- a/plugins/Josm_FranceSpecificRules.py +++ b/plugins/Josm_FranceSpecificRules.py @@ -11,10 +11,40 @@ class Josm_FranceSpecificRules(Plugin): def init(self, logger): Plugin.init(self, logger) tags = capture_tags = {} - self.errors[21600] = {'item': 2160, 'level': 3, 'tag': mapcss.list_(u'tag', u'railway'), 'desc': mapcss.tr(u'Tag gauge manquant sur rail')} + 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.re_045a0f34 = re.compile(r'(?i)co.?voiturage') + def node(self, data, tags): + capture_tags = {} + keys = tags.keys() + err = [] + + + # *[name=~/(?i)co.?voiturage/][amenity!=car_pooling][!carpool][inside("FR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_045a0f34), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'car_pooling') and not mapcss._tag_capture(capture_tags, 2, tags, u'carpool') and mapcss.inside(self.father.config.options, u'FR')) + except mapcss.RuleAbort: pass + if match: + # -osmoseTags:list("parking","amenity","fix:chair") + # -osmoseItemClassLevel:"2080/20806/3" + # throwWarning:tr("Missing tag carpool on area") + # fixAdd:"amenity=car_pooling" + # fixAdd:"carpool=designated" + # -osmoseAssertMatchWithContext:list("node name='Aire de Covoiturage' amenity=parking","inside=FR") + err.append({'class': 20806, 'subclass': 0, 'text': mapcss.tr(u'Missing tag carpool on area'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'amenity',u'car_pooling'], + [u'carpool',u'designated']]) + }}) + + return err + def way(self, data, tags, nds): capture_tags = {} keys = tags.keys() @@ -31,12 +61,61 @@ def way(self, data, tags, nds): if match: # -osmoseTags:list("tag","railway") # -osmoseItemClassLevel:"2160/21600/3" - # throwWarning:tr("Tag gauge manquant sur rail") + # throwWarning:tr("Missing tag gauge on rail") # suggestAlternative:"gauge" # -osmoseAssertNoMatchWithContext:list("way railway=disused","inside=FR") # -osmoseAssertNoMatchWithContext:list("way railway=rail gauge=1435","inside=FR") # -osmoseAssertMatchWithContext:list("way railway=rail","inside=FR") - err.append({'class': 21600, 'subclass': 0, 'text': mapcss.tr(u'Tag gauge manquant sur rail')}) + err.append({'class': 21600, 'subclass': 0, 'text': mapcss.tr(u'Missing tag gauge on rail')}) + + # *[name=~/(?i)co.?voiturage/][amenity!=car_pooling][!carpool][inside("FR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_045a0f34), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'car_pooling') and not mapcss._tag_capture(capture_tags, 2, tags, u'carpool') and mapcss.inside(self.father.config.options, u'FR')) + except mapcss.RuleAbort: pass + if match: + # -osmoseTags:list("parking","amenity","fix:chair") + # -osmoseItemClassLevel:"2080/20806/3" + # throwWarning:tr("Missing tag carpool on area") + # fixAdd:"amenity=car_pooling" + # fixAdd:"carpool=designated" + # -osmoseAssertNoMatchWithContext:list("way name='Aire de covoiturage' amenity=car_pooling","inside=FR") + # -osmoseAssertMatchWithContext:list("way name='Aire de covoiturage' amenity=car_sharing","inside=FR") + # -osmoseAssertNoMatchWithContext:list("way name='Aire de covoiturage' amenity=parking carpool=designated","inside=FR") + err.append({'class': 20806, 'subclass': 0, 'text': mapcss.tr(u'Missing tag carpool on area'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'amenity',u'car_pooling'], + [u'carpool',u'designated']]) + }}) + + return err + + def relation(self, data, tags, members): + capture_tags = {} + keys = tags.keys() + err = [] + + + # *[name=~/(?i)co.?voiturage/][amenity!=car_pooling][!carpool][inside("FR")] + if (u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_045a0f34), mapcss._tag_capture(capture_tags, 0, tags, u'name')) and mapcss._tag_capture(capture_tags, 1, tags, u'amenity') != mapcss._value_capture(capture_tags, 1, u'car_pooling') and not mapcss._tag_capture(capture_tags, 2, tags, u'carpool') and mapcss.inside(self.father.config.options, u'FR')) + except mapcss.RuleAbort: pass + if match: + # -osmoseTags:list("parking","amenity","fix:chair") + # -osmoseItemClassLevel:"2080/20806/3" + # throwWarning:tr("Missing tag carpool on area") + # fixAdd:"amenity=car_pooling" + # fixAdd:"carpool=designated" + err.append({'class': 20806, 'subclass': 0, 'text': mapcss.tr(u'Missing tag carpool on area'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'amenity',u'car_pooling'], + [u'carpool',u'designated']]) + }}) return err @@ -55,9 +134,17 @@ class father: n.init(None) data = {'id': 0, 'lat': 0, 'lon': 0} + with with_options(n, {'country': 'FR'}): + self.check_err(n.node(data, {u'amenity': u'parking', u'name': u'Aire de Covoiturage'}), expected={'class': 20806, 'subclass': 0}) with with_options(n, {'country': 'FR'}): self.check_not_err(n.way(data, {u'railway': u'disused'}, [0]), expected={'class': 21600, 'subclass': 0}) with with_options(n, {'country': 'FR'}): self.check_not_err(n.way(data, {u'gauge': u'1435', u'railway': u'rail'}, [0]), expected={'class': 21600, 'subclass': 0}) with with_options(n, {'country': 'FR'}): self.check_err(n.way(data, {u'railway': u'rail'}, [0]), expected={'class': 21600, 'subclass': 0}) + with with_options(n, {'country': 'FR'}): + self.check_not_err(n.way(data, {u'amenity': u'car_pooling', u'name': u'Aire de covoiturage'}, [0]), expected={'class': 20806, 'subclass': 0}) + with with_options(n, {'country': 'FR'}): + self.check_err(n.way(data, {u'amenity': u'car_sharing', u'name': u'Aire de covoiturage'}, [0]), expected={'class': 20806, 'subclass': 0}) + with with_options(n, {'country': 'FR'}): + self.check_not_err(n.way(data, {u'amenity': u'parking', u'carpool': u'designated', u'name': u'Aire de covoiturage'}, [0]), expected={'class': 20806, 'subclass': 0}) diff --git a/plugins/Josm_Seamark.py b/plugins/Josm_Seamark.py index 4916ac6b9..87c33e702 100644 --- a/plugins/Josm_Seamark.py +++ b/plugins/Josm_Seamark.py @@ -26,6 +26,7 @@ def init(self, logger): self.re_09200db5 = re.compile(r'keep_to_port_margin|keep_to_starboard_margin|keep_to_mid|cross_river_to_port|cross_river_to_starboard|reduce_speed') self.re_09c0bae9 = re.compile(r'opening_to_right|opening_to_left') self.re_0b7ab6fc = re.compile(r'keep_to_port_margin|keep_to_starboard_margin|keep_to_mid-river|cross_river_to_port|cross_river_to_starboard') + self.re_0c508f2a = re.compile(r'entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted') self.re_0e114cad = re.compile(r'bniwr2|ppwbc') self.re_0e3e01fc = re.compile(r'no_entry|closed_area|no_overtaking|no_convoy_overtaking|no_passing|no_convoy_passing|no_berthing|no_berthing_lateral_limit|no_anchoring|no_mooring|no_turning|no_wash|no_passage_left|no_passage_right|no_motor_craft|no_sport_craft|no_waterskiing|no_sailing_craft|no_unpowered_craft|no_sailboards|no_high_speeds|no_launching_beaching|no_waterbikes') self.re_1389a933 = re.compile(r'move_to_left|move_to_right|move_to_port|move_to_starboard|keep_to_port|keep_to_starboard|cross_to_port|cross_to_starboard|stop|speed_limit|sound_horn|keep_lookout|give_way_junction|give_way_crossing|make_radio_contact') @@ -34,7 +35,6 @@ def init(self, logger): self.re_281803e9 = re.compile(r'preferred_channel_starboard|turnoff_right') self.re_288a42ac = re.compile(r'port|waterway_right|channel_right') self.re_2a269778 = re.compile(r'main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right') - self.re_2e10f0c7 = re.compile(r'entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted') self.re_32e3abb7 = re.compile(r'starboard|waterway_left|channel_left') self.re_336a6c28 = re.compile(r'limited_depth|limited_headroom|limited_width|navigation_restrictions|channel_distance_left|channel_distance_right') self.re_39084725 = re.compile(r'limited_headroom') @@ -649,16 +649,26 @@ def node(self, data, tags): # node["seamark:notice:7:system"=cevni]["seamark:notice:7:function"!=recommendation]["seamark:notice:7:category"=~/channel_two_way|channel_one_way|opening_to_right|opening_to_left|proceed_to_left|proceed_to_right/] # node["seamark:notice:8:system"=cevni]["seamark:notice:8:function"!=recommendation]["seamark:notice:8:category"=~/channel_two_way|channel_one_way|opening_to_right|opening_to_left|proceed_to_left|proceed_to_right/] # node["seamark:notice:9:system"=cevni]["seamark:notice:9:function"!=recommendation]["seamark:notice:9:category"=~/channel_two_way|channel_one_way|opening_to_right|opening_to_left|proceed_to_left|proceed_to_right/] - # node["seamark:notice:system"=cevni]["seamark:notice:function"!=information]["seamark:notice:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:1:system"=cevni]["seamark:notice:1:function"!=information]["seamark:notice:1:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:2:system"=cevni]["seamark:notice:2:function"!=information]["seamark:notice:2:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:3:system"=cevni]["seamark:notice:3:function"!=information]["seamark:notice:3:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:4:system"=cevni]["seamark:notice:4:function"!=information]["seamark:notice:4:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:5:system"=cevni]["seamark:notice:5:function"!=information]["seamark:notice:5:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:6:system"=cevni]["seamark:notice:6:function"!=information]["seamark:notice:6:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:7:system"=cevni]["seamark:notice:7:function"!=information]["seamark:notice:7:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:8:system"=cevni]["seamark:notice:8:function"!=information]["seamark:notice:8:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] - # node["seamark:notice:9:system"=cevni]["seamark:notice:9:function"!=information]["seamark:notice:9:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limit|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:system"=cevni]["seamark:notice:function"!=information]["seamark:notice:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:1:system"=cevni]["seamark:notice:1:function"!=information]["seamark:notice:1:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:2:system"=cevni]["seamark:notice:2:function"!=information]["seamark:notice:2:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:3:system"=cevni]["seamark:notice:3:function"!=information]["seamark:notice:3:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:4:system"=cevni]["seamark:notice:4:function"!=information]["seamark:notice:4:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:5:system"=cevni]["seamark:notice:5:function"!=information]["seamark:notice:5:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:6:system"=cevni]["seamark:notice:6:function"!=information]["seamark:notice:6:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:7:system"=cevni]["seamark:notice:7:function"!=information]["seamark:notice:7:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:8:system"=cevni]["seamark:notice:8:function"!=information]["seamark:notice:8:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:9:system"=cevni]["seamark:notice:9:function"!=information]["seamark:notice:9:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:system"=cevni]["seamark:notice:function"!=information]["seamark:notice:category"=~/entry_permitted|overhead_cable|weir|ferry_non_independent|ferry_independent|berthing_permitted|berthing_lateral_limits|berthing_rafting_limit|berthing_unmarked_pushing|berthing_marked_pushing_1|berthing_marked_pushing_2|berthing_marked_pushing_3|berthing_unmarked_non_pushing|berthing_marked_non_pushing_1|berthing_marked_non_pushing_2|berthing_marked_non_pushing_3|berthing_unmarked|berthing_marked_1|berthing_marked_2|berthing_marked_3|anchoring_permitted|mooring_permitted|vehicle_loading_berth|turning_area|secondary_waterway_crossing|secondary_waterway_right|secondary_waterway_left|main_waterway_right_secondary_ahead|main_waterway_left_secondary_ahead|main_waterway_right_secondary_left|main_waterway_left_secondary_right|main_waterway_right_secondary_ahead_left|main_waterway_left_secondary_ahead_right|main_waterway_crossing|main_waterway_junction|main_waterway_ahead_right|main_waterway_ahead_left|main_waterway_ahead_right_secondary_left|main_waterway_ahead_left_secondary_right|prohibition_ends|drinking_water|telephone|motor_craft_permitted|sport_craft_permitted|waterskiing_permitted|sailing_craft_permitted|unpowered_craft_permitted|sailboards_permitted|high_speeds_permitted|launching_beaching_permitted|radio_information|waterbikes_permitted/] + # node["seamark:notice:1:system"=cevni]["seamark:notice:1:function"!=information]["seamark:notice:1:category"="berthing_lateral_limit"] + # node["seamark:notice:2:system"=cevni]["seamark:notice:2:function"!=information]["seamark:notice:2:category"="berthing_lateral_limit"] + # node["seamark:notice:3:system"=cevni]["seamark:notice:3:function"!=information]["seamark:notice:3:category"="berthing_lateral_limit"] + # node["seamark:notice:4:system"=cevni]["seamark:notice:4:function"!=information]["seamark:notice:4:category"="berthing_lateral_limit"] + # node["seamark:notice:5:system"=cevni]["seamark:notice:5:function"!=information]["seamark:notice:5:category"="berthing_lateral_limit"] + # node["seamark:notice:6:system"=cevni]["seamark:notice:6:function"!=information]["seamark:notice:6:category"="berthing_lateral_limit"] + # node["seamark:notice:7:system"=cevni]["seamark:notice:7:function"!=information]["seamark:notice:7:category"="berthing_lateral_limit"] + # node["seamark:notice:8:system"=cevni]["seamark:notice:8:function"!=information]["seamark:notice:8:category"="berthing_lateral_limit"] + # node["seamark:notice:9:system"=cevni]["seamark:notice:9:function"!=information]["seamark:notice:9:category"="berthing_lateral_limit"] # node["seamark:notice:system"=bniwr]["seamark:notice:system"!=prohibition]["seamark:notice:category"=~/no_anchoring/] # node["seamark:notice:system"=bniwr2]["seamark:notice:system"!=prohibition]["seamark:notice:category"=~/no_anchoring/] # node["seamark:notice:1:system"=bniwr]["seamark:notice:1:system"!=prohibition]["seamark:notice:1:category"=~/no_anchoring/] @@ -859,43 +869,83 @@ def node(self, data, tags): except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:1:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:1:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:1:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:1:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:1:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:1:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:2:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:2:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:2:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:2:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:2:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:2:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:3:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:3:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:3:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:3:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:3:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:3:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:4:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:4:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:4:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:4:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:4:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:4:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:5:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:5:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:5:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:5:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:5:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:5:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:6:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:6:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:6:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:6:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:6:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:6:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:7:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:7:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:7:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:7:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:7:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:7:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:8:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:8:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:8:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:8:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:8:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:8:category'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:9:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:9:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_2e10f0c7), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:9:category'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:9:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:9:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:9:category'))) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0c508f2a), mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:category'))) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:1:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:1:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:1:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:2:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:2:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:2:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:3:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:3:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:3:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:4:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:4:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:4:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:5:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:5:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:5:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:6:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:6:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:6:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:7:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:7:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:7:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:8:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:8:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:8:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'seamark:notice:9:system') == mapcss._value_capture(capture_tags, 0, u'cevni') and mapcss._tag_capture(capture_tags, 1, tags, u'seamark:notice:9:function') != mapcss._value_capture(capture_tags, 1, u'information') and mapcss._tag_capture(capture_tags, 2, tags, u'seamark:notice:9:category') == mapcss._value_capture(capture_tags, 2, u'berthing_lateral_limit')) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -1043,7 +1093,7 @@ def node(self, data, tags): except mapcss.RuleAbort: pass if match: # throwWarning:tr("In {0} {1}={2} require {3}={4}","{0.value}","{2.key}","{2.value}","{1.key}","{1.value}") - err.append({'class': 9012009, 'subclass': 838520301, 'text': mapcss.tr(u'In {0} {1}={2} require {3}={4}', mapcss._tag_uncapture(capture_tags, u'{0.value}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{1.value}'))}) + err.append({'class': 9012009, 'subclass': 196951708, 'text': mapcss.tr(u'In {0} {1}={2} require {3}={4}', mapcss._tag_uncapture(capture_tags, u'{0.value}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{2.value}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{1.value}'))}) # node["seamark:notice:system"=~/bniwr2|ppwbc/]["seamark:notice:bank"!~/right|left/] # node["seamark:notice:1:system"=~/bniwr2|ppwbc/]["seamark:notice:1:bank"!~/right|left/] diff --git a/plugins/Josm_addresses.py b/plugins/Josm_addresses.py index 747d2fa44..ccc2dd532 100644 --- a/plugins/Josm_addresses.py +++ b/plugins/Josm_addresses.py @@ -14,14 +14,16 @@ def init(self, logger): Plugin.init(self, logger) tags = capture_tags = {} self.errors[9000003] = {'item': 9000, 'level': 3, 'tag': ["tag", "addr"], 'desc': mapcss.tr(u'Same value of {0} and {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))} + self.errors[9000004] = {'item': 9000, 'level': 3, 'tag': ["tag", "addr"], 'desc': mapcss.tr(u'{0} without number', mapcss._tag_uncapture(capture_tags, u'{0.key}'))} + self.re_4983542e = re.compile(r'[0-9]') def node(self, data, tags): capture_tags = {} keys = tags.keys() err = [] - + set_ok_housenumber = False # *[addr:housenumber][addr:housename]["addr:housenumber"=*"addr:housename"] if (u'addr:housename' in keys and u'addr:housenumber' in keys): @@ -36,13 +38,35 @@ def node(self, data, tags): # assertNoMatch:"node addr:housename=1 addr:housenumber=2" err.append({'class': 9000003, 'subclass': 1820984183, 'text': mapcss.tr(u'Same value of {0} and {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # *[addr:housenumber=bb][inside("BA")] + if (u'addr:housenumber' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber') == mapcss._value_capture(capture_tags, 0, u'bb') and mapcss.inside(self.father.config.options, u'BA')) + except mapcss.RuleAbort: pass + if match: + # setok_housenumber + set_ok_housenumber = True + + # *[addr:housenumber][addr:housenumber!~/[0-9]/]!.ok_housenumber + if (u'addr:housenumber' in keys): + match = False + if not match: + capture_tags = {} + try: match = (not set_ok_housenumber and mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4983542e), mapcss._tag_capture(capture_tags, 1, tags, u'addr:housenumber'))) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("{0} without number","{0.key}") + err.append({'class': 9000004, 'subclass': 1053226919, 'text': mapcss.tr(u'{0} without number', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + return err def way(self, data, tags, nds): capture_tags = {} keys = tags.keys() err = [] - + set_ok_housenumber = False # *[addr:housenumber][addr:housename]["addr:housenumber"=*"addr:housename"] if (u'addr:housename' in keys and u'addr:housenumber' in keys): @@ -55,13 +79,42 @@ def way(self, data, tags, nds): # throwWarning:tr("Same value of {0} and {1}","{0.key}","{1.key}") err.append({'class': 9000003, 'subclass': 1820984183, 'text': mapcss.tr(u'Same value of {0} and {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # *[addr:housenumber=bb][inside("BA")] + if (u'addr:housenumber' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber') == mapcss._value_capture(capture_tags, 0, u'bb') and mapcss.inside(self.father.config.options, u'BA')) + except mapcss.RuleAbort: pass + if match: + # setok_housenumber + set_ok_housenumber = True + + # *[addr:housenumber][addr:housenumber!~/[0-9]/]!.ok_housenumber + if (u'addr:housenumber' in keys): + match = False + if not match: + capture_tags = {} + try: match = (not set_ok_housenumber and mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4983542e), mapcss._tag_capture(capture_tags, 1, tags, u'addr:housenumber'))) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("{0} without number","{0.key}") + # assertNoMatch:"way addr:housenumber=0" + # assertNoMatch:"way addr:housenumber=5/1" + # assertNoMatch:"way addr:housenumber=5a" + # assertMatch:"way addr:housenumber=?" + # assertMatch:"way addr:housenumber=Palace of Westminster" + # assertMatch:"way addr:housenumber=S/N" + # assertMatch:"way addr:housenumber=unknown" + err.append({'class': 9000004, 'subclass': 1053226919, 'text': mapcss.tr(u'{0} without number', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + return err def relation(self, data, tags, members): capture_tags = {} keys = tags.keys() err = [] - + set_ok_housenumber = False # *[addr:housenumber][addr:housename]["addr:housenumber"=*"addr:housename"] if (u'addr:housename' in keys and u'addr:housenumber' in keys): @@ -74,6 +127,28 @@ def relation(self, data, tags, members): # throwWarning:tr("Same value of {0} and {1}","{0.key}","{1.key}") err.append({'class': 9000003, 'subclass': 1820984183, 'text': mapcss.tr(u'Same value of {0} and {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # *[addr:housenumber=bb][inside("BA")] + if (u'addr:housenumber' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber') == mapcss._value_capture(capture_tags, 0, u'bb') and mapcss.inside(self.father.config.options, u'BA')) + except mapcss.RuleAbort: pass + if match: + # setok_housenumber + set_ok_housenumber = True + + # *[addr:housenumber][addr:housenumber!~/[0-9]/]!.ok_housenumber + if (u'addr:housenumber' in keys): + match = False + if not match: + capture_tags = {} + try: match = (not set_ok_housenumber and mapcss._tag_capture(capture_tags, 0, tags, u'addr:housenumber') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_4983542e), mapcss._tag_capture(capture_tags, 1, tags, u'addr:housenumber'))) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("{0} without number","{0.key}") + err.append({'class': 9000004, 'subclass': 1053226919, 'text': mapcss.tr(u'{0} without number', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + return err @@ -93,3 +168,10 @@ class father: self.check_err(n.node(data, {u'addr:housename': u'1', u'addr:housenumber': u'1'}), expected={'class': 9000003, 'subclass': 1820984183}) self.check_not_err(n.node(data, {u'addr:housename': u'1', u'addr:housenumber': u'2'}), expected={'class': 9000003, 'subclass': 1820984183}) + self.check_not_err(n.way(data, {u'addr:housenumber': u'0'}, [0]), expected={'class': 9000004, 'subclass': 1053226919}) + self.check_not_err(n.way(data, {u'addr:housenumber': u'5/1'}, [0]), expected={'class': 9000004, 'subclass': 1053226919}) + self.check_not_err(n.way(data, {u'addr:housenumber': u'5a'}, [0]), expected={'class': 9000004, 'subclass': 1053226919}) + self.check_err(n.way(data, {u'addr:housenumber': u'?'}, [0]), expected={'class': 9000004, 'subclass': 1053226919}) + self.check_err(n.way(data, {u'addr:housenumber': u'Palace of Westminster'}, [0]), expected={'class': 9000004, 'subclass': 1053226919}) + self.check_err(n.way(data, {u'addr:housenumber': u'S/N'}, [0]), expected={'class': 9000004, 'subclass': 1053226919}) + self.check_err(n.way(data, {u'addr:housenumber': u'unknown'}, [0]), expected={'class': 9000004, 'subclass': 1053226919}) diff --git a/plugins/Josm_combinations.py b/plugins/Josm_combinations.py index aa38ca252..f325d3ea4 100644 --- a/plugins/Josm_combinations.py +++ b/plugins/Josm_combinations.py @@ -27,15 +27,19 @@ def init(self, logger): self.re_25d98c90 = re.compile(r'_name$') self.re_27d9cb1c = re.compile(r'^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$') self.re_29fa4401 = re.compile(r'^(beach|bare_rock|cliff|peak|water)$') + self.re_3b1153a4 = re.compile(r'^plant:') self.re_3b4f8f73 = re.compile(r'^(recreation_ground|piste|farm|farmland)$') self.re_46fc3877 = re.compile(r'^(river|canal|lock)$') self.re_4f156c8f = re.compile(r'^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$') self.re_4fbfe59b = re.compile(r'^(water|spring)$') + self.re_503776bb = re.compile(r'^generator:') self.re_521b2098 = re.compile(r'water|bay|strait') + self.re_5c52f7d8 = re.compile(r'^(sand|mud)$') self.re_5cf0a79f = re.compile(r'^(parking|parking_space|parking_entrance|motorcycle_parking)$') self.re_5ee853b2 = re.compile(r'^(ferry|road)$') self.re_64c931ef = re.compile(r'^(pub|restaurant|swimming_pool)$') self.re_68c05e86 = re.compile(r'^(wall|retaining_wall)$') + self.re_6f957488 = re.compile(r'^(unpaved|compacted|gravel|fine_gravel|pebblestone|ground|earth|dirt|grass|sand|mud|ice|salt|snow|woodchips)$') self.re_7346b495 = re.compile(r':backward') @@ -304,6 +308,8 @@ def node(self, data, tags): # throwWarning:tr("{0} without {1} or {2}","{0.key}","{1.tag}","{2.tag}") err.append({'class': 9001001, 'subclass': 1195794842, 'text': mapcss.tr(u'{0} without {1} or {2}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'), mapcss._tag_uncapture(capture_tags, u'{2.tag}'))}) + # node[traffic_sign=maxspeed][!maxspeed] + # node[actuator=manual][!handle] # node[emergency=fire_hydrant][!fire_hydrant:type] # *[tourism=information][!information] # *[leisure=pitch][!sport] @@ -311,8 +317,16 @@ def node(self, data, tags): # *[power=generator][!generator:source] # *[amenity=social_facility][!social_facility] # *[amenity=place_of_worship][!religion] - if (u'aeroway' in keys) or (u'amenity' in keys) or (u'emergency' in keys) or (u'leisure' in keys) or (u'power' in keys) or (u'tourism' in keys): + if (u'actuator' in keys) or (u'aeroway' in keys) or (u'amenity' in keys) or (u'emergency' in keys) or (u'leisure' in keys) or (u'power' in keys) or (u'tourism' in keys) or (u'traffic_sign' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'traffic_sign') == mapcss._value_capture(capture_tags, 0, u'maxspeed') and not mapcss._tag_capture(capture_tags, 1, tags, u'maxspeed')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'actuator') == mapcss._value_capture(capture_tags, 0, u'manual') and not mapcss._tag_capture(capture_tags, 1, tags, u'handle')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'fire_hydrant') and not mapcss._tag_capture(capture_tags, 1, tags, u'fire_hydrant:type')) @@ -344,7 +358,7 @@ def node(self, data, tags): if match: # group:tr("missing tag") # throwWarning:tr("{0} without {1}","{0.tag}","{1.key}") - err.append({'class': 9001001, 'subclass': 1599415806, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9001001, 'subclass': 534790361, 'text': mapcss.tr(u'{0} without {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) # *[smoothness][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$/] # *[segregated][!highway][railway!=crossing] @@ -416,13 +430,33 @@ def node(self, data, tags): # throwWarning:tr("{0} without {1}, {2} or {3}","{0.key}","{1.key}","{2.key}","{3.tag}") err.append({'class': 9001001, 'subclass': 1689494174, 'text': mapcss.tr(u'{0} without {1}, {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.tag}'))}) + # *[power=plant][/^generator:/] + # *[power=generator][/^plant:/] + # *[power=plant][voltage] + # *[power=plant][frequency] # *[internet_access=no][internet_access:fee] # node[power=transformer][voltage] # node[transformer=distribution][voltage][power=pole] # *[amenity=vending_machine][shop] # *[noname?][name] - if (u'amenity' in keys and u'shop' in keys) or (u'internet_access' in keys and u'internet_access:fee' in keys) or (u'name' in keys and u'noname' in keys) or (u'power' in keys and u'transformer' in keys and u'voltage' in keys) or (u'power' in keys and u'voltage' in keys): + if (u'amenity' in keys and u'shop' in keys) or (u'frequency' in keys and u'power' in keys) or (u'internet_access' in keys and u'internet_access:fee' in keys) or (u'name' in keys and u'noname' in keys) or (u'power' in keys) or (u'power' in keys and u'transformer' in keys and u'voltage' in keys) or (u'power' in keys and u'voltage' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, self.re_503776bb)) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'generator') and mapcss._tag_capture(capture_tags, 1, tags, self.re_3b1153a4)) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, u'voltage')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, u'frequency')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'internet_access') == mapcss._value_capture(capture_tags, 0, u'no') and mapcss._tag_capture(capture_tags, 1, tags, u'internet_access:fee')) @@ -446,7 +480,24 @@ def node(self, data, tags): if match: # group:tr("suspicious tag combination") # throwWarning:tr("{0} together with {1}","{0.tag}","{1.key}") - err.append({'class': 9001002, 'subclass': 1007113564, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9001002, 'subclass': 93781778, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + + # *[building:part][building] + # *[addr:street][addr:place] + if (u'addr:place' in keys and u'addr:street' in keys) or (u'building' in keys and u'building:part' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:part') and mapcss._tag_capture(capture_tags, 1, tags, u'building')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and mapcss._tag_capture(capture_tags, 1, tags, u'addr:place')) + except mapcss.RuleAbort: pass + if match: + # group:tr("suspicious tag combination") + # throwWarning:tr("{0} together with {1}","{0.key}","{1.key}") + err.append({'class': 9001002, 'subclass': 2125953568, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) # *[access][eval(number_of_tags())=1] # *[area][eval(number_of_tags())=1]!.area_yes_autofix @@ -545,28 +596,28 @@ def node(self, data, tags): # throwWarning:tr("{0} together with {1} and conflicting values","{1.key}","{2.key}") err.append({'class': 9001002, 'subclass': 1415856502, 'text': mapcss.tr(u'{0} together with {1} and conflicting values', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[tunnel][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor] - # *[bridge][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=bridge][building!=bridge] - # *[psv][!highway][!railway][!waterway][amenity!~/^parking.*/] - # *[width][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone] + # *[tunnel][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing] + # *[bridge][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=bridge][building!=bridge] + # *[psv][!highway][!railway][!waterway][barrier!=bollard][amenity!~/^parking.*/] + # *[width][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track] # *[maxspeed][!highway][!railway][traffic_sign!~/^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][type!=enforcement][waterway!~/^(river|canal|lock)$/][!traffic_calming][aerialway!=zip_line] if (u'bridge' in keys) or (u'maxspeed' in keys) or (u'psv' in keys) or (u'tunnel' in keys) or (u'width' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tunnel') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tunnel') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'wildlife_crossing')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'bridge') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'bridge') and mapcss._tag_capture(capture_tags, 10, tags, u'building') != mapcss._value_capture(capture_tags, 10, u'bridge')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'bridge') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'wildlife_crossing') and mapcss._tag_capture(capture_tags, 10, tags, u'man_made') != mapcss._value_capture(capture_tags, 10, u'bridge') and mapcss._tag_capture(capture_tags, 11, tags, u'building') != mapcss._value_capture(capture_tags, 11, u'bridge')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'psv') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_213d4d09), mapcss._tag_capture(capture_tags, 4, tags, u'amenity'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'psv') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and mapcss._tag_capture(capture_tags, 4, tags, u'barrier') != mapcss._value_capture(capture_tags, 4, u'bollard') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_213d4d09), mapcss._tag_capture(capture_tags, 5, tags, u'amenity'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'width') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'aeroway') and not mapcss._tag_capture(capture_tags, 5, tags, u'cycleway') and not mapcss._tag_capture(capture_tags, 6, tags, u'footway') and not mapcss._tag_capture(capture_tags, 7, tags, u'barrier') and not mapcss._tag_capture(capture_tags, 8, tags, u'man_made') and not mapcss._tag_capture(capture_tags, 9, tags, u'entrance') and mapcss._tag_capture(capture_tags, 10, tags, u'natural') != mapcss._value_capture(capture_tags, 10, u'stone')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'width') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'aeroway') and not mapcss._tag_capture(capture_tags, 5, tags, u'cycleway') and not mapcss._tag_capture(capture_tags, 6, tags, u'footway') and not mapcss._tag_capture(capture_tags, 7, tags, u'barrier') and not mapcss._tag_capture(capture_tags, 8, tags, u'man_made') and not mapcss._tag_capture(capture_tags, 9, tags, u'entrance') and mapcss._tag_capture(capture_tags, 10, tags, u'natural') != mapcss._value_capture(capture_tags, 10, u'stone') and mapcss._tag_capture(capture_tags, 11, tags, u'leisure') != mapcss._value_capture(capture_tags, 11, u'track')) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -575,7 +626,7 @@ def node(self, data, tags): if match: # group:tr("suspicious tag combination") # throwWarning:tr("{0} on suspicious object","{0.key}") - err.append({'class': 9001002, 'subclass': 755649879, 'text': mapcss.tr(u'{0} on suspicious object', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9001002, 'subclass': 1334545086, 'text': mapcss.tr(u'{0} on suspicious object', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) # *[highway][waterway][waterway!=dam][waterway!=weir] # *[landuse][building][landuse!=retail] @@ -1301,6 +1352,10 @@ def way(self, data, tags, nds): # throwWarning:tr("{0} without {1}, {2} or {3}","{0.key}","{1.key}","{2.key}","{3.tag}") err.append({'class': 9001001, 'subclass': 1537476943, 'text': mapcss.tr(u'{0} without {1}, {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.tag}'))}) + # *[power=plant][/^generator:/] + # *[power=generator][/^plant:/] + # *[power=plant][voltage] + # *[power=plant][frequency] # *[internet_access=no][internet_access:fee] # *[amenity=vending_machine][shop] # *[noname?][name] @@ -1308,8 +1363,24 @@ def way(self, data, tags, nds): # way[oneway=yes][/:forward/][!traffic_sign:forward][bicycle:forward!=use_sidepath][oneway:bicycle!=no][oneway:psv!=no] # way[oneway=-1][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][oneway:bicycle!=no][oneway:psv!=no] # way[oneway=-1][/:forward/][!traffic_sign:forward][bicycle:forward!=use_sidepath][oneway:bicycle!=no][oneway:psv!=no] - if (u'amenity' in keys and u'shop' in keys) or (u'internet_access' in keys and u'internet_access:fee' in keys) or (u'name' in keys and u'noname' in keys) or (u'oneway' in keys): + if (u'amenity' in keys and u'shop' in keys) or (u'frequency' in keys and u'power' in keys) or (u'internet_access' in keys and u'internet_access:fee' in keys) or (u'name' in keys and u'noname' in keys) or (u'oneway' in keys) or (u'power' in keys) or (u'power' in keys and u'voltage' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, self.re_503776bb)) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'generator') and mapcss._tag_capture(capture_tags, 1, tags, self.re_3b1153a4)) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, u'voltage')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, u'frequency')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'internet_access') == mapcss._value_capture(capture_tags, 0, u'no') and mapcss._tag_capture(capture_tags, 1, tags, u'internet_access:fee')) @@ -1341,15 +1412,31 @@ def way(self, data, tags, nds): if match: # group:tr("suspicious tag combination") # throwWarning:tr("{0} together with {1}","{0.tag}","{1.key}") - err.append({'class': 9001002, 'subclass': 1074257170, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # assertMatch:"way power=generator plant:source=combustion" + # assertMatch:"way power=plant generator:source=wind" + err.append({'class': 9001002, 'subclass': 1953339020, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # way[junction=yes][highway] + # way[tracktype=grade1][surface][surface=~/^(unpaved|compacted|gravel|fine_gravel|pebblestone|ground|earth|dirt|grass|sand|mud|ice|salt|snow|woodchips)$/] + # way[tracktype=grade2][surface][surface=~/^(sand|mud)$/] # way[segregated][bicycle=no] # way[segregated][foot=no] # way[man_made=pipeline][tunnel=flooded] # way[waterway=canal][tunnel=yes] - # way[highway=footway][bicycle=designated] - if (u'bicycle' in keys and u'highway' in keys) or (u'bicycle' in keys and u'segregated' in keys) or (u'foot' in keys and u'segregated' in keys) or (u'man_made' in keys and u'tunnel' in keys) or (u'tunnel' in keys and u'waterway' in keys): + if (u'bicycle' in keys and u'segregated' in keys) or (u'foot' in keys and u'segregated' in keys) or (u'highway' in keys and u'junction' in keys) or (u'man_made' in keys and u'tunnel' in keys) or (u'surface' in keys and u'tracktype' in keys) or (u'tunnel' in keys and u'waterway' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'junction') == mapcss._value_capture(capture_tags, 0, u'yes') and mapcss._tag_capture(capture_tags, 1, tags, u'highway')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tracktype') == mapcss._value_capture(capture_tags, 0, u'grade1') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_6f957488), mapcss._tag_capture(capture_tags, 2, tags, u'surface'))) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tracktype') == mapcss._value_capture(capture_tags, 0, u'grade2') and mapcss._tag_capture(capture_tags, 1, tags, u'surface') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5c52f7d8), mapcss._tag_capture(capture_tags, 2, tags, u'surface'))) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'segregated') and mapcss._tag_capture(capture_tags, 1, tags, u'bicycle') == mapcss._value_capture(capture_tags, 1, u'no')) @@ -1366,14 +1453,45 @@ def way(self, data, tags, nds): capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'waterway') == mapcss._value_capture(capture_tags, 0, u'canal') and mapcss._tag_capture(capture_tags, 1, tags, u'tunnel') == mapcss._value_capture(capture_tags, 1, u'yes')) except mapcss.RuleAbort: pass + if match: + # group:tr("suspicious tag combination") + # throwWarning:tr("{0} together with {1}","{0.tag}","{1.tag}") + err.append({'class': 9001002, 'subclass': 1073363078, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + + # way[highway=footway][bicycle=designated] + # way[highway=cycleway][foot=designated] + if (u'bicycle' in keys and u'highway' in keys) or (u'foot' in keys and u'highway' in keys): + match = False if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'footway') and mapcss._tag_capture(capture_tags, 1, tags, u'bicycle') == mapcss._value_capture(capture_tags, 1, u'designated')) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'cycleway') and mapcss._tag_capture(capture_tags, 1, tags, u'foot') == mapcss._value_capture(capture_tags, 1, u'designated')) + except mapcss.RuleAbort: pass if match: # group:tr("suspicious tag combination") # throwWarning:tr("{0} together with {1}","{0.tag}","{1.tag}") - err.append({'class': 9001002, 'subclass': 1606678840, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + # suggestAlternative:"highway=path" + err.append({'class': 9001002, 'subclass': 892898288, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + + # *[building:part][building] + # *[addr:street][addr:place] + if (u'addr:place' in keys and u'addr:street' in keys) or (u'building' in keys and u'building:part' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:part') and mapcss._tag_capture(capture_tags, 1, tags, u'building')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and mapcss._tag_capture(capture_tags, 1, tags, u'addr:place')) + except mapcss.RuleAbort: pass + if match: + # group:tr("suspicious tag combination") + # throwWarning:tr("{0} together with {1}","{0.key}","{1.key}") + err.append({'class': 9001002, 'subclass': 2125953568, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) # way[waterway][bridge=yes][waterway!=weir] if (u'bridge' in keys and u'waterway' in keys): @@ -1561,28 +1679,28 @@ def way(self, data, tags, nds): # suggestAlternative:"highway=path + foot=designated + bicycle=designated + segregated=yes" err.append({'class': 9001002, 'subclass': 393240150, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) - # *[tunnel][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor] - # *[bridge][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=bridge][building!=bridge] - # *[psv][!highway][!railway][!waterway][amenity!~/^parking.*/] - # *[width][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone] + # *[tunnel][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing] + # *[bridge][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=bridge][building!=bridge] + # *[psv][!highway][!railway][!waterway][barrier!=bollard][amenity!~/^parking.*/] + # *[width][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track] # *[maxspeed][!highway][!railway][traffic_sign!~/^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][type!=enforcement][waterway!~/^(river|canal|lock)$/][!traffic_calming][aerialway!=zip_line] if (u'bridge' in keys) or (u'maxspeed' in keys) or (u'psv' in keys) or (u'tunnel' in keys) or (u'width' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tunnel') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tunnel') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'wildlife_crossing')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'bridge') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'bridge') and mapcss._tag_capture(capture_tags, 10, tags, u'building') != mapcss._value_capture(capture_tags, 10, u'bridge')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'bridge') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'wildlife_crossing') and mapcss._tag_capture(capture_tags, 10, tags, u'man_made') != mapcss._value_capture(capture_tags, 10, u'bridge') and mapcss._tag_capture(capture_tags, 11, tags, u'building') != mapcss._value_capture(capture_tags, 11, u'bridge')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'psv') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_213d4d09), mapcss._tag_capture(capture_tags, 4, tags, u'amenity'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'psv') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and mapcss._tag_capture(capture_tags, 4, tags, u'barrier') != mapcss._value_capture(capture_tags, 4, u'bollard') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_213d4d09), mapcss._tag_capture(capture_tags, 5, tags, u'amenity'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'width') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'aeroway') and not mapcss._tag_capture(capture_tags, 5, tags, u'cycleway') and not mapcss._tag_capture(capture_tags, 6, tags, u'footway') and not mapcss._tag_capture(capture_tags, 7, tags, u'barrier') and not mapcss._tag_capture(capture_tags, 8, tags, u'man_made') and not mapcss._tag_capture(capture_tags, 9, tags, u'entrance') and mapcss._tag_capture(capture_tags, 10, tags, u'natural') != mapcss._value_capture(capture_tags, 10, u'stone')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'width') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'aeroway') and not mapcss._tag_capture(capture_tags, 5, tags, u'cycleway') and not mapcss._tag_capture(capture_tags, 6, tags, u'footway') and not mapcss._tag_capture(capture_tags, 7, tags, u'barrier') and not mapcss._tag_capture(capture_tags, 8, tags, u'man_made') and not mapcss._tag_capture(capture_tags, 9, tags, u'entrance') and mapcss._tag_capture(capture_tags, 10, tags, u'natural') != mapcss._value_capture(capture_tags, 10, u'stone') and mapcss._tag_capture(capture_tags, 11, tags, u'leisure') != mapcss._value_capture(capture_tags, 11, u'track')) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -1591,7 +1709,7 @@ def way(self, data, tags, nds): if match: # group:tr("suspicious tag combination") # throwWarning:tr("{0} on suspicious object","{0.key}") - err.append({'class': 9001002, 'subclass': 755649879, 'text': mapcss.tr(u'{0} on suspicious object', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9001002, 'subclass': 1334545086, 'text': mapcss.tr(u'{0} on suspicious object', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) # way[highway][barrier] # *[highway][waterway][waterway!=dam][waterway!=weir] @@ -1909,12 +2027,12 @@ def way(self, data, tags, nds): # assertNoMatch:"way highway=primary lanes=4" err.append({'class': 9001001, 'subclass': 841292752, 'text': mapcss.tr(u'street with odd number of {0}, but without {1} and {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.key}'), mapcss._tag_uncapture(capture_tags, u'{4.key}'))}) - # way[highway=pedestrian][width][width<2] + # way[highway=pedestrian][width][width<3] if (u'highway' in keys and u'width' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'pedestrian') and mapcss._tag_capture(capture_tags, 1, tags, u'width') and mapcss._tag_capture(capture_tags, 2, tags, u'width') < mapcss._value_capture(capture_tags, 2, 2)) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'pedestrian') and mapcss._tag_capture(capture_tags, 1, tags, u'width') and mapcss._tag_capture(capture_tags, 2, tags, u'width') < mapcss._value_capture(capture_tags, 2, 3)) except mapcss.RuleAbort: pass if match: # group:tr("suspicious tag combination") @@ -1923,9 +2041,9 @@ def way(self, data, tags, nds): # fixAdd:"highway=footway" # assertMatch:"way highway=pedestrian width=0.8" # assertMatch:"way highway=pedestrian width=1" - # assertNoMatch:"way highway=pedestrian width=2" + # assertNoMatch:"way highway=pedestrian width=3" # assertNoMatch:"way highway=pedestrian width=5.5" - err.append({'class': 9001002, 'subclass': 1649889582, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9001002, 'subclass': 867332242, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'highway',u'footway']]) }}) @@ -2311,11 +2429,31 @@ def relation(self, data, tags, members): # throwWarning:tr("{0} without {1}, {2} or {3}","{0.key}","{1.key}","{2.key}","{3.tag}") err.append({'class': 9001001, 'subclass': 1689494174, 'text': mapcss.tr(u'{0} without {1}, {2} or {3}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'), mapcss._tag_uncapture(capture_tags, u'{3.tag}'))}) + # *[power=plant][/^generator:/] + # *[power=generator][/^plant:/] + # *[power=plant][voltage] + # *[power=plant][frequency] # *[internet_access=no][internet_access:fee] # *[amenity=vending_machine][shop] # *[noname?][name] - if (u'amenity' in keys and u'shop' in keys) or (u'internet_access' in keys and u'internet_access:fee' in keys) or (u'name' in keys and u'noname' in keys): + if (u'amenity' in keys and u'shop' in keys) or (u'frequency' in keys and u'power' in keys) or (u'internet_access' in keys and u'internet_access:fee' in keys) or (u'name' in keys and u'noname' in keys) or (u'power' in keys) or (u'power' in keys and u'voltage' in keys): match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, self.re_503776bb)) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'generator') and mapcss._tag_capture(capture_tags, 1, tags, self.re_3b1153a4)) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, u'voltage')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'power') == mapcss._value_capture(capture_tags, 0, u'plant') and mapcss._tag_capture(capture_tags, 1, tags, u'frequency')) + except mapcss.RuleAbort: pass if not match: capture_tags = {} try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'internet_access') == mapcss._value_capture(capture_tags, 0, u'no') and mapcss._tag_capture(capture_tags, 1, tags, u'internet_access:fee')) @@ -2331,7 +2469,7 @@ def relation(self, data, tags, members): if match: # group:tr("suspicious tag combination") # throwWarning:tr("{0} together with {1}","{0.tag}","{1.key}") - err.append({'class': 9001002, 'subclass': 1004083393, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + err.append({'class': 9001002, 'subclass': 196575680, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) # relation[type=multipolygon][area=no] if (u'area' in keys and u'type' in keys): @@ -2345,6 +2483,23 @@ def relation(self, data, tags, members): # throwError:tr("{0} together with {1}","{0.tag}","{1.tag}") err.append({'class': 9001002, 'subclass': 1091177792, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}'))}) + # *[building:part][building] + # *[addr:street][addr:place] + if (u'addr:place' in keys and u'addr:street' in keys) or (u'building' in keys and u'building:part' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'building:part') and mapcss._tag_capture(capture_tags, 1, tags, u'building')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'addr:street') and mapcss._tag_capture(capture_tags, 1, tags, u'addr:place')) + except mapcss.RuleAbort: pass + if match: + # group:tr("suspicious tag combination") + # throwWarning:tr("{0} together with {1}","{0.key}","{1.key}") + err.append({'class': 9001002, 'subclass': 2125953568, 'text': mapcss.tr(u'{0} together with {1}', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{1.key}'))}) + # *[access][eval(number_of_tags())=1] # *[area][eval(number_of_tags())=1]!.area_yes_autofix # *[name][eval(number_of_tags())=1] @@ -2439,28 +2594,28 @@ def relation(self, data, tags, members): # throwWarning:tr("{0} together with {1} and conflicting values","{1.key}","{2.key}") err.append({'class': 9001002, 'subclass': 1415856502, 'text': mapcss.tr(u'{0} together with {1} and conflicting values', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{2.key}'))}) - # *[tunnel][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor] - # *[bridge][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=bridge][building!=bridge] - # *[psv][!highway][!railway][!waterway][amenity!~/^parking.*/] - # *[width][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone] + # *[tunnel][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing] + # *[bridge][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=bridge][building!=bridge] + # *[psv][!highway][!railway][!waterway][barrier!=bollard][amenity!~/^parking.*/] + # *[width][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track] # *[maxspeed][!highway][!railway][traffic_sign!~/^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][type!=enforcement][waterway!~/^(river|canal|lock)$/][!traffic_calming][aerialway!=zip_line] if (u'bridge' in keys) or (u'maxspeed' in keys) or (u'psv' in keys) or (u'tunnel' in keys) or (u'width' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tunnel') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'tunnel') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'wildlife_crossing')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'bridge') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'bridge') and mapcss._tag_capture(capture_tags, 10, tags, u'building') != mapcss._value_capture(capture_tags, 10, u'bridge')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'bridge') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'piste:type') and mapcss._tag_capture(capture_tags, 5, tags, u'public_transport') != mapcss._value_capture(capture_tags, 5, u'platform') and mapcss._tag_capture(capture_tags, 6, tags, u'route') != mapcss._value_capture(capture_tags, 6, u'ferry') and mapcss._tag_capture(capture_tags, 7, tags, u'man_made') != mapcss._value_capture(capture_tags, 7, u'pipeline') and mapcss._tag_capture(capture_tags, 8, tags, u'man_made') != mapcss._value_capture(capture_tags, 8, u'goods_conveyor') and mapcss._tag_capture(capture_tags, 9, tags, u'man_made') != mapcss._value_capture(capture_tags, 9, u'wildlife_crossing') and mapcss._tag_capture(capture_tags, 10, tags, u'man_made') != mapcss._value_capture(capture_tags, 10, u'bridge') and mapcss._tag_capture(capture_tags, 11, tags, u'building') != mapcss._value_capture(capture_tags, 11, u'bridge')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'psv') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_213d4d09), mapcss._tag_capture(capture_tags, 4, tags, u'amenity'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'psv') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and mapcss._tag_capture(capture_tags, 4, tags, u'barrier') != mapcss._value_capture(capture_tags, 4, u'bollard') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 5, self.re_213d4d09), mapcss._tag_capture(capture_tags, 5, tags, u'amenity'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'width') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'aeroway') and not mapcss._tag_capture(capture_tags, 5, tags, u'cycleway') and not mapcss._tag_capture(capture_tags, 6, tags, u'footway') and not mapcss._tag_capture(capture_tags, 7, tags, u'barrier') and not mapcss._tag_capture(capture_tags, 8, tags, u'man_made') and not mapcss._tag_capture(capture_tags, 9, tags, u'entrance') and mapcss._tag_capture(capture_tags, 10, tags, u'natural') != mapcss._value_capture(capture_tags, 10, u'stone')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'width') and not mapcss._tag_capture(capture_tags, 1, tags, u'highway') and not mapcss._tag_capture(capture_tags, 2, tags, u'railway') and not mapcss._tag_capture(capture_tags, 3, tags, u'waterway') and not mapcss._tag_capture(capture_tags, 4, tags, u'aeroway') and not mapcss._tag_capture(capture_tags, 5, tags, u'cycleway') and not mapcss._tag_capture(capture_tags, 6, tags, u'footway') and not mapcss._tag_capture(capture_tags, 7, tags, u'barrier') and not mapcss._tag_capture(capture_tags, 8, tags, u'man_made') and not mapcss._tag_capture(capture_tags, 9, tags, u'entrance') and mapcss._tag_capture(capture_tags, 10, tags, u'natural') != mapcss._value_capture(capture_tags, 10, u'stone') and mapcss._tag_capture(capture_tags, 11, tags, u'leisure') != mapcss._value_capture(capture_tags, 11, u'track')) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -2469,7 +2624,7 @@ def relation(self, data, tags, members): if match: # group:tr("suspicious tag combination") # throwWarning:tr("{0} on suspicious object","{0.key}") - err.append({'class': 9001002, 'subclass': 755649879, 'text': mapcss.tr(u'{0} on suspicious object', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + err.append({'class': 9001002, 'subclass': 1334545086, 'text': mapcss.tr(u'{0} on suspicious object', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) # *[highway][waterway][waterway!=dam][waterway!=weir] # *[landuse][building][landuse!=retail] @@ -2640,12 +2795,14 @@ class father: self.check_err(n.node(data, {u'sport': u'tennis'}), expected={'class': 9001001, 'subclass': 1631566710}) self.check_not_err(n.way(data, {u'highway': u'unclassified', u'lanes': u'42'}, [0]), expected={'class': 9001001, 'subclass': 2049980645}) self.check_err(n.way(data, {u'lanes': u'42'}, [0]), expected={'class': 9001001, 'subclass': 2049980645}) + self.check_err(n.way(data, {u'plant:source': u'combustion', u'power': u'generator'}, [0]), expected={'class': 9001002, 'subclass': 1953339020}) + self.check_err(n.way(data, {u'generator:source': u'wind', u'power': u'plant'}, [0]), expected={'class': 9001002, 'subclass': 1953339020}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'2'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'3', u'lanes:backward': u'2'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'3', u'oneway': u'-1'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_err(n.way(data, {u'highway': u'primary', u'lanes': u'3'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) self.check_not_err(n.way(data, {u'highway': u'primary', u'lanes': u'4'}, [0]), expected={'class': 9001001, 'subclass': 841292752}) - self.check_err(n.way(data, {u'highway': u'pedestrian', u'width': u'0.8'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) - self.check_err(n.way(data, {u'highway': u'pedestrian', u'width': u'1'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) - self.check_not_err(n.way(data, {u'highway': u'pedestrian', u'width': u'2'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) - self.check_not_err(n.way(data, {u'highway': u'pedestrian', u'width': u'5.5'}, [0]), expected={'class': 9001002, 'subclass': 1649889582}) + self.check_err(n.way(data, {u'highway': u'pedestrian', u'width': u'0.8'}, [0]), expected={'class': 9001002, 'subclass': 867332242}) + self.check_err(n.way(data, {u'highway': u'pedestrian', u'width': u'1'}, [0]), expected={'class': 9001002, 'subclass': 867332242}) + self.check_not_err(n.way(data, {u'highway': u'pedestrian', u'width': u'3'}, [0]), expected={'class': 9001002, 'subclass': 867332242}) + self.check_not_err(n.way(data, {u'highway': u'pedestrian', u'width': u'5.5'}, [0]), expected={'class': 9001002, 'subclass': 867332242}) diff --git a/plugins/Josm_deprecated.py b/plugins/Josm_deprecated.py index cbad513a9..d7c7db93b 100644 --- a/plugins/Josm_deprecated.py +++ b/plugins/Josm_deprecated.py @@ -24,6 +24,7 @@ def init(self, logger): self.errors[9002011] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'key with uncommon character')} self.errors[9002012] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'uncommon short key')} self.errors[9002013] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'{0} is inaccurate. Use separate tags for each specific type, e.g. {1} or {2}.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'payment:bitcoin=yes', u'payment:litecoin=yes')} + self.errors[9002014] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'questionable key (ending with a number)')} self.errors[9002015] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'{0}={1} is unspecific. Please replace \'\'{1}\'\' by \'\'left\'\', \'\'right\'\' or \'\'both\'\'.', mapcss._tag_uncapture(capture_tags, u'{0.key}'), mapcss._tag_uncapture(capture_tags, u'{0.value}'))} self.errors[9002016] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'{0} is not recommended. Use the Reverse Ways function from the Tools menu.', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} self.errors[9002017] = {'item': 9002, 'level': 3, 'tag': ["tag", "deprecated"], 'desc': mapcss.tr(u'The key {0} has an uncommon value.', mapcss._tag_uncapture(capture_tags, u'{1.key}'))} @@ -36,11 +37,15 @@ def init(self, logger): self.re_1f92073a = re.compile(r'^(?i)fixme$') self.re_27210286 = re.compile(r'^.$') self.re_2fd4cdcf = re.compile(r'^(crossover|siding|spur|yard)$') + self.re_300dfa36 = re.compile(r'^[^t][^i][^g].+_[0-9]$') + self.re_3185ac6d = re.compile(r'^note_[0-9]$') self.re_34c15d62 = re.compile(r'^..$') + self.re_493fd1a6 = re.compile(r'^is_in:.*$') self.re_554de4c7 = re.compile(r':color') self.re_5ee0acf2 = re.compile(r'josm\/ignore') self.re_61b0be1b = re.compile(r'^(buoy_cardinal|buoy_installation|buoy_isolated_danger|buoy_lateral|buoy_safe_water|buoy_special_purpose|mooring)$') self.re_620f4d52 = re.compile(r'=|\+|\/|&|<|>|;|\'|\"|%|#|@|\\|,|\.|\{|\}|\?|\*|\^|\$') + self.re_6d27b157 = re.compile(r'^description_[0-9]$') self.re_7a045a17 = re.compile(r'^(irrigation|transportation|water_power)$') @@ -278,6 +283,23 @@ def node(self, data, tags): [u'shop',u'bag']]) }}) + # *[shop=fashion] + if (u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'fashion')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"shop=clothes" + # fixAdd:"shop=clothes" + err.append({'class': 9002001, 'subclass': 985619804, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'shop',u'clothes']]) + }}) + # *[shop=organic] if (u'shop' in keys): match = False @@ -2263,6 +2285,18 @@ def node(self, data, tags): u'amenity']) }}) + # *[/^[^t][^i][^g].+_[0-9]$/][!/^note_[0-9]$/][!/^description_[0-9]$/] + if True: + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_300dfa36) and not mapcss._tag_capture(capture_tags, 1, tags, self.re_3185ac6d) and not mapcss._tag_capture(capture_tags, 2, tags, self.re_6d27b157)) + except mapcss.RuleAbort: pass + if match: + # group:tr("questionable key (ending with a number)") + # throwWarning:tr("{0}","{0.key}") + err.append({'class': 9002014, 'subclass': 2081989305, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[sport=skating] if (u'sport' in keys): match = False @@ -2898,6 +2932,133 @@ def node(self, data, tags): u'natural']) }}) + # *[religion=unitarian] + if (u'religion' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'religion') == mapcss._value_capture(capture_tags, 0, u'unitarian')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"religion=unitarian_universalist" + # fixAdd:"religion=unitarian_universalist" + err.append({'class': 9002001, 'subclass': 9227331, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'religion',u'unitarian_universalist']]) + }}) + + # *[shop=shopping_centre] + if (u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'shopping_centre')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"shop=mall" + # fixAdd:"shop=mall" + err.append({'class': 9002001, 'subclass': 1448390566, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'shop',u'mall']]) + }}) + + # *[is_in] + # node[/^is_in:.*$/] + if True: + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'is_in')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_493fd1a6)) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # fixRemove:"{0.key}" + err.append({'class': 9002001, 'subclass': 355584917, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # *[sport=football] + if (u'sport' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') == mapcss._value_capture(capture_tags, 0, u'football')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"sport=american_football" + # suggestAlternative:"sport=australian_football" + # suggestAlternative:"sport=canadian_football" + # suggestAlternative:"sport=gaelic_games" + # suggestAlternative:"sport=rugby_league" + # suggestAlternative:"sport=rugby_union" + # suggestAlternative:"sport=soccer" + err.append({'class': 9002001, 'subclass': 73038577, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[leisure=common] + if (u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'common')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"designation=common" + # suggestAlternative:"landuse=*" + # suggestAlternative:"leisure=*" + err.append({'class': 9002001, 'subclass': 157636301, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[cuisine=vegan] + # *[cuisine=vegetarian] + if (u'cuisine' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cuisine') == mapcss._value_capture(capture_tags, 0, u'vegan')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cuisine') == mapcss._value_capture(capture_tags, 0, u'vegetarian')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # suggestAlternative:concat("diet:","{0.value}","=only") + # suggestAlternative:concat("diet:","{0.value}","=yes") + # throwWarning:tr("{0} is deprecated","{0.tag}") + err.append({'class': 9002001, 'subclass': 43604574, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[kitchen_hours] + if (u'kitchen_hours' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'kitchen_hours')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # suggestAlternative:"opening_hours:kitchen" + # fixChangeKey:"kitchen_hours => opening_hours:kitchen" + err.append({'class': 9002001, 'subclass': 1088306802, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'opening_hours:kitchen', mapcss.tag(tags, u'kitchen_hours')]]), + '-': ([ + u'kitchen_hours']) + }}) + return err def way(self, data, tags, nds): @@ -3142,6 +3303,23 @@ def way(self, data, tags, nds): [u'shop',u'bag']]) }}) + # *[shop=fashion] + if (u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'fashion')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"shop=clothes" + # fixAdd:"shop=clothes" + err.append({'class': 9002001, 'subclass': 985619804, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'shop',u'clothes']]) + }}) + # *[shop=organic] if (u'shop' in keys): match = False @@ -5175,6 +5353,22 @@ def way(self, data, tags, nds): u'amenity']) }}) + # *[/^[^t][^i][^g].+_[0-9]$/][!/^note_[0-9]$/][!/^description_[0-9]$/] + if True: + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_300dfa36) and not mapcss._tag_capture(capture_tags, 1, tags, self.re_3185ac6d) and not mapcss._tag_capture(capture_tags, 2, tags, self.re_6d27b157)) + except mapcss.RuleAbort: pass + if match: + # group:tr("questionable key (ending with a number)") + # throwWarning:tr("{0}","{0.key}") + # assertNoMatch:"way description_3=foo" + # assertMatch:"way name_1=foo" + # assertNoMatch:"way note_2=foo" + # assertNoMatch:"way tiger:name_base_1=bar" + err.append({'class': 9002014, 'subclass': 2081989305, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[sport=skating] if (u'sport' in keys): match = False @@ -5801,6 +5995,133 @@ def way(self, data, tags, nds): u'natural']) }}) + # *[religion=unitarian] + if (u'religion' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'religion') == mapcss._value_capture(capture_tags, 0, u'unitarian')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"religion=unitarian_universalist" + # fixAdd:"religion=unitarian_universalist" + err.append({'class': 9002001, 'subclass': 9227331, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'religion',u'unitarian_universalist']]) + }}) + + # *[shop=shopping_centre] + if (u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'shopping_centre')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"shop=mall" + # fixAdd:"shop=mall" + err.append({'class': 9002001, 'subclass': 1448390566, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'shop',u'mall']]) + }}) + + # *[is_in] + # way[/^is_in:.*$/] + if True: + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'is_in')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_493fd1a6)) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # fixRemove:"{0.key}" + err.append({'class': 9002001, 'subclass': 1865068642, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # *[sport=football] + if (u'sport' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') == mapcss._value_capture(capture_tags, 0, u'football')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"sport=american_football" + # suggestAlternative:"sport=australian_football" + # suggestAlternative:"sport=canadian_football" + # suggestAlternative:"sport=gaelic_games" + # suggestAlternative:"sport=rugby_league" + # suggestAlternative:"sport=rugby_union" + # suggestAlternative:"sport=soccer" + err.append({'class': 9002001, 'subclass': 73038577, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[leisure=common] + if (u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'common')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"designation=common" + # suggestAlternative:"landuse=*" + # suggestAlternative:"leisure=*" + err.append({'class': 9002001, 'subclass': 157636301, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[cuisine=vegan] + # *[cuisine=vegetarian] + if (u'cuisine' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cuisine') == mapcss._value_capture(capture_tags, 0, u'vegan')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cuisine') == mapcss._value_capture(capture_tags, 0, u'vegetarian')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # suggestAlternative:concat("diet:","{0.value}","=only") + # suggestAlternative:concat("diet:","{0.value}","=yes") + # throwWarning:tr("{0} is deprecated","{0.tag}") + err.append({'class': 9002001, 'subclass': 43604574, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[kitchen_hours] + if (u'kitchen_hours' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'kitchen_hours')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # suggestAlternative:"opening_hours:kitchen" + # fixChangeKey:"kitchen_hours => opening_hours:kitchen" + err.append({'class': 9002001, 'subclass': 1088306802, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'opening_hours:kitchen', mapcss.tag(tags, u'kitchen_hours')]]), + '-': ([ + u'kitchen_hours']) + }}) + return err def relation(self, data, tags, members): @@ -6017,6 +6338,23 @@ def relation(self, data, tags, members): [u'shop',u'bag']]) }}) + # *[shop=fashion] + if (u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'fashion')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"shop=clothes" + # fixAdd:"shop=clothes" + err.append({'class': 9002001, 'subclass': 985619804, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'shop',u'clothes']]) + }}) + # *[shop=organic] if (u'shop' in keys): match = False @@ -7963,6 +8301,18 @@ def relation(self, data, tags, members): u'amenity']) }}) + # *[/^[^t][^i][^g].+_[0-9]$/][!/^note_[0-9]$/][!/^description_[0-9]$/] + if True: + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, self.re_300dfa36) and not mapcss._tag_capture(capture_tags, 1, tags, self.re_3185ac6d) and not mapcss._tag_capture(capture_tags, 2, tags, self.re_6d27b157)) + except mapcss.RuleAbort: pass + if match: + # group:tr("questionable key (ending with a number)") + # throwWarning:tr("{0}","{0.key}") + err.append({'class': 9002014, 'subclass': 2081989305, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[sport=skating] if (u'sport' in keys): match = False @@ -8253,6 +8603,128 @@ def relation(self, data, tags, members): u'natural']) }}) + # *[religion=unitarian] + if (u'religion' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'religion') == mapcss._value_capture(capture_tags, 0, u'unitarian')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"religion=unitarian_universalist" + # fixAdd:"religion=unitarian_universalist" + err.append({'class': 9002001, 'subclass': 9227331, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'religion',u'unitarian_universalist']]) + }}) + + # *[shop=shopping_centre] + if (u'shop' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'shop') == mapcss._value_capture(capture_tags, 0, u'shopping_centre')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"shop=mall" + # fixAdd:"shop=mall" + err.append({'class': 9002001, 'subclass': 1448390566, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'shop',u'mall']]) + }}) + + # *[is_in] + if (u'is_in' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'is_in')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # fixRemove:"{0.key}" + err.append({'class': 9002001, 'subclass': 981454091, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # *[sport=football] + if (u'sport' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'sport') == mapcss._value_capture(capture_tags, 0, u'football')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"sport=american_football" + # suggestAlternative:"sport=australian_football" + # suggestAlternative:"sport=canadian_football" + # suggestAlternative:"sport=gaelic_games" + # suggestAlternative:"sport=rugby_league" + # suggestAlternative:"sport=rugby_union" + # suggestAlternative:"sport=soccer" + err.append({'class': 9002001, 'subclass': 73038577, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[leisure=common] + if (u'leisure' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'leisure') == mapcss._value_capture(capture_tags, 0, u'common')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.tag}") + # suggestAlternative:"designation=common" + # suggestAlternative:"landuse=*" + # suggestAlternative:"leisure=*" + err.append({'class': 9002001, 'subclass': 157636301, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[cuisine=vegan] + # *[cuisine=vegetarian] + if (u'cuisine' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cuisine') == mapcss._value_capture(capture_tags, 0, u'vegan')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'cuisine') == mapcss._value_capture(capture_tags, 0, u'vegetarian')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # suggestAlternative:concat("diet:","{0.value}","=only") + # suggestAlternative:concat("diet:","{0.value}","=yes") + # throwWarning:tr("{0} is deprecated","{0.tag}") + err.append({'class': 9002001, 'subclass': 43604574, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + + # *[kitchen_hours] + if (u'kitchen_hours' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'kitchen_hours')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated","{0.key}") + # suggestAlternative:"opening_hours:kitchen" + # fixChangeKey:"kitchen_hours => opening_hours:kitchen" + err.append({'class': 9002001, 'subclass': 1088306802, 'text': mapcss.tr(u'{0} is deprecated', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'opening_hours:kitchen', mapcss.tag(tags, u'kitchen_hours')]]), + '-': ([ + u'kitchen_hours']) + }}) + return err @@ -8305,5 +8777,9 @@ class father: self.check_err(n.way(data, {u'color:back': u'grey'}, [0]), expected={'class': 9002001, 'subclass': 1390370717}) self.check_not_err(n.way(data, {u'color': u'red'}, [0]), expected={'class': 9002001, 'subclass': 1390370717}) self.check_err(n.way(data, {u'to': u'bar'}, [0]), expected={'class': 9002012, 'subclass': 73953777}) + self.check_not_err(n.way(data, {u'description_3': u'foo'}, [0]), expected={'class': 9002014, 'subclass': 2081989305}) + self.check_err(n.way(data, {u'name_1': u'foo'}, [0]), expected={'class': 9002014, 'subclass': 2081989305}) + self.check_not_err(n.way(data, {u'note_2': u'foo'}, [0]), expected={'class': 9002014, 'subclass': 2081989305}) + self.check_not_err(n.way(data, {u'tiger:name_base_1': u'bar'}, [0]), expected={'class': 9002014, 'subclass': 2081989305}) self.check_err(n.relation(data, {u'fo': u'bar'}, []), expected={'class': 9002012, 'subclass': 518970721}) self.check_not_err(n.relation(data, {u'to': u'Berlin'}, []), expected={'class': 9002012, 'subclass': 518970721}) diff --git a/plugins/Josm_numeric.py b/plugins/Josm_numeric.py index a88f4c990..d00d68d24 100644 --- a/plugins/Josm_numeric.py +++ b/plugins/Josm_numeric.py @@ -24,6 +24,7 @@ def init(self, logger): self.errors[9006018] = {'item': 9006, 'level': 3, 'tag': ["tag", "value"], 'desc': mapcss.tr(u'unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit', mapcss._tag_uncapture(capture_tags, u'{0.key}'))} self.errors[9006019] = {'item': 9006, 'level': 3, 'tag': ["tag", "value"], 'desc': mapcss.tr(u'unusual value of {0}: tonne is default; point is decimal separator; if units, put space then unit', mapcss._tag_uncapture(capture_tags, u'{0.key}'))} self.errors[9006020] = {'item': 9006, 'level': 3, 'tag': ["tag", "value"], 'desc': mapcss.tr(u'unusual value of {0}: kilometers is default; point is decimal separator; if units, put space then unit', mapcss._tag_uncapture(capture_tags, u'{0.key}'))} + self.errors[9006021] = {'item': 9006, 'level': 3, 'tag': ["tag", "value"], 'desc': mapcss.tr(u'Unnecessary amount of decimal places')} self.re_035d45f0 = re.compile(r'^(([0-9]+\.?[0-9]*( (t|kg|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$') self.re_066203d3 = re.compile(r'^[0-9]+$') @@ -47,6 +48,7 @@ def init(self, logger): self.re_5478d8af = re.compile(r'^[1-9]([0-9]*)$') self.re_55d147d6 = re.compile(r'^[0-9]+,[0-9][0-9]?( (m|km|mi|nmi))?$') self.re_597f003d = re.compile(r'^(([0-9]+\.?[0-9]*( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$') + self.re_5a7f47b9 = re.compile(r'^-?[0-9]+\.[0-9][0-9][0-9]+$') self.re_63a07204 = re.compile(r'^([0-9][0-9]?[0-9]?|north|east|south|west|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW|forward|backward|both|clockwise|anti-clockwise|anticlockwise|up|down)(-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))?(;([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW)-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))*$') self.re_762a1d1d = re.compile(r'^-?[0-9]+(\.[0-9]+)? ?m$') self.re_7f163374 = re.compile(r'^(1|2|3|4|5|6|7|8|9|10|11|12)$') @@ -524,6 +526,25 @@ def node(self, data, tags): # assertMatch:"node ele=high" err.append({'class': 9006011, 'subclass': 1781084832, 'text': mapcss.tr(u'{0} must be a numeric value, in meters and without units', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[ele][ele=~/^-?[0-9]+\.[0-9][0-9][0-9]+$/] + if (u'ele' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ele') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5a7f47b9), mapcss._tag_capture(capture_tags, 1, tags, u'ele'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("Unnecessary amount of decimal places") + # throwWarning:tr("{0}","{0.tag}") + # assertMatch:"node ele=-12.6789" + # assertNoMatch:"node ele=1.12" + # assertNoMatch:"node ele=12" + # assertNoMatch:"node ele=12.123 m" + # assertMatch:"node ele=12.123" + # assertMatch:"node ele=12.1234" + # assertNoMatch:"node ele=high" + err.append({'class': 9006021, 'subclass': 185098060, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # node[fire_hydrant:pressure="#"] if (u'fire_hydrant:pressure' in keys): match = False @@ -1028,6 +1049,18 @@ def way(self, data, tags, nds): # throwWarning:tr("{0} must be a numeric value, in meters and without units","{0.key}") err.append({'class': 9006011, 'subclass': 1781084832, 'text': mapcss.tr(u'{0} must be a numeric value, in meters and without units', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[ele][ele=~/^-?[0-9]+\.[0-9][0-9][0-9]+$/] + if (u'ele' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ele') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5a7f47b9), mapcss._tag_capture(capture_tags, 1, tags, u'ele'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("Unnecessary amount of decimal places") + # throwWarning:tr("{0}","{0.tag}") + err.append({'class': 9006021, 'subclass': 185098060, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # *[interval][interval!~/^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] if (u'interval' in keys): match = False @@ -1381,6 +1414,18 @@ def relation(self, data, tags, members): # throwWarning:tr("{0} must be a numeric value, in meters and without units","{0.key}") err.append({'class': 9006011, 'subclass': 1781084832, 'text': mapcss.tr(u'{0} must be a numeric value, in meters and without units', mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[ele][ele=~/^-?[0-9]+\.[0-9][0-9][0-9]+$/] + if (u'ele' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'ele') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5a7f47b9), mapcss._tag_capture(capture_tags, 1, tags, u'ele'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("Unnecessary amount of decimal places") + # throwWarning:tr("{0}","{0.tag}") + err.append({'class': 9006021, 'subclass': 185098060, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + # *[interval][interval!~/^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] if (u'interval' in keys): match = False @@ -1548,6 +1593,13 @@ class father: self.check_err(n.node(data, {u'ele': u'12km'}), expected={'class': 9006011, 'subclass': 1781084832}) self.check_not_err(n.node(data, {u'ele': u'12m'}), expected={'class': 9006011, 'subclass': 1781084832}) self.check_err(n.node(data, {u'ele': u'high'}), expected={'class': 9006011, 'subclass': 1781084832}) + self.check_err(n.node(data, {u'ele': u'-12.6789'}), expected={'class': 9006021, 'subclass': 185098060}) + self.check_not_err(n.node(data, {u'ele': u'1.12'}), expected={'class': 9006021, 'subclass': 185098060}) + self.check_not_err(n.node(data, {u'ele': u'12'}), expected={'class': 9006021, 'subclass': 185098060}) + self.check_not_err(n.node(data, {u'ele': u'12.123 m'}), expected={'class': 9006021, 'subclass': 185098060}) + self.check_err(n.node(data, {u'ele': u'12.123'}), expected={'class': 9006021, 'subclass': 185098060}) + self.check_err(n.node(data, {u'ele': u'12.1234'}), expected={'class': 9006021, 'subclass': 185098060}) + self.check_not_err(n.node(data, {u'ele': u'high'}), expected={'class': 9006021, 'subclass': 185098060}) self.check_err(n.way(data, {u'123': u'foo'}, [0]), expected={'class': 9006001, 'subclass': 750700308}) self.check_not_err(n.way(data, {u'ref.1': u'foo'}, [0]), expected={'class': 9006001, 'subclass': 750700308}) self.check_not_err(n.way(data, {u'width': u'1\''}, [0]), expected={'class': 9006018, 'subclass': 587682576}) diff --git a/plugins/Josm_openrailwaymap.py b/plugins/Josm_openrailwaymap.py index 4bf6af9be..53607c768 100644 --- a/plugins/Josm_openrailwaymap.py +++ b/plugins/Josm_openrailwaymap.py @@ -1246,148 +1246,152 @@ def way(self, data, tags, nds): # assertNoMatch:"way railway=rail radio=\"GSM-R\"" err.append({'class': 9015019, 'subclass': 406318522, 'text': {'en': u'radio=* is deprecated, change to proper railway:radio value'}}) - # way[railway][name=~/[Tt]unnel/][!"tunnel:name"] - # way[railway][name=~/[Tt]unnel/]["tunnel:name"=*name] + # way[railway][railway!=platform][name=~/[Tt]unnel/][!"tunnel:name"] + # way[railway][railway!=platform][name=~/[Tt]unnel/]["tunnel:name"=*name] if (u'name' in keys and u'railway' in keys) or (u'name' in keys and u'railway' in keys and u'tunnel:name' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5bca804b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss._tag_capture(capture_tags, 2, tags, u'tunnel:name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5bca804b), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and not mapcss._tag_capture(capture_tags, 3, tags, u'tunnel:name')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5bca804b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'tunnel:name') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5bca804b), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss._tag_capture(capture_tags, 3, tags, u'tunnel:name') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'name'))) except mapcss.RuleAbort: pass if match: # throwWarning:"track tagged with 'tunnel' in name, consider using tunnel:name instead and put the track name into name" # suggestAlternative:"tunnel:name" # fixChangeKey:"name=>tunnel:name" # assertMatch:"way railway=light_rail name=Bartunnel tunnel:name=Bartunnel" + # assertNoMatch:"way railway=platform name=Footunnel" # assertMatch:"way railway=rail name=Footunnel" # assertNoMatch:"way railway=rail tunnel:name=Baztunnel" - err.append({'class': 9015020, 'subclass': 843755814, 'text': {'en': u'track tagged with \'tunnel\' in name, consider using tunnel:name instead and put the track name into name'}, 'allow_fix_override': True, 'fix': { + err.append({'class': 9015020, 'subclass': 1651250819, 'text': {'en': u'track tagged with \'tunnel\' in name, consider using tunnel:name instead and put the track name into name'}, 'allow_fix_override': True, 'fix': { '+': dict([ [u'tunnel:name', mapcss.tag(tags, u'name')]]), '-': ([ u'name']) }}) - # way[railway][wikipedia=~/[Tt]unnel/][!"tunnel:wikipedia"] - # way[railway][wikipedia=~/[Tt]unnel/]["tunnel:wikipedia"=*wikipedia] + # way[railway][railway!=platform][wikipedia=~/[Tt]unnel/][!"tunnel:wikipedia"] + # way[railway][railway!=platform][wikipedia=~/[Tt]unnel/]["tunnel:wikipedia"=*wikipedia] if (u'railway' in keys and u'tunnel:wikipedia' in keys and u'wikipedia' in keys) or (u'railway' in keys and u'wikipedia' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5bca804b), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 2, tags, u'tunnel:wikipedia')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5bca804b), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 3, tags, u'tunnel:wikipedia')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5bca804b), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 2, tags, u'tunnel:wikipedia') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'wikipedia'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_5bca804b), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 3, tags, u'tunnel:wikipedia') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'wikipedia'))) except mapcss.RuleAbort: pass if match: # throwWarning:"track tagged with 'tunnel' in wikipedia, consider using tunnel:wikipedia instead and put the track wikipedia entry into wikipedia" # suggestAlternative:"tunnel:wikipedia" # fixChangeKey:"wikipedia=>tunnel:wikipedia" # assertMatch:"way railway=light_rail wikipedia=Bartunnel tunnel:wikipedia=Bartunnel" + # assertNoMatch:"way railway=platform wikipedia=Footunnel" # assertNoMatch:"way railway=rail tunnel:wikipedia=Baztunnel" # assertMatch:"way railway=rail wikipedia=Footunnel" - err.append({'class': 9015021, 'subclass': 596570286, 'text': {'en': u'track tagged with \'tunnel\' in wikipedia, consider using tunnel:wikipedia instead and put the track wikipedia entry into wikipedia'}, 'allow_fix_override': True, 'fix': { + err.append({'class': 9015021, 'subclass': 1581548500, 'text': {'en': u'track tagged with \'tunnel\' in wikipedia, consider using tunnel:wikipedia instead and put the track wikipedia entry into wikipedia'}, 'allow_fix_override': True, 'fix': { '+': dict([ [u'tunnel:wikipedia', mapcss.tag(tags, u'wikipedia')]]), '-': ([ u'wikipedia']) }}) - # way[railway][name=~/[Bb]ridge/][!"bridge:name"] - # way[railway][name=~/[Bb]ridge/]["bridge:name"=*name] - # way[railway][name=~/[Vv]iadu[ck]t/][!"bridge:name"] - # way[railway][name=~/[Vv]iadu[ck]t/]["bridge:name"=*name] - # way[railway][name=~/[Bb]rücke/][!"bridge:name"] - # way[railway][name=~/[Bb]rücke/]["bridge:name"=*name] + # way[railway][railway!=platform][name=~/[Bb]ridge/][!"bridge:name"] + # way[railway][railway!=platform][name=~/[Bb]ridge/]["bridge:name"=*name] + # way[railway][railway!=platform][name=~/[Vv]iadu[ck]t/][!"bridge:name"] + # way[railway][railway!=platform][name=~/[Vv]iadu[ck]t/]["bridge:name"=*name] + # way[railway][railway!=platform][name=~/[Bb]rücke/][!"bridge:name"] + # way[railway][railway!=platform][name=~/[Bb]rücke/]["bridge:name"=*name] if (u'bridge:name' in keys and u'name' in keys and u'railway' in keys) or (u'name' in keys and u'railway' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_25833d04), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge:name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_25833d04), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and not mapcss._tag_capture(capture_tags, 3, tags, u'bridge:name')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_25833d04), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'bridge:name') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_25833d04), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss._tag_capture(capture_tags, 3, tags, u'bridge:name') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'name'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge:name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and not mapcss._tag_capture(capture_tags, 3, tags, u'bridge:name')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'bridge:name') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss._tag_capture(capture_tags, 3, tags, u'bridge:name') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'name'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge:name')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and not mapcss._tag_capture(capture_tags, 3, tags, u'bridge:name')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'bridge:name') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'name'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 2, tags, u'name')) and mapcss._tag_capture(capture_tags, 3, tags, u'bridge:name') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'name'))) except mapcss.RuleAbort: pass if match: # throwWarning:"track tagged with 'bridge' in name, consider using bridge:name instead and put the track name into name" # suggestAlternative:"bridge:name" # fixChangeKey:"name=>bridge:name" # assertMatch:"way railway=light_rail name=\"Bar bridge\" bridge:name=\"Bar bridge\"" + # assertNoMatch:"way railway=platform name=Noltemeyerbrücke" # assertNoMatch:"way railway=rail bridge:name=Foo-Viadukt" # assertMatch:"way railway=rail name=\"Bay bridge\"" # assertMatch:"way railway=rail name=\"Baz viaduct\"" # assertMatch:"way railway=rail name=Foobrücke" - err.append({'class': 9015022, 'subclass': 441252968, 'text': {'en': u'track tagged with \'bridge\' in name, consider using bridge:name instead and put the track name into name'}, 'allow_fix_override': True, 'fix': { + err.append({'class': 9015022, 'subclass': 359430532, 'text': {'en': u'track tagged with \'bridge\' in name, consider using bridge:name instead and put the track name into name'}, 'allow_fix_override': True, 'fix': { '+': dict([ [u'bridge:name', mapcss.tag(tags, u'name')]]), '-': ([ u'name']) }}) - # way[railway][wikipedia=~/[Bb]ridge/][!"bridge:wikipedia"] - # way[railway][wikipedia=~/[Bb]ridge/]["bridge:wikipedia"=*wikipedia] - # way[railway][wikipedia=~/[Vv]iadu[ck]t/][!"bridge:wikipedia"] - # way[railway][wikipedia=~/[Vv]iadu[ck]t/]["bridge:wikipedia"=*wikipedia] - # way[railway][wikipedia=~/[Bb]rücke/][!"bridge:wikipedia"] - # way[railway][wikipedia=~/[Bb]rücke/]["bridge:wikipedia"=*wikipedia] + # way[railway][railway!=platform][wikipedia=~/[Bb]ridge/][!"bridge:wikipedia"] + # way[railway][railway!=platform][wikipedia=~/[Bb]ridge/]["bridge:wikipedia"=*wikipedia] + # way[railway][railway!=platform][wikipedia=~/[Vv]iadu[ck]t/][!"bridge:wikipedia"] + # way[railway][railway!=platform][wikipedia=~/[Vv]iadu[ck]t/]["bridge:wikipedia"=*wikipedia] + # way[railway][railway!=platform][wikipedia=~/[Bb]rücke/][!"bridge:wikipedia"] + # way[railway][railway!=platform][wikipedia=~/[Bb]rücke/]["bridge:wikipedia"=*wikipedia] if (u'bridge:wikipedia' in keys and u'railway' in keys and u'wikipedia' in keys) or (u'railway' in keys and u'wikipedia' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_25833d04), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge:wikipedia')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_25833d04), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 3, tags, u'bridge:wikipedia')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_25833d04), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 2, tags, u'bridge:wikipedia') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'wikipedia'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_25833d04), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 3, tags, u'bridge:wikipedia') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'wikipedia'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge:wikipedia')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 3, tags, u'bridge:wikipedia')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 2, tags, u'bridge:wikipedia') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'wikipedia'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_0e3375d5), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 3, tags, u'bridge:wikipedia') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'wikipedia'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 2, tags, u'bridge:wikipedia')) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and not mapcss._tag_capture(capture_tags, 3, tags, u'bridge:wikipedia')) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 1, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 2, tags, u'bridge:wikipedia') == mapcss._value_capture(capture_tags, 2, mapcss.tag(tags, u'wikipedia'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'railway') and mapcss._tag_capture(capture_tags, 1, tags, u'railway') != mapcss._value_capture(capture_tags, 1, u'platform') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 2, self.re_18e8cc14), mapcss._tag_capture(capture_tags, 2, tags, u'wikipedia')) and mapcss._tag_capture(capture_tags, 3, tags, u'bridge:wikipedia') == mapcss._value_capture(capture_tags, 3, mapcss.tag(tags, u'wikipedia'))) except mapcss.RuleAbort: pass if match: # throwWarning:"track tagged with 'bridge' in wikipedia, consider using bridge:wikipedia instead and put track wikipedia entry into wikipedia" # suggestAlternative:"bridge:wikipedia" # fixChangeKey:"wikipedia=>bridge:wikipedia" # assertMatch:"way railway=light_rail wikipedia=\"Bar bridge\" bridge:wikipedia=\"Bar bridge\"" + # assertNoMatch:"way railway=platform wikipedia=Foobrücke" # assertNoMatch:"way railway=rail bridge:wikipedia=Foo-Viadukt" # assertMatch:"way railway=rail wikipedia=\"Bay bridge\"" # assertMatch:"way railway=rail wikipedia=\"Baz viaduct\"" # assertMatch:"way railway=rail wikipedia=Foobrücke" - err.append({'class': 9015023, 'subclass': 1872164964, 'text': {'en': u'track tagged with \'bridge\' in wikipedia, consider using bridge:wikipedia instead and put track wikipedia entry into wikipedia'}, 'allow_fix_override': True, 'fix': { + err.append({'class': 9015023, 'subclass': 1594751596, 'text': {'en': u'track tagged with \'bridge\' in wikipedia, consider using bridge:wikipedia instead and put track wikipedia entry into wikipedia'}, 'allow_fix_override': True, 'fix': { '+': dict([ [u'bridge:wikipedia', mapcss.tag(tags, u'wikipedia')]]), '-': ([ @@ -1747,22 +1751,26 @@ class father: self.check_err(n.way(data, {u'radio': u'GSM-R', u'railway': u'rail', u'railway:radio': u'gsm'}, [0]), expected={'class': 9015019, 'subclass': 406318522}) self.check_not_err(n.way(data, {u'radio': u'GSM-R', u'railway': u'rail', u'railway:radio': u'gsm-r'}, [0]), expected={'class': 9015019, 'subclass': 406318522}) self.check_not_err(n.way(data, {u'radio': u'GSM-R', u'railway': u'rail'}, [0]), expected={'class': 9015019, 'subclass': 406318522}) - self.check_err(n.way(data, {u'name': u'Bartunnel', u'railway': u'light_rail', u'tunnel:name': u'Bartunnel'}, [0]), expected={'class': 9015020, 'subclass': 843755814}) - self.check_err(n.way(data, {u'name': u'Footunnel', u'railway': u'rail'}, [0]), expected={'class': 9015020, 'subclass': 843755814}) - self.check_not_err(n.way(data, {u'railway': u'rail', u'tunnel:name': u'Baztunnel'}, [0]), expected={'class': 9015020, 'subclass': 843755814}) - self.check_err(n.way(data, {u'railway': u'light_rail', u'tunnel:wikipedia': u'Bartunnel', u'wikipedia': u'Bartunnel'}, [0]), expected={'class': 9015021, 'subclass': 596570286}) - self.check_not_err(n.way(data, {u'railway': u'rail', u'tunnel:wikipedia': u'Baztunnel'}, [0]), expected={'class': 9015021, 'subclass': 596570286}) - self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Footunnel'}, [0]), expected={'class': 9015021, 'subclass': 596570286}) - self.check_err(n.way(data, {u'bridge:name': u'Bar bridge', u'name': u'Bar bridge', u'railway': u'light_rail'}, [0]), expected={'class': 9015022, 'subclass': 441252968}) - self.check_not_err(n.way(data, {u'bridge:name': u'Foo-Viadukt', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 441252968}) - self.check_err(n.way(data, {u'name': u'Bay bridge', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 441252968}) - self.check_err(n.way(data, {u'name': u'Baz viaduct', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 441252968}) - self.check_err(n.way(data, {u'name': u'Foobrücke', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 441252968}) - self.check_err(n.way(data, {u'bridge:wikipedia': u'Bar bridge', u'railway': u'light_rail', u'wikipedia': u'Bar bridge'}, [0]), expected={'class': 9015023, 'subclass': 1872164964}) - self.check_not_err(n.way(data, {u'bridge:wikipedia': u'Foo-Viadukt', u'railway': u'rail'}, [0]), expected={'class': 9015023, 'subclass': 1872164964}) - self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Bay bridge'}, [0]), expected={'class': 9015023, 'subclass': 1872164964}) - self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Baz viaduct'}, [0]), expected={'class': 9015023, 'subclass': 1872164964}) - self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Foobrücke'}, [0]), expected={'class': 9015023, 'subclass': 1872164964}) + self.check_err(n.way(data, {u'name': u'Bartunnel', u'railway': u'light_rail', u'tunnel:name': u'Bartunnel'}, [0]), expected={'class': 9015020, 'subclass': 1651250819}) + self.check_not_err(n.way(data, {u'name': u'Footunnel', u'railway': u'platform'}, [0]), expected={'class': 9015020, 'subclass': 1651250819}) + self.check_err(n.way(data, {u'name': u'Footunnel', u'railway': u'rail'}, [0]), expected={'class': 9015020, 'subclass': 1651250819}) + self.check_not_err(n.way(data, {u'railway': u'rail', u'tunnel:name': u'Baztunnel'}, [0]), expected={'class': 9015020, 'subclass': 1651250819}) + self.check_err(n.way(data, {u'railway': u'light_rail', u'tunnel:wikipedia': u'Bartunnel', u'wikipedia': u'Bartunnel'}, [0]), expected={'class': 9015021, 'subclass': 1581548500}) + self.check_not_err(n.way(data, {u'railway': u'platform', u'wikipedia': u'Footunnel'}, [0]), expected={'class': 9015021, 'subclass': 1581548500}) + self.check_not_err(n.way(data, {u'railway': u'rail', u'tunnel:wikipedia': u'Baztunnel'}, [0]), expected={'class': 9015021, 'subclass': 1581548500}) + self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Footunnel'}, [0]), expected={'class': 9015021, 'subclass': 1581548500}) + self.check_err(n.way(data, {u'bridge:name': u'Bar bridge', u'name': u'Bar bridge', u'railway': u'light_rail'}, [0]), expected={'class': 9015022, 'subclass': 359430532}) + self.check_not_err(n.way(data, {u'name': u'Noltemeyerbrücke', u'railway': u'platform'}, [0]), expected={'class': 9015022, 'subclass': 359430532}) + self.check_not_err(n.way(data, {u'bridge:name': u'Foo-Viadukt', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 359430532}) + self.check_err(n.way(data, {u'name': u'Bay bridge', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 359430532}) + self.check_err(n.way(data, {u'name': u'Baz viaduct', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 359430532}) + self.check_err(n.way(data, {u'name': u'Foobrücke', u'railway': u'rail'}, [0]), expected={'class': 9015022, 'subclass': 359430532}) + self.check_err(n.way(data, {u'bridge:wikipedia': u'Bar bridge', u'railway': u'light_rail', u'wikipedia': u'Bar bridge'}, [0]), expected={'class': 9015023, 'subclass': 1594751596}) + self.check_not_err(n.way(data, {u'railway': u'platform', u'wikipedia': u'Foobrücke'}, [0]), expected={'class': 9015023, 'subclass': 1594751596}) + self.check_not_err(n.way(data, {u'bridge:wikipedia': u'Foo-Viadukt', u'railway': u'rail'}, [0]), expected={'class': 9015023, 'subclass': 1594751596}) + self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Bay bridge'}, [0]), expected={'class': 9015023, 'subclass': 1594751596}) + self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Baz viaduct'}, [0]), expected={'class': 9015023, 'subclass': 1594751596}) + self.check_err(n.way(data, {u'railway': u'rail', u'wikipedia': u'Foobrücke'}, [0]), expected={'class': 9015023, 'subclass': 1594751596}) self.check_err(n.way(data, {u'lanes': u'2', u'railway': u'rail'}, [0]), expected={'class': 9015024, 'subclass': 1292450822}) self.check_not_err(n.way(data, {u'railway': u'rail', u'tracks': u'1'}, [0]), expected={'class': 9015024, 'subclass': 1292450822}) self.check_err(n.way(data, {u'lanes': u'2', u'railway': u'subway', u'tracks': u'2'}, [0]), expected={'class': 9015024, 'subclass': 1292450822}) diff --git a/plugins/Josm_religion.py b/plugins/Josm_religion.py index 6ae711b41..92460c6bc 100644 --- a/plugins/Josm_religion.py +++ b/plugins/Josm_religion.py @@ -11,9 +11,93 @@ class Josm_religion(Plugin): def init(self, logger): Plugin.init(self, logger) tags = capture_tags = {} + self.errors[9008005] = {'item': 9008, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} + def node(self, data, tags): + capture_tags = {} + keys = tags.keys() + err = [] + + + # *[religion=catholic] + if (u'religion' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'religion') == mapcss._value_capture(capture_tags, 0, u'catholic')) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("{0}","{0.tag}") + # suggestAlternative:"religion=christian + denomination=catholic" + # fixChangeKey:"religion => denomination" + # fixAdd:"religion=christian" + err.append({'class': 9008005, 'subclass': 97466527, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'denomination', mapcss.tag(tags, u'religion')], + [u'religion',u'christian']]), + '-': ([ + u'religion']) + }}) + + return err + + def way(self, data, tags, nds): + capture_tags = {} + keys = tags.keys() + err = [] + + + # *[religion=catholic] + if (u'religion' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'religion') == mapcss._value_capture(capture_tags, 0, u'catholic')) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("{0}","{0.tag}") + # suggestAlternative:"religion=christian + denomination=catholic" + # fixChangeKey:"religion => denomination" + # fixAdd:"religion=christian" + err.append({'class': 9008005, 'subclass': 97466527, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'denomination', mapcss.tag(tags, u'religion')], + [u'religion',u'christian']]), + '-': ([ + u'religion']) + }}) + + return err + + def relation(self, data, tags, members): + capture_tags = {} + keys = tags.keys() + err = [] + + + # *[religion=catholic] + if (u'religion' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'religion') == mapcss._value_capture(capture_tags, 0, u'catholic')) + except mapcss.RuleAbort: pass + if match: + # throwWarning:tr("{0}","{0.tag}") + # suggestAlternative:"religion=christian + denomination=catholic" + # fixChangeKey:"religion => denomination" + # fixAdd:"religion=christian" + err.append({'class': 9008005, 'subclass': 97466527, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'denomination', mapcss.tag(tags, u'religion')], + [u'religion',u'christian']]), + '-': ([ + u'religion']) + }}) + + return err from plugins.Plugin import TestPluginCommon diff --git a/plugins/Josm_territories.py b/plugins/Josm_territories.py index 7328d7446..84223827c 100644 --- a/plugins/Josm_territories.py +++ b/plugins/Josm_territories.py @@ -195,6 +195,19 @@ def relation(self, data, tags, members): # throwError:tr("street name contains ß") err.append({'class': 9009003, 'subclass': 610086334, 'text': mapcss.tr(u'street name contains ß')}) + # relation[type=associatedStreet][inside("DE")] + if (u'type' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'associatedStreet') and mapcss.inside(self.father.config.options, u'DE')) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} is deprecated in {1}","{0.tag}","Deutschland") + # suggestAlternative:"addr:street" + err.append({'class': 9009001, 'subclass': 746730328, 'text': mapcss.tr(u'{0} is deprecated in {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), u'Deutschland')}) + return err diff --git a/plugins/Josm_transport.py b/plugins/Josm_transport.py index 65b6288ae..e6b2a946d 100644 --- a/plugins/Josm_transport.py +++ b/plugins/Josm_transport.py @@ -26,9 +26,16 @@ def init(self, logger): self.errors[9014010] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'Missing transportation mode, change tag route to route_master')} self.errors[9014013] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'Check the operator tag')} self.errors[9014014] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'Check the network tag')} + self.errors[9014019] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'A bus stop is supposed to be a node')} + self.errors[9014020] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'The color of the public transport line should be in a colour tag')} + self.errors[9014021] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'The interval is invalid (try a number of minutes)')} + self.errors[9014022] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'The duration is invalid (try a number of minutes)')} + self.errors[9014023] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'Missing interval tag to specify the main interval')} + self.errors[9014024] = {'item': 9014, 'level': 2, 'tag': mapcss.list_(u'tag', u'public_transport'), 'desc': mapcss.tr(u'Missing opening_hours tag')} self.re_25554804 = re.compile(r'STIF|Kéolis|Véolia') - self.re_37f81db8 = re.compile(r'^(bus|coach|train|subway|monorail|trolleybus|aerialway|funicular|ferry|tram|share_taxi|light_rail|school_bus)$') + self.re_3d9f4d39 = re.compile(r'^([0-9][0-9][0-9]?|[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)$') + self.re_6194d2a4 = re.compile(r'^(bus|coach|train|subway|monorail|trolleybus|aerialway|funicular|ferry|tram|share_taxi|light_rail|school_bus|walking_bus)$') def node(self, data, tags): @@ -176,6 +183,25 @@ def node(self, data, tags): return err + def way(self, data, tags, nds): + capture_tags = {} + keys = tags.keys() + err = [] + set_pt_route = set_pt_route_master = False + + # way[highway=bus_stop] + if (u'highway' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'bus_stop')) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("A bus stop is supposed to be a node") + err.append({'class': 9014019, 'subclass': 1153984743, 'text': mapcss.tr(u'A bus stop is supposed to be a node')}) + + return err + def relation(self, data, tags, members): capture_tags = {} keys = tags.keys() @@ -221,23 +247,23 @@ def relation(self, data, tags, members): u'route']) }}) - # relation[type=route][route=~/^(bus|coach|train|subway|monorail|trolleybus|aerialway|funicular|ferry|tram|share_taxi|light_rail|school_bus)$/] + # relation[type=route][route=~/^(bus|coach|train|subway|monorail|trolleybus|aerialway|funicular|ferry|tram|share_taxi|light_rail|school_bus|walking_bus)$/] if (u'route' in keys and u'type' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'route') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_37f81db8), mapcss._tag_capture(capture_tags, 1, tags, u'route'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'route') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6194d2a4), mapcss._tag_capture(capture_tags, 1, tags, u'route'))) except mapcss.RuleAbort: pass if match: # setpt_route set_pt_route = True - # relation[type=route_master][route_master=~/^(bus|coach|train|subway|monorail|trolleybus|aerialway|funicular|ferry|tram|share_taxi|light_rail|school_bus)$/] + # relation[type=route_master][route_master=~/^(bus|coach|train|subway|monorail|trolleybus|aerialway|funicular|ferry|tram|share_taxi|light_rail|school_bus|walking_bus)$/] if (u'route_master' in keys and u'type' in keys): match = False if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'route_master') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_37f81db8), mapcss._tag_capture(capture_tags, 1, tags, u'route_master'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'type') == mapcss._value_capture(capture_tags, 0, u'route_master') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6194d2a4), mapcss._tag_capture(capture_tags, 1, tags, u'route_master'))) except mapcss.RuleAbort: pass if match: # setpt_route_master @@ -335,6 +361,43 @@ def relation(self, data, tags, members): # assertMatch:"relation type=route route=bus" err.append({'class': 21405, 'subclass': 0, 'text': mapcss.tr(u'Missing from/to tag on a public_transport route relation')}) + # relation.pt_route[tag(network)!=parent_tag(network)] + # Part of rule not implemented + + # relation.pt_route[tag(operator)!=parent_tag(operator)] + # Part of rule not implemented + + # relation.pt_route[tag(ref)!=parent_tag(ref)] + # Part of rule not implemented + + # relation.pt_route[tag(colour)!=parent_tag(colour)] + # Part of rule not implemented + + # relation.pt_route[tag(route)!=parent_tag(route_master)] + # Part of rule not implemented + + # relation.pt_route[!colour][color] + # relation.pt_route_master[!colour][color] + if (u'color' in keys): + match = False + if not match: + capture_tags = {} + try: match = (set_pt_route and not mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss._tag_capture(capture_tags, 1, tags, u'color')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (set_pt_route_master and not mapcss._tag_capture(capture_tags, 0, tags, u'colour') and mapcss._tag_capture(capture_tags, 1, tags, u'color')) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("The color of the public transport line should be in a colour tag") + # fixChangeKey:"color=>colour" + err.append({'class': 9014020, 'subclass': 218794881, 'text': mapcss.tr(u'The color of the public transport line should be in a colour tag'), 'allow_fix_override': True, 'fix': { + '+': dict([ + [u'colour', mapcss.tag(tags, u'color')]]), + '-': ([ + u'color']) + }}) + # relation.pt_route["operator"=~/STIF|Kéolis|Véolia/][inside("FR")] # relation.pt_route_master["operator"=~/STIF|Kéolis|Véolia/][inside("FR")] if (u'operator' in keys): @@ -367,9 +430,84 @@ def relation(self, data, tags, members): # throwError:tr("Check the network tag") err.append({'class': 9014014, 'subclass': 735027962, 'text': mapcss.tr(u'Check the network tag')}) + # relation[highway=bus_stop] + if (u'highway' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'highway') == mapcss._value_capture(capture_tags, 0, u'bus_stop')) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("A bus stop is supposed to be a node") + err.append({'class': 9014019, 'subclass': 1590282811, 'text': mapcss.tr(u'A bus stop is supposed to be a node')}) + # relation.pt_route!.route_ok # Use undeclared class pt_route, route_ok + # relation.pt_route[interval][interval!~/^([0-9][0-9][0-9]?|[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)$/] + # relation.pt_route_master[interval][interval!~/^([0-9][0-9][0-9]?|[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)$/] + if (u'interval' in keys): + match = False + if not match: + capture_tags = {} + try: match = (set_pt_route and mapcss._tag_capture(capture_tags, 0, tags, u'interval') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3d9f4d39), mapcss._tag_capture(capture_tags, 1, tags, u'interval'))) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (set_pt_route_master and mapcss._tag_capture(capture_tags, 0, tags, u'interval') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3d9f4d39), mapcss._tag_capture(capture_tags, 1, tags, u'interval'))) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("The interval is invalid (try a number of minutes)") + err.append({'class': 9014021, 'subclass': 1893709522, 'text': mapcss.tr(u'The interval is invalid (try a number of minutes)')}) + + # relation.pt_route[duration][duration!~/^([0-9][0-9][0-9]?|[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)$/] + # relation.pt_route_master[duration][duration!~/^([0-9][0-9][0-9]?|[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)$/] + if (u'duration' in keys): + match = False + if not match: + capture_tags = {} + try: match = (set_pt_route and mapcss._tag_capture(capture_tags, 0, tags, u'duration') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3d9f4d39), mapcss._tag_capture(capture_tags, 1, tags, u'duration'))) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (set_pt_route_master and mapcss._tag_capture(capture_tags, 0, tags, u'duration') and not mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3d9f4d39), mapcss._tag_capture(capture_tags, 1, tags, u'duration'))) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("The duration is invalid (try a number of minutes)") + err.append({'class': 9014022, 'subclass': 1468186952, 'text': mapcss.tr(u'The duration is invalid (try a number of minutes)')}) + + # relation.pt_route["interval:conditional"][!interval] + # relation.pt_route_master["interval:conditional"][!interval] + if (u'interval:conditional' in keys): + match = False + if not match: + capture_tags = {} + try: match = (set_pt_route and mapcss._tag_capture(capture_tags, 0, tags, u'interval:conditional') and not mapcss._tag_capture(capture_tags, 1, tags, u'interval')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (set_pt_route_master and mapcss._tag_capture(capture_tags, 0, tags, u'interval:conditional') and not mapcss._tag_capture(capture_tags, 1, tags, u'interval')) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("Missing interval tag to specify the main interval") + err.append({'class': 9014023, 'subclass': 1710360237, 'text': mapcss.tr(u'Missing interval tag to specify the main interval')}) + + # relation.pt_route["interval:conditional"][!opening_hours] + # relation.pt_route_master["interval:conditional"][!opening_hours] + if (u'interval:conditional' in keys): + match = False + if not match: + capture_tags = {} + try: match = (set_pt_route and mapcss._tag_capture(capture_tags, 0, tags, u'interval:conditional') and not mapcss._tag_capture(capture_tags, 1, tags, u'opening_hours')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (set_pt_route_master and mapcss._tag_capture(capture_tags, 0, tags, u'interval:conditional') and not mapcss._tag_capture(capture_tags, 1, tags, u'opening_hours')) + except mapcss.RuleAbort: pass + if match: + # throwError:tr("Missing opening_hours tag") + err.append({'class': 9014024, 'subclass': 210081506, 'text': mapcss.tr(u'Missing opening_hours tag')}) + return err diff --git a/plugins/Josm_unnecessary.py b/plugins/Josm_unnecessary.py index 046491a4b..24eb2e1c9 100644 --- a/plugins/Josm_unnecessary.py +++ b/plugins/Josm_unnecessary.py @@ -12,9 +12,41 @@ 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.errors[9010002] = {'item': 9010, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'{0} makes no sense', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} + self.errors[9010003] = {'item': 9010, 'level': 3, 'tag': ["tag"], 'desc': mapcss.tr(u'descriptive name')} + self.re_017d2728 = re.compile(r'^(?i)(restaurant)$') + self.re_053f39fb = re.compile(r'^(?i)(house|casa|rumah|vivienda)$') + self.re_0a40c79a = re.compile(r'^(?i)(Аптека|farmacia|pharmacy|pharmacie)$') + self.re_106eed50 = re.compile(r'^(?i)(shop|boutique)$') + self.re_10870b34 = re.compile(r'^(?i)(parc|park)$') + self.re_14b2be23 = re.compile(r'^(?i)(lycée)$') + self.re_1b9641aa = re.compile(r'^(?i)(post office)$') + self.re_1ba0f749 = re.compile(r'^(?i)(pond)$') + self.re_1e5aeb3d = re.compile(r'^(footway|pedestrian)$') + self.re_2335ac87 = re.compile(r'^(?i)(house|casa|maison|rumah|vivienda)$') + self.re_251cae80 = re.compile(r'^(?i)(parking|parkplatz)$') + self.re_2a48de72 = re.compile(r'^(?i)(mairie|rathaus)$') + self.re_2b5b04af = re.compile(r'^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$') + self.re_337f006b = re.compile(r'^(?i)(school|école|Школа)$') + self.re_33dfa05b = re.compile(r'^(?i)(church|église|biserica)$') + self.re_3ad2c525 = re.compile(r'^(?i)(école primaire)$') 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)$') + self.re_47aaa0f7 = re.compile(r'^(yes|designated)$') + self.re_480c7ba6 = re.compile(r'^(?i)(building|bangunan)$') + self.re_480ecdbb = re.compile(r'^(?i)(école élémentaire)$') + self.re_519078ac = re.compile(r'^(?i)(collège)$') + self.re_577104db = re.compile(r'^(?i)(kiosk)$') + self.re_5b729ae4 = re.compile(r'^(?i)(toilets?)$') + self.re_644827a8 = re.compile(r'^(?i)(jalan)$') + self.re_6d34128b = re.compile(r'^(?i)(АГЗС|АЗС)$') + self.re_702b1034 = re.compile(r'^(?i)(path)$') + self.re_73411d88 = re.compile(r'^(?i)(mosque|cami|masjid|مسجد)$') + self.re_740e0d70 = re.compile(r'^(?i)(école maternelle)$') + self.re_76c4f24d = re.compile(r'^(?i)(silo)$') + self.re_76f94888 = re.compile(r'^(?i)(monument aux morts|war memorial)$') + self.re_7c3e64db = re.compile(r'^(?i)(chapel|chapelle|kapelle)$') + self.re_7dc8f17a = re.compile(r'^(?i)(playground|spielplatz)$') def node(self, data, tags): @@ -24,7 +56,7 @@ def node(self, data, tags): # *[access][highway=proposed] - # *[motor_vehicle?][vehicle!=no][access!=no][bicycle_road!=yes][highway=~/^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] + # *[motor_vehicle?][!vehicle][!access][bicycle_road!=yes][highway=~/^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] # *[bridge=no] # *[building=no] # *[elevation="0"] @@ -37,7 +69,7 @@ def node(self, data, tags): except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'motor_vehicle') in ('yes', 'true', '1') and mapcss._tag_capture(capture_tags, 1, tags, u'vehicle') != mapcss._value_capture(capture_tags, 1, u'no') and mapcss._tag_capture(capture_tags, 2, tags, u'access') != mapcss._value_capture(capture_tags, 2, u'no') and mapcss._tag_capture(capture_tags, 3, tags, u'bicycle_road') != mapcss._value_capture(capture_tags, 3, u'yes') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_3ad9e1f5), mapcss._tag_capture(capture_tags, 4, tags, u'highway'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'motor_vehicle') in ('yes', 'true', '1') and not mapcss._tag_capture(capture_tags, 1, tags, u'vehicle') and not mapcss._tag_capture(capture_tags, 2, tags, u'access') and mapcss._tag_capture(capture_tags, 3, tags, u'bicycle_road') != mapcss._value_capture(capture_tags, 3, u'yes') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_3ad9e1f5), mapcss._tag_capture(capture_tags, 4, tags, u'highway'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -59,7 +91,43 @@ def node(self, data, tags): # group:tr("unnecessary tag") # throwWarning:tr("{0} is unnecessary","{0.tag}") # fixRemove:"{0.key}" - err.append({'class': 9010001, 'subclass': 1949087363, 'text': mapcss.tr(u'{0} is unnecessary', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9010001, 'subclass': 2110229428, 'text': mapcss.tr(u'{0} is unnecessary', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # *[gnis:Class="Populated Place"][place=city] + # *[gnis:Class="Populated Place"][place=town] + # *[gnis:Class="Populated Place"][place=village] + # *[gnis:Class="Populated Place"][place=hamlet] + # *[gnis:Class=Summit][natural=peak] + if (u'gnis:Class' in keys and u'natural' in keys) or (u'gnis:Class' in keys and u'place' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'city')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'town')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'village')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'hamlet')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Summit') and mapcss._tag_capture(capture_tags, 1, tags, u'natural') == mapcss._value_capture(capture_tags, 1, u'peak')) + except mapcss.RuleAbort: pass + if match: + # group:tr("unnecessary tag") + # throwWarning:tr("{0} is unnecessary for {1}","{0.tag}","{1.tag}") + # fixRemove:"{0.key}" + err.append({'class': 9010001, 'subclass': 1667787383, 'text': mapcss.tr(u'{0} is unnecessary for {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { '-': ([ mapcss._tag_uncapture(capture_tags, u'{0.key}')]) }}) @@ -72,9 +140,9 @@ def node(self, data, tags): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'permissive')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} makes no sense","{0.tag") + # throwWarning:tr("{0} makes no sense","{0.tag}") # fixAdd:"emergency=yes" - err.append({'class': 9010002, 'subclass': 325672362, 'text': mapcss.tr(u'{0} makes no sense', u'{0.tag'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9010002, 'subclass': 325672362, 'text': mapcss.tr(u'{0} makes no sense', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'emergency',u'yes']]) }}) @@ -111,6 +179,196 @@ def node(self, data, tags): mapcss._tag_uncapture(capture_tags, u'{1.key}')]) }}) + # *[name][name=~/^(?i)(parc|park)$/][leisure=park] + # *[name][name=~/^(?i)(pond)$/][water=pond] + # *[name][name=~/^(?i)(chapel|chapelle|kapelle)$/][building=chapel] + # *[name][name=~/^(?i)(church|église|biserica)$/][amenity=place_of_worship][religion=christian] + # *[name][name=~/^(?i)(mosque|cami|masjid|مسجد)$/][amenity=place_of_worship][religion=muslim] + # *[name][name=~/^(?i)(parking|parkplatz)$/][amenity=parking] + # *[name][name=~/^(?i)(post office)$/][amenity=post_office] + # *[name][name=~/^(?i)(restaurant)$/][amenity=restaurant] + # *[name][name=~/^(?i)(toilets?)$/][amenity=toilets] + # *[name][name=~/^(?i)(playground|spielplatz)$/][leisure=playground] + # *[name][name=~/^(?i)(shop|boutique)$/][shop][shop!=no] + # *[name][name=~/^(?i)(building|bangunan)$/][building][building!=no] + # *[name][name=~/^(?i)(house|casa|maison|rumah|vivienda)$/][building=house] + # *[name][name=~/^(?i)(kiosk)$/][shop=kiosk] + # *[name][name=~/^(?i)(path)$/][highway=path] + # *[name][name=~/^(?i)(jalan)$/][highway] + # *[name][name=~/^(?i)(silo)$/][man_made=silo] + # *[name][name=~/^(?i)(silo)$/][building=silo] + # *[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][amenity=grave_yard] + # *[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][landuse=cemetery] + # *[name][name=~/^(?i)(mairie|rathaus)$/][amenity=townhall] + # *[name][name=~/^(?i)(monument aux morts|war memorial)$/][historic=memorial][memorial=war_memorial] + # *[name][name=~/^(?i)(school|école|Школа)$/][building=school] + # *[name][name=~/^(?i)(school|école|Школа)$/][amenity=school] + # *[name][name=~/^(?i)(école élémentaire)$/][amenity=school]["school:FR"="élémentaire"] + # *[name][name=~/^(?i)(école maternelle)$/][amenity=school]["school:FR"="maternelle"] + # *[name][name=~/^(?i)(école primaire)$/][amenity=school]["school:FR"="primaire"] + # *[name][name=~/^(?i)(collège)$/][amenity=school]["school:FR"="collège"] + # *[name][name=~/^(?i)(lycée)$/][amenity=school]["school:FR"="lycée"] + # *[name][name=~/^(?i)(Аптека|farmacia|pharmacy|pharmacie)$/][amenity=pharmacy] + # *[name][name=~/^(?i)(АГЗС|АЗС)$/][amenity=fuel] + if (u'amenity' in keys and u'name' in keys) or (u'amenity' in keys and u'name' in keys and u'religion' in keys) or (u'amenity' in keys and u'name' in keys and u'school:FR' in keys) or (u'building' in keys and u'name' in keys) or (u'highway' in keys and u'name' in keys) or (u'historic' in keys and u'memorial' in keys and u'name' in keys) or (u'landuse' in keys and u'name' in keys) or (u'leisure' in keys and u'name' in keys) or (u'man_made' in keys and u'name' in keys) or (u'name' in keys and u'shop' in keys) or (u'name' in keys and u'water' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_10870b34), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') == mapcss._value_capture(capture_tags, 2, u'park')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1ba0f749), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'water') == mapcss._value_capture(capture_tags, 2, u'pond')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7c3e64db), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'chapel')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_33dfa05b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'place_of_worship') and mapcss._tag_capture(capture_tags, 3, tags, u'religion') == mapcss._value_capture(capture_tags, 3, u'christian')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_73411d88), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'place_of_worship') and mapcss._tag_capture(capture_tags, 3, tags, u'religion') == mapcss._value_capture(capture_tags, 3, u'muslim')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_251cae80), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'parking')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1b9641aa), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'post_office')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_017d2728), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'restaurant')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5b729ae4), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'toilets')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7dc8f17a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') == mapcss._value_capture(capture_tags, 2, u'playground')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_106eed50), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'shop') and mapcss._tag_capture(capture_tags, 3, tags, u'shop') != mapcss._value_capture(capture_tags, 3, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_480c7ba6), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2335ac87), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'house')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_577104db), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'shop') == mapcss._value_capture(capture_tags, 2, u'kiosk')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_702b1034), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'highway') == mapcss._value_capture(capture_tags, 2, u'path')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_644827a8), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'highway')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76c4f24d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'man_made') == mapcss._value_capture(capture_tags, 2, u'silo')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76c4f24d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'silo')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2b5b04af), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'grave_yard')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2b5b04af), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'landuse') == mapcss._value_capture(capture_tags, 2, u'cemetery')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2a48de72), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'townhall')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76f94888), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'historic') == mapcss._value_capture(capture_tags, 2, u'memorial') and mapcss._tag_capture(capture_tags, 3, tags, u'memorial') == mapcss._value_capture(capture_tags, 3, u'war_memorial')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'school')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_480ecdbb), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'élémentaire')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_740e0d70), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'maternelle')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3ad2c525), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'primaire')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_519078ac), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'collège')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_14b2be23), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'lycée')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_0a40c79a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'pharmacy')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6d34128b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'fuel')) + except mapcss.RuleAbort: pass + if match: + # group:tr("descriptive name") + # throwWarning:tr("{0}","{0.tag}") + # fixRemove:"name" + # assertNoMatch:"node name=Megaparking amenity=parking" + # assertMatch:"node name=PLaYGrOUNd leisure=playground" + # assertMatch:"node name=Parking amenity=parking" + # assertNoMatch:"node name=Parking_with_suffix amenity=parking" + # assertMatch:"node name=parking amenity=parking" + # assertNoMatch:"node name=shop shop=no" + # assertMatch:"node name=shop shop=whatever" + err.append({'class': 9010003, 'subclass': 1160398162, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + u'name']) + }}) + + # *[name][name=~/^(?i)(school|école|Школа)$/][building][building!=school][building!=no] + # *[name][name=~/^(?i)(house|casa|rumah|vivienda)$/][building][building!=house][building!=no] + if (u'building' in keys and u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'school') and mapcss._tag_capture(capture_tags, 4, tags, u'building') != mapcss._value_capture(capture_tags, 4, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_053f39fb), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'house') and mapcss._tag_capture(capture_tags, 4, tags, u'building') != mapcss._value_capture(capture_tags, 4, u'no')) + except mapcss.RuleAbort: pass + if match: + # group:tr("descriptive name") + # throwWarning:tr("{0}","{0.tag}") + err.append({'class': 9010003, 'subclass': 1173941116, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + return err def way(self, data, tags, nds): @@ -120,7 +378,7 @@ def way(self, data, tags, nds): # *[access][highway=proposed] - # *[motor_vehicle?][vehicle!=no][access!=no][bicycle_road!=yes][highway=~/^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] + # *[motor_vehicle?][!vehicle][!access][bicycle_road!=yes][highway=~/^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] # *[bridge=no] # *[building=no] # *[elevation="0"] @@ -133,7 +391,7 @@ def way(self, data, tags, nds): except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'motor_vehicle') in ('yes', 'true', '1') and mapcss._tag_capture(capture_tags, 1, tags, u'vehicle') != mapcss._value_capture(capture_tags, 1, u'no') and mapcss._tag_capture(capture_tags, 2, tags, u'access') != mapcss._value_capture(capture_tags, 2, u'no') and mapcss._tag_capture(capture_tags, 3, tags, u'bicycle_road') != mapcss._value_capture(capture_tags, 3, u'yes') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_3ad9e1f5), mapcss._tag_capture(capture_tags, 4, tags, u'highway'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'motor_vehicle') in ('yes', 'true', '1') and not mapcss._tag_capture(capture_tags, 1, tags, u'vehicle') and not mapcss._tag_capture(capture_tags, 2, tags, u'access') and mapcss._tag_capture(capture_tags, 3, tags, u'bicycle_road') != mapcss._value_capture(capture_tags, 3, u'yes') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_3ad9e1f5), mapcss._tag_capture(capture_tags, 4, tags, u'highway'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -156,9 +414,59 @@ def way(self, data, tags, nds): # throwWarning:tr("{0} is unnecessary","{0.tag}") # fixRemove:"{0.key}" # assertMatch:"way bridge=no" + # assertNoMatch:"way highway=motorway access=no motor_vehicle=yes" + # assertMatch:"way highway=motorway motor_vehicle=yes" # assertMatch:"way highway=proposed access=no" # assertMatch:"way layer=0" - err.append({'class': 9010001, 'subclass': 1949087363, 'text': mapcss.tr(u'{0} is unnecessary', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9010001, 'subclass': 2110229428, 'text': mapcss.tr(u'{0} is unnecessary', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # way[foot=~/^(yes|designated)$/][highway=~/^(footway|pedestrian)$/][!access] + # way[bicycle=~/^(yes|designated)$/][highway=cycleway][!vehicle][!access][foot!=designated] + # *[gnis:Class="Populated Place"][place=city] + # *[gnis:Class="Populated Place"][place=town] + # *[gnis:Class="Populated Place"][place=village] + # *[gnis:Class="Populated Place"][place=hamlet] + # *[gnis:Class=Summit][natural=peak] + if (u'bicycle' in keys and u'highway' in keys) or (u'foot' in keys and u'highway' in keys) or (u'gnis:Class' in keys and u'natural' in keys) or (u'gnis:Class' in keys and u'place' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_47aaa0f7), mapcss._tag_capture(capture_tags, 0, tags, u'foot')) and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1e5aeb3d), mapcss._tag_capture(capture_tags, 1, tags, u'highway')) and not mapcss._tag_capture(capture_tags, 2, tags, u'access')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_47aaa0f7), mapcss._tag_capture(capture_tags, 0, tags, u'bicycle')) and mapcss._tag_capture(capture_tags, 1, tags, u'highway') == mapcss._value_capture(capture_tags, 1, u'cycleway') and not mapcss._tag_capture(capture_tags, 2, tags, u'vehicle') and not mapcss._tag_capture(capture_tags, 3, tags, u'access') and mapcss._tag_capture(capture_tags, 4, tags, u'foot') != mapcss._value_capture(capture_tags, 4, u'designated')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'city')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'town')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'village')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'hamlet')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Summit') and mapcss._tag_capture(capture_tags, 1, tags, u'natural') == mapcss._value_capture(capture_tags, 1, u'peak')) + except mapcss.RuleAbort: pass + if match: + # group:tr("unnecessary tag") + # throwWarning:tr("{0} is unnecessary for {1}","{0.tag}","{1.tag}") + # fixRemove:"{0.key}" + # assertNoMatch:"way highway=pedestrian access=no foot=designated" + # assertMatch:"way highway=pedestrian foot=designated" + err.append({'class': 9010001, 'subclass': 92001477, 'text': mapcss.tr(u'{0} is unnecessary for {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { '-': ([ mapcss._tag_uncapture(capture_tags, u'{0.key}')]) }}) @@ -171,11 +479,11 @@ def way(self, data, tags, nds): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'permissive')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} makes no sense","{0.tag") + # throwWarning:tr("{0} makes no sense","{0.tag}") # fixAdd:"emergency=yes" # assertNoMatch:"way emergency=designated" # assertMatch:"way emergency=permissive" - err.append({'class': 9010002, 'subclass': 325672362, 'text': mapcss.tr(u'{0} makes no sense', u'{0.tag'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9010002, 'subclass': 325672362, 'text': mapcss.tr(u'{0} makes no sense', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'emergency',u'yes']]) }}) @@ -224,6 +532,211 @@ def way(self, data, tags, nds): # throwWarning:tr("{0} is unnecessary for {1}. The flow direction is defined by the way direction.","{1.key}","{0.key}") err.append({'class': 9010001, 'subclass': 1802985931, 'text': mapcss.tr(u'{0} is unnecessary for {1}. The flow direction is defined by the way direction.', mapcss._tag_uncapture(capture_tags, u'{1.key}'), mapcss._tag_uncapture(capture_tags, u'{0.key}'))}) + # *[name][name=~/^(?i)(parc|park)$/][leisure=park] + # *[name][name=~/^(?i)(pond)$/][water=pond] + # *[name][name=~/^(?i)(chapel|chapelle|kapelle)$/][building=chapel] + # *[name][name=~/^(?i)(church|église|biserica)$/][amenity=place_of_worship][religion=christian] + # *[name][name=~/^(?i)(mosque|cami|masjid|مسجد)$/][amenity=place_of_worship][religion=muslim] + # *[name][name=~/^(?i)(parking|parkplatz)$/][amenity=parking] + # *[name][name=~/^(?i)(post office)$/][amenity=post_office] + # *[name][name=~/^(?i)(restaurant)$/][amenity=restaurant] + # *[name][name=~/^(?i)(toilets?)$/][amenity=toilets] + # *[name][name=~/^(?i)(playground|spielplatz)$/][leisure=playground] + # *[name][name=~/^(?i)(shop|boutique)$/][shop][shop!=no] + # *[name][name=~/^(?i)(building|bangunan)$/][building][building!=no] + # *[name][name=~/^(?i)(house|casa|maison|rumah|vivienda)$/][building=house] + # *[name][name=~/^(?i)(kiosk)$/][shop=kiosk] + # *[name][name=~/^(?i)(path)$/][highway=path] + # *[name][name=~/^(?i)(jalan)$/][highway] + # *[name][name=~/^(?i)(silo)$/][man_made=silo] + # *[name][name=~/^(?i)(silo)$/][building=silo] + # *[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][amenity=grave_yard] + # *[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][landuse=cemetery] + # *[name][name=~/^(?i)(mairie|rathaus)$/][amenity=townhall] + # *[name][name=~/^(?i)(monument aux morts|war memorial)$/][historic=memorial][memorial=war_memorial] + # *[name][name=~/^(?i)(school|école|Школа)$/][building=school] + # *[name][name=~/^(?i)(school|école|Школа)$/][amenity=school] + # *[name][name=~/^(?i)(école élémentaire)$/][amenity=school]["school:FR"="élémentaire"] + # *[name][name=~/^(?i)(école maternelle)$/][amenity=school]["school:FR"="maternelle"] + # *[name][name=~/^(?i)(école primaire)$/][amenity=school]["school:FR"="primaire"] + # *[name][name=~/^(?i)(collège)$/][amenity=school]["school:FR"="collège"] + # *[name][name=~/^(?i)(lycée)$/][amenity=school]["school:FR"="lycée"] + # *[name][name=~/^(?i)(Аптека|farmacia|pharmacy|pharmacie)$/][amenity=pharmacy] + # *[name][name=~/^(?i)(АГЗС|АЗС)$/][amenity=fuel] + if (u'amenity' in keys and u'name' in keys) or (u'amenity' in keys and u'name' in keys and u'religion' in keys) or (u'amenity' in keys and u'name' in keys and u'school:FR' in keys) or (u'building' in keys and u'name' in keys) or (u'highway' in keys and u'name' in keys) or (u'historic' in keys and u'memorial' in keys and u'name' in keys) or (u'landuse' in keys and u'name' in keys) or (u'leisure' in keys and u'name' in keys) or (u'man_made' in keys and u'name' in keys) or (u'name' in keys and u'shop' in keys) or (u'name' in keys and u'water' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_10870b34), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') == mapcss._value_capture(capture_tags, 2, u'park')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1ba0f749), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'water') == mapcss._value_capture(capture_tags, 2, u'pond')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7c3e64db), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'chapel')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_33dfa05b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'place_of_worship') and mapcss._tag_capture(capture_tags, 3, tags, u'religion') == mapcss._value_capture(capture_tags, 3, u'christian')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_73411d88), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'place_of_worship') and mapcss._tag_capture(capture_tags, 3, tags, u'religion') == mapcss._value_capture(capture_tags, 3, u'muslim')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_251cae80), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'parking')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1b9641aa), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'post_office')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_017d2728), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'restaurant')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5b729ae4), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'toilets')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7dc8f17a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') == mapcss._value_capture(capture_tags, 2, u'playground')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_106eed50), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'shop') and mapcss._tag_capture(capture_tags, 3, tags, u'shop') != mapcss._value_capture(capture_tags, 3, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_480c7ba6), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2335ac87), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'house')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_577104db), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'shop') == mapcss._value_capture(capture_tags, 2, u'kiosk')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_702b1034), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'highway') == mapcss._value_capture(capture_tags, 2, u'path')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_644827a8), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'highway')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76c4f24d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'man_made') == mapcss._value_capture(capture_tags, 2, u'silo')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76c4f24d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'silo')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2b5b04af), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'grave_yard')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2b5b04af), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'landuse') == mapcss._value_capture(capture_tags, 2, u'cemetery')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2a48de72), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'townhall')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76f94888), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'historic') == mapcss._value_capture(capture_tags, 2, u'memorial') and mapcss._tag_capture(capture_tags, 3, tags, u'memorial') == mapcss._value_capture(capture_tags, 3, u'war_memorial')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'school')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_480ecdbb), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'élémentaire')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_740e0d70), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'maternelle')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3ad2c525), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'primaire')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_519078ac), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'collège')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_14b2be23), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'lycée')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_0a40c79a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'pharmacy')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6d34128b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'fuel')) + except mapcss.RuleAbort: pass + if match: + # group:tr("descriptive name") + # throwWarning:tr("{0}","{0.tag}") + # fixRemove:"name" + # assertMatch:"way name=Cmentarz amenity=grave_yard" + # assertMatch:"way name=Rumah building=house" + # assertNoMatch:"way name=Rumah building=yes" + # assertMatch:"way name=Silo building=silo" + # assertMatch:"way name=Silo man_made=silo building=silo" + # assertMatch:"way name=building building=house" + # assertMatch:"way name=building building=yes" + # assertMatch:"way name=cemetery amenity=grave_yard" + # assertMatch:"way name=house building=house" + # assertNoMatch:"way name=house building=yes" + # assertNoMatch:"way name=kiosk amenity=grave_yard" + # assertMatch:"way name=kiosk building=yes shop=kiosk" + # assertNoMatch:"way name=kiosk building=yes" + # assertNoMatch:"way name=parking" + # assertNoMatch:"way name=shop leisure=playground" + # assertMatch:"way name=silo man_made=silo" + err.append({'class': 9010003, 'subclass': 1160398162, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + u'name']) + }}) + + # *[name][name=~/^(?i)(school|école|Школа)$/][building][building!=school][building!=no] + # *[name][name=~/^(?i)(house|casa|rumah|vivienda)$/][building][building!=house][building!=no] + if (u'building' in keys and u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'school') and mapcss._tag_capture(capture_tags, 4, tags, u'building') != mapcss._value_capture(capture_tags, 4, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_053f39fb), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'house') and mapcss._tag_capture(capture_tags, 4, tags, u'building') != mapcss._value_capture(capture_tags, 4, u'no')) + except mapcss.RuleAbort: pass + if match: + # group:tr("descriptive name") + # throwWarning:tr("{0}","{0.tag}") + # assertNoMatch:"way name=Rumah building=house" + # assertMatch:"way name=Rumah building=yes" + # assertNoMatch:"way name=building building=house" + # assertNoMatch:"way name=building building=yes" + # assertNoMatch:"way name=house building=house" + # assertMatch:"way name=house building=yes" + err.append({'class': 9010003, 'subclass': 1173941116, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + return err def relation(self, data, tags, members): @@ -233,7 +746,7 @@ def relation(self, data, tags, members): # *[access][highway=proposed] - # *[motor_vehicle?][vehicle!=no][access!=no][bicycle_road!=yes][highway=~/^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] + # *[motor_vehicle?][!vehicle][!access][bicycle_road!=yes][highway=~/^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] # *[bridge=no] # *[building=no] # *[elevation="0"] @@ -246,7 +759,7 @@ def relation(self, data, tags, members): except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'motor_vehicle') in ('yes', 'true', '1') and mapcss._tag_capture(capture_tags, 1, tags, u'vehicle') != mapcss._value_capture(capture_tags, 1, u'no') and mapcss._tag_capture(capture_tags, 2, tags, u'access') != mapcss._value_capture(capture_tags, 2, u'no') and mapcss._tag_capture(capture_tags, 3, tags, u'bicycle_road') != mapcss._value_capture(capture_tags, 3, u'yes') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_3ad9e1f5), mapcss._tag_capture(capture_tags, 4, tags, u'highway'))) + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'motor_vehicle') in ('yes', 'true', '1') and not mapcss._tag_capture(capture_tags, 1, tags, u'vehicle') and not mapcss._tag_capture(capture_tags, 2, tags, u'access') and mapcss._tag_capture(capture_tags, 3, tags, u'bicycle_road') != mapcss._value_capture(capture_tags, 3, u'yes') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 4, self.re_3ad9e1f5), mapcss._tag_capture(capture_tags, 4, tags, u'highway'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} @@ -268,7 +781,43 @@ def relation(self, data, tags, members): # group:tr("unnecessary tag") # throwWarning:tr("{0} is unnecessary","{0.tag}") # fixRemove:"{0.key}" - err.append({'class': 9010001, 'subclass': 1949087363, 'text': mapcss.tr(u'{0} is unnecessary', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9010001, 'subclass': 2110229428, 'text': mapcss.tr(u'{0} is unnecessary', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + mapcss._tag_uncapture(capture_tags, u'{0.key}')]) + }}) + + # *[gnis:Class="Populated Place"][place=city] + # *[gnis:Class="Populated Place"][place=town] + # *[gnis:Class="Populated Place"][place=village] + # *[gnis:Class="Populated Place"][place=hamlet] + # *[gnis:Class=Summit][natural=peak] + if (u'gnis:Class' in keys and u'natural' in keys) or (u'gnis:Class' in keys and u'place' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'city')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'town')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'village')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Populated Place') and mapcss._tag_capture(capture_tags, 1, tags, u'place') == mapcss._value_capture(capture_tags, 1, u'hamlet')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'gnis:Class') == mapcss._value_capture(capture_tags, 0, u'Summit') and mapcss._tag_capture(capture_tags, 1, tags, u'natural') == mapcss._value_capture(capture_tags, 1, u'peak')) + except mapcss.RuleAbort: pass + if match: + # group:tr("unnecessary tag") + # throwWarning:tr("{0} is unnecessary for {1}","{0.tag}","{1.tag}") + # fixRemove:"{0.key}" + err.append({'class': 9010001, 'subclass': 1667787383, 'text': mapcss.tr(u'{0} is unnecessary for {1}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'), mapcss._tag_uncapture(capture_tags, u'{1.tag}')), 'allow_fix_override': True, 'fix': { '-': ([ mapcss._tag_uncapture(capture_tags, u'{0.key}')]) }}) @@ -281,9 +830,9 @@ def relation(self, data, tags, members): try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'emergency') == mapcss._value_capture(capture_tags, 0, u'permissive')) except mapcss.RuleAbort: pass if match: - # throwWarning:tr("{0} makes no sense","{0.tag") + # throwWarning:tr("{0} makes no sense","{0.tag}") # fixAdd:"emergency=yes" - err.append({'class': 9010002, 'subclass': 325672362, 'text': mapcss.tr(u'{0} makes no sense', u'{0.tag'), 'allow_fix_override': True, 'fix': { + err.append({'class': 9010002, 'subclass': 325672362, 'text': mapcss.tr(u'{0} makes no sense', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { '+': dict([ [u'emergency',u'yes']]) }}) @@ -304,6 +853,192 @@ def relation(self, data, tags, members): u'payment:cash']) }}) + # *[name][name=~/^(?i)(parc|park)$/][leisure=park] + # *[name][name=~/^(?i)(pond)$/][water=pond] + # *[name][name=~/^(?i)(chapel|chapelle|kapelle)$/][building=chapel] + # *[name][name=~/^(?i)(church|église|biserica)$/][amenity=place_of_worship][religion=christian] + # *[name][name=~/^(?i)(mosque|cami|masjid|مسجد)$/][amenity=place_of_worship][religion=muslim] + # *[name][name=~/^(?i)(parking|parkplatz)$/][amenity=parking] + # *[name][name=~/^(?i)(post office)$/][amenity=post_office] + # *[name][name=~/^(?i)(restaurant)$/][amenity=restaurant] + # *[name][name=~/^(?i)(toilets?)$/][amenity=toilets] + # *[name][name=~/^(?i)(playground|spielplatz)$/][leisure=playground] + # *[name][name=~/^(?i)(shop|boutique)$/][shop][shop!=no] + # *[name][name=~/^(?i)(building|bangunan)$/][building][building!=no] + # *[name][name=~/^(?i)(house|casa|maison|rumah|vivienda)$/][building=house] + # *[name][name=~/^(?i)(kiosk)$/][shop=kiosk] + # *[name][name=~/^(?i)(path)$/][highway=path] + # *[name][name=~/^(?i)(jalan)$/][highway] + # *[name][name=~/^(?i)(silo)$/][man_made=silo] + # *[name][name=~/^(?i)(silo)$/][building=silo] + # *[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][amenity=grave_yard] + # *[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][landuse=cemetery] + # *[name][name=~/^(?i)(mairie|rathaus)$/][amenity=townhall] + # *[name][name=~/^(?i)(monument aux morts|war memorial)$/][historic=memorial][memorial=war_memorial] + # *[name][name=~/^(?i)(school|école|Школа)$/][building=school] + # *[name][name=~/^(?i)(school|école|Школа)$/][amenity=school] + # *[name][name=~/^(?i)(école élémentaire)$/][amenity=school]["school:FR"="élémentaire"] + # *[name][name=~/^(?i)(école maternelle)$/][amenity=school]["school:FR"="maternelle"] + # *[name][name=~/^(?i)(école primaire)$/][amenity=school]["school:FR"="primaire"] + # *[name][name=~/^(?i)(collège)$/][amenity=school]["school:FR"="collège"] + # *[name][name=~/^(?i)(lycée)$/][amenity=school]["school:FR"="lycée"] + # *[name][name=~/^(?i)(Аптека|farmacia|pharmacy|pharmacie)$/][amenity=pharmacy] + # *[name][name=~/^(?i)(АГЗС|АЗС)$/][amenity=fuel] + if (u'amenity' in keys and u'name' in keys) or (u'amenity' in keys and u'name' in keys and u'religion' in keys) or (u'amenity' in keys and u'name' in keys and u'school:FR' in keys) or (u'building' in keys and u'name' in keys) or (u'highway' in keys and u'name' in keys) or (u'historic' in keys and u'memorial' in keys and u'name' in keys) or (u'landuse' in keys and u'name' in keys) or (u'leisure' in keys and u'name' in keys) or (u'man_made' in keys and u'name' in keys) or (u'name' in keys and u'shop' in keys) or (u'name' in keys and u'water' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_10870b34), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') == mapcss._value_capture(capture_tags, 2, u'park')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1ba0f749), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'water') == mapcss._value_capture(capture_tags, 2, u'pond')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7c3e64db), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'chapel')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_33dfa05b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'place_of_worship') and mapcss._tag_capture(capture_tags, 3, tags, u'religion') == mapcss._value_capture(capture_tags, 3, u'christian')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_73411d88), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'place_of_worship') and mapcss._tag_capture(capture_tags, 3, tags, u'religion') == mapcss._value_capture(capture_tags, 3, u'muslim')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_251cae80), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'parking')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_1b9641aa), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'post_office')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_017d2728), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'restaurant')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_5b729ae4), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'toilets')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_7dc8f17a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'leisure') == mapcss._value_capture(capture_tags, 2, u'playground')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_106eed50), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'shop') and mapcss._tag_capture(capture_tags, 3, tags, u'shop') != mapcss._value_capture(capture_tags, 3, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_480c7ba6), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2335ac87), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'house')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_577104db), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'shop') == mapcss._value_capture(capture_tags, 2, u'kiosk')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_702b1034), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'highway') == mapcss._value_capture(capture_tags, 2, u'path')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_644827a8), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'highway')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76c4f24d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'man_made') == mapcss._value_capture(capture_tags, 2, u'silo')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76c4f24d), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'silo')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2b5b04af), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'grave_yard')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2b5b04af), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'landuse') == mapcss._value_capture(capture_tags, 2, u'cemetery')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_2a48de72), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'townhall')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_76f94888), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'historic') == mapcss._value_capture(capture_tags, 2, u'memorial') and mapcss._tag_capture(capture_tags, 3, tags, u'memorial') == mapcss._value_capture(capture_tags, 3, u'war_memorial')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') == mapcss._value_capture(capture_tags, 2, u'school')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_480ecdbb), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'élémentaire')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_740e0d70), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'maternelle')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3ad2c525), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'primaire')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_519078ac), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'collège')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_14b2be23), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'school') and mapcss._tag_capture(capture_tags, 3, tags, u'school:FR') == mapcss._value_capture(capture_tags, 3, u'lycée')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_0a40c79a), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'pharmacy')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6d34128b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'amenity') == mapcss._value_capture(capture_tags, 2, u'fuel')) + except mapcss.RuleAbort: pass + if match: + # group:tr("descriptive name") + # throwWarning:tr("{0}","{0.tag}") + # fixRemove:"name" + # assertMatch:"relation name=PLAYGROUND leisure=playground type=multipolygon" + # assertMatch:"relation name=Parking amenity=parking type=multipolygon" + # assertMatch:"relation name=parking amenity=parking type=multipolygon" + err.append({'class': 9010003, 'subclass': 1160398162, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + '-': ([ + u'name']) + }}) + + # *[name][name=~/^(?i)(school|école|Школа)$/][building][building!=school][building!=no] + # *[name][name=~/^(?i)(house|casa|rumah|vivienda)$/][building][building!=house][building!=no] + if (u'building' in keys and u'name' in keys): + match = False + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_337f006b), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'school') and mapcss._tag_capture(capture_tags, 4, tags, u'building') != mapcss._value_capture(capture_tags, 4, u'no')) + except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = (mapcss._tag_capture(capture_tags, 0, tags, u'name') and mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_053f39fb), mapcss._tag_capture(capture_tags, 1, tags, u'name')) and mapcss._tag_capture(capture_tags, 2, tags, u'building') and mapcss._tag_capture(capture_tags, 3, tags, u'building') != mapcss._value_capture(capture_tags, 3, u'house') and mapcss._tag_capture(capture_tags, 4, tags, u'building') != mapcss._value_capture(capture_tags, 4, u'no')) + except mapcss.RuleAbort: pass + if match: + # group:tr("descriptive name") + # throwWarning:tr("{0}","{0.tag}") + err.append({'class': 9010003, 'subclass': 1173941116, 'text': mapcss.tr(u'{0}', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))}) + return err @@ -321,8 +1056,44 @@ class father: n.init(None) data = {'id': 0, 'lat': 0, 'lon': 0} - self.check_err(n.way(data, {u'bridge': u'no'}, [0]), expected={'class': 9010001, 'subclass': 1949087363}) - self.check_err(n.way(data, {u'access': u'no', u'highway': u'proposed'}, [0]), expected={'class': 9010001, 'subclass': 1949087363}) - self.check_err(n.way(data, {u'layer': u'0'}, [0]), expected={'class': 9010001, 'subclass': 1949087363}) + self.check_not_err(n.node(data, {u'amenity': u'parking', u'name': u'Megaparking'}), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.node(data, {u'leisure': u'playground', u'name': u'PLaYGrOUNd'}), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.node(data, {u'amenity': u'parking', u'name': u'Parking'}), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.node(data, {u'amenity': u'parking', u'name': u'Parking_with_suffix'}), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.node(data, {u'amenity': u'parking', u'name': u'parking'}), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.node(data, {u'name': u'shop', u'shop': u'no'}), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.node(data, {u'name': u'shop', u'shop': u'whatever'}), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'bridge': u'no'}, [0]), expected={'class': 9010001, 'subclass': 2110229428}) + self.check_not_err(n.way(data, {u'access': u'no', u'highway': u'motorway', u'motor_vehicle': u'yes'}, [0]), expected={'class': 9010001, 'subclass': 2110229428}) + self.check_err(n.way(data, {u'highway': u'motorway', u'motor_vehicle': u'yes'}, [0]), expected={'class': 9010001, 'subclass': 2110229428}) + self.check_err(n.way(data, {u'access': u'no', u'highway': u'proposed'}, [0]), expected={'class': 9010001, 'subclass': 2110229428}) + self.check_err(n.way(data, {u'layer': u'0'}, [0]), expected={'class': 9010001, 'subclass': 2110229428}) + self.check_not_err(n.way(data, {u'access': u'no', u'foot': u'designated', u'highway': u'pedestrian'}, [0]), expected={'class': 9010001, 'subclass': 92001477}) + self.check_err(n.way(data, {u'foot': u'designated', u'highway': u'pedestrian'}, [0]), expected={'class': 9010001, 'subclass': 92001477}) self.check_not_err(n.way(data, {u'emergency': u'designated'}, [0]), expected={'class': 9010002, 'subclass': 325672362}) self.check_err(n.way(data, {u'emergency': u'permissive'}, [0]), expected={'class': 9010002, 'subclass': 325672362}) + self.check_err(n.way(data, {u'amenity': u'grave_yard', u'name': u'Cmentarz'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'building': u'house', u'name': u'Rumah'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.way(data, {u'building': u'yes', u'name': u'Rumah'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'building': u'silo', u'name': u'Silo'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'building': u'silo', u'man_made': u'silo', u'name': u'Silo'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'building': u'house', u'name': u'building'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'building': u'yes', u'name': u'building'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'amenity': u'grave_yard', u'name': u'cemetery'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'building': u'house', u'name': u'house'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.way(data, {u'building': u'yes', u'name': u'house'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.way(data, {u'amenity': u'grave_yard', u'name': u'kiosk'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'building': u'yes', u'name': u'kiosk', u'shop': u'kiosk'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.way(data, {u'building': u'yes', u'name': u'kiosk'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.way(data, {u'name': u'parking'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.way(data, {u'leisure': u'playground', u'name': u'shop'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.way(data, {u'man_made': u'silo', u'name': u'silo'}, [0]), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_not_err(n.way(data, {u'building': u'house', u'name': u'Rumah'}, [0]), expected={'class': 9010003, 'subclass': 1173941116}) + self.check_err(n.way(data, {u'building': u'yes', u'name': u'Rumah'}, [0]), expected={'class': 9010003, 'subclass': 1173941116}) + self.check_not_err(n.way(data, {u'building': u'house', u'name': u'building'}, [0]), expected={'class': 9010003, 'subclass': 1173941116}) + self.check_not_err(n.way(data, {u'building': u'yes', u'name': u'building'}, [0]), expected={'class': 9010003, 'subclass': 1173941116}) + self.check_not_err(n.way(data, {u'building': u'house', u'name': u'house'}, [0]), expected={'class': 9010003, 'subclass': 1173941116}) + self.check_err(n.way(data, {u'building': u'yes', u'name': u'house'}, [0]), expected={'class': 9010003, 'subclass': 1173941116}) + self.check_err(n.relation(data, {u'leisure': u'playground', u'name': u'PLAYGROUND', u'type': u'multipolygon'}, []), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.relation(data, {u'amenity': u'parking', u'name': u'Parking', u'type': u'multipolygon'}, []), expected={'class': 9010003, 'subclass': 1160398162}) + self.check_err(n.relation(data, {u'amenity': u'parking', u'name': u'parking', u'type': u'multipolygon'}, []), expected={'class': 9010003, 'subclass': 1160398162}) diff --git a/plugins/Josm_wikipedia.py b/plugins/Josm_wikipedia.py index e93bf2797..d63d90b91 100644 --- a/plugins/Josm_wikipedia.py +++ b/plugins/Josm_wikipedia.py @@ -16,7 +16,7 @@ def init(self, logger): self.errors[9011003] = {'item': 9011, 'level': 3, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'deprecated tagging')} self.errors[9011004] = {'item': 9011, 'level': 3, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'wikipedia \'\'{0}\'\' language is obsolete, use \'\'{1}\'\' instead', u'be-x-old', u'be-tarask')} self.errors[9011005] = {'item': 9011, 'level': 3, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'wikipedia \'\'{0}\'\' language is invalid, use \'\'{1}\'\' instead', u'cz', u'cs')} - self.errors[9011006] = {'item': 9011, 'level': 2, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.tag}'))} + self.errors[9011006] = {'item': 9011, 'level': 2, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}'))} self.errors[9011007] = {'item': 9011, 'level': 3, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'wikipedia title should not start with a space after language code')} self.errors[9011008] = {'item': 9011, 'level': 3, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'wikipedia title should not have \'\'{0}\'\' prefix', u'wiki/')} self.errors[9011009] = {'item': 9011, 'level': 3, 'tag': ["tag", "wikipedia"], 'desc': mapcss.tr(u'wikipedia page title should have first letter capitalized')} @@ -162,11 +162,11 @@ def node(self, data, tags): try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_19995c46), mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia'))) except mapcss.RuleAbort: pass if match: - # throwError:tr("{0} tag should not have URL-encoded values like ''%27''","{0.tag}") + # throwError:tr("{0} tag should not have URL-encoded values like ''%27''","{0.key}") # fixAdd:concat("wikipedia=",get(regexp_match("(?i)^([-a-z]+:)(.*)$",tag("wikipedia")),1),trim(replace(URL_decode(get(regexp_match("(?i)^([-a-z]+:)(.+)$",tag("wikipedia")),2)),"_"," "))) # assertMatch:"node wikipedia=en:Foo%27s" # assertNoMatch:"node wikipedia=en:Foo" - err.append({'class': 9011006, 'subclass': 83644825, 'text': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9011006, 'subclass': 83644825, 'text': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'wikipedia=', mapcss.get(mapcss.regexp_match(self.re_676bdf5d, mapcss.tag(tags, u'wikipedia')), 1), mapcss.trim(mapcss.replace(mapcss.URL_decode(mapcss.get(mapcss.regexp_match(self.re_1559839b, mapcss.tag(tags, u'wikipedia')), 2)), u'_', u' ')))).split('=', 1)]) }}) @@ -501,9 +501,9 @@ def way(self, data, tags, nds): try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_19995c46), mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia'))) except mapcss.RuleAbort: pass if match: - # throwError:tr("{0} tag should not have URL-encoded values like ''%27''","{0.tag}") + # throwError:tr("{0} tag should not have URL-encoded values like ''%27''","{0.key}") # fixAdd:concat("wikipedia=",get(regexp_match("(?i)^([-a-z]+:)(.*)$",tag("wikipedia")),1),trim(replace(URL_decode(get(regexp_match("(?i)^([-a-z]+:)(.+)$",tag("wikipedia")),2)),"_"," "))) - err.append({'class': 9011006, 'subclass': 83644825, 'text': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9011006, 'subclass': 83644825, 'text': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'wikipedia=', mapcss.get(mapcss.regexp_match(self.re_676bdf5d, mapcss.tag(tags, u'wikipedia')), 1), mapcss.trim(mapcss.replace(mapcss.URL_decode(mapcss.get(mapcss.regexp_match(self.re_1559839b, mapcss.tag(tags, u'wikipedia')), 2)), u'_', u' ')))).split('=', 1)]) }}) @@ -816,9 +816,9 @@ def relation(self, data, tags, members): try: match = (mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_19995c46), mapcss._tag_capture(capture_tags, 0, tags, u'wikipedia'))) except mapcss.RuleAbort: pass if match: - # throwError:tr("{0} tag should not have URL-encoded values like ''%27''","{0.tag}") + # throwError:tr("{0} tag should not have URL-encoded values like ''%27''","{0.key}") # fixAdd:concat("wikipedia=",get(regexp_match("(?i)^([-a-z]+:)(.*)$",tag("wikipedia")),1),trim(replace(URL_decode(get(regexp_match("(?i)^([-a-z]+:)(.+)$",tag("wikipedia")),2)),"_"," "))) - err.append({'class': 9011006, 'subclass': 83644825, 'text': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.tag}')), 'allow_fix_override': True, 'fix': { + err.append({'class': 9011006, 'subclass': 83644825, 'text': mapcss.tr(u'{0} tag should not have URL-encoded values like \'\'%27\'\'', mapcss._tag_uncapture(capture_tags, u'{0.key}')), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(u'wikipedia=', mapcss.get(mapcss.regexp_match(self.re_676bdf5d, mapcss.tag(tags, u'wikipedia')), 1), mapcss.trim(mapcss.replace(mapcss.URL_decode(mapcss.get(mapcss.regexp_match(self.re_1559839b, mapcss.tag(tags, u'wikipedia')), 2)), u'_', u' ')))).split('=', 1)]) }}) diff --git a/plugins/Name_Cadastre_FR.py b/plugins/Name_Cadastre_FR.py index 57439a8d6..1126f3aac 100644 --- a/plugins/Name_Cadastre_FR.py +++ b/plugins/Name_Cadastre_FR.py @@ -64,8 +64,6 @@ def way(self, data, tags, nds): if match: # -osmoseItemClassLevel:"5080/50801/1" # throwError:tr("Hamlet or Locality name suffix Nord, Sud, Est, Ouest, Centre should be removed from Cadastre name. Place should be integrated only once.") - # -osmoseAssertNoMatchWithContext:list('node place=hamlet name="ZA Sud Loire"',"inside=FR") - # -osmoseAssertMatchWithContext:list('node place=hamlet name=Montdésert-Sud',"inside=FR") err.append({'class': 50801, 'subclass': 0, 'text': mapcss.tr(u'Hamlet or Locality name suffix Nord, Sud, Est, Ouest, Centre should be removed from Cadastre name. Place should be integrated only once.')}) return err @@ -89,7 +87,3 @@ class father: self.check_not_err(n.node(data, {u'name': u'ZA Sud Loire', u'place': u'hamlet'}), expected={'class': 50801, 'subclass': 0}) with with_options(n, {'country': 'FR'}): self.check_err(n.node(data, {u'name': u'Montdésert-Sud', u'place': u'hamlet'}), expected={'class': 50801, 'subclass': 0}) - with with_options(n, {'country': 'FR'}): - self.check_not_err(n.node(data, {u'name': u'ZA Sud Loire', u'place': u'hamlet'}), expected={'class': 50801, 'subclass': 0}) - with with_options(n, {'country': 'FR'}): - self.check_err(n.node(data, {u'name': u'Montdésert-Sud', u'place': u'hamlet'}), expected={'class': 50801, 'subclass': 0}) diff --git a/plugins/Name_MisspelledWordByRegex_Lang_fa.py b/plugins/Name_MisspelledWordByRegex_Lang_fa.py index 426184825..98db53833 100644 --- a/plugins/Name_MisspelledWordByRegex_Lang_fa.py +++ b/plugins/Name_MisspelledWordByRegex_Lang_fa.py @@ -98,9 +98,6 @@ def way(self, data, tags, nds): # -osmoseItemClassLevel:"5010/50109001/2" # throwError:tr("In Farsi, the Arabic letter '{0}' should be replaced by '{1}'","ي","ی") # fixAdd:concat("{0.key}=",replace("{0.value}","ي","ی")) - # -osmoseAssertMatchWithContext:list('node name="روابط عمومي مجتمع مس شهربابك"','language=fa') - # assertMatch:'node name:fa="روابط عمومي مجتمع مس شهربابك"' - # assertNoMatch:'node name="روابط عمومي مجتمع مس شهربابك"' err.append({'class': 50109001, 'subclass': 0, 'text': mapcss.tr(u'In Farsi, the Arabic letter \'{0}\' should be replaced by \'{1}\'', u'ي', u'ی'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(mapcss._tag_uncapture(capture_tags, u'{0.key}='), mapcss.replace(mapcss._tag_uncapture(capture_tags, u'{0.value}'), u'ي', u'ی'))).split('=', 1)]) @@ -123,9 +120,6 @@ def way(self, data, tags, nds): # -osmoseItemClassLevel:"5010/50109001/2" # throwError:tr("In Farsi, the Arabic letter '{0}' should be replaced by '{1}'","ك","ک") # fixAdd:concat("{0.key}=",replace("{0.value}","ك","ک")) - # -osmoseAssertMatchWithContext:list('node name="روابط عمومي مجتمع مس شهربابك"','language=fa') - # assertMatch:'node name:fa="روابط عمومي مجتمع مس شهربابك"' - # assertNoMatch:'node name="روابط عمومي مجتمع مس شهربابك"' err.append({'class': 50109001, 'subclass': 0, 'text': mapcss.tr(u'In Farsi, the Arabic letter \'{0}\' should be replaced by \'{1}\'', u'ك', u'ک'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(mapcss._tag_uncapture(capture_tags, u'{0.key}='), mapcss.replace(mapcss._tag_uncapture(capture_tags, u'{0.value}'), u'ك', u'ک'))).split('=', 1)]) @@ -156,9 +150,6 @@ def relation(self, data, tags, members): # -osmoseItemClassLevel:"5010/50109001/2" # throwError:tr("In Farsi, the Arabic letter '{0}' should be replaced by '{1}'","ي","ی") # fixAdd:concat("{0.key}=",replace("{0.value}","ي","ی")) - # -osmoseAssertMatchWithContext:list('node name="روابط عمومي مجتمع مس شهربابك"','language=fa') - # assertMatch:'node name:fa="روابط عمومي مجتمع مس شهربابك"' - # assertNoMatch:'node name="روابط عمومي مجتمع مس شهربابك"' err.append({'class': 50109001, 'subclass': 0, 'text': mapcss.tr(u'In Farsi, the Arabic letter \'{0}\' should be replaced by \'{1}\'', u'ي', u'ی'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(mapcss._tag_uncapture(capture_tags, u'{0.key}='), mapcss.replace(mapcss._tag_uncapture(capture_tags, u'{0.value}'), u'ي', u'ی'))).split('=', 1)]) @@ -181,9 +172,6 @@ def relation(self, data, tags, members): # -osmoseItemClassLevel:"5010/50109001/2" # throwError:tr("In Farsi, the Arabic letter '{0}' should be replaced by '{1}'","ك","ک") # fixAdd:concat("{0.key}=",replace("{0.value}","ك","ک")) - # -osmoseAssertMatchWithContext:list('node name="روابط عمومي مجتمع مس شهربابك"','language=fa') - # assertMatch:'node name:fa="روابط عمومي مجتمع مس شهربابك"' - # assertNoMatch:'node name="روابط عمومي مجتمع مس شهربابك"' err.append({'class': 50109001, 'subclass': 0, 'text': mapcss.tr(u'In Farsi, the Arabic letter \'{0}\' should be replaced by \'{1}\'', u'ك', u'ک'), 'allow_fix_override': True, 'fix': { '+': dict([ (mapcss.concat(mapcss._tag_uncapture(capture_tags, u'{0.key}='), mapcss.replace(mapcss._tag_uncapture(capture_tags, u'{0.value}'), u'ك', u'ک'))).split('=', 1)]) @@ -214,19 +202,3 @@ class father: self.check_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) self.check_err(n.node(data, {u'name:fa': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) self.check_not_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - with with_options(n, {'language': 'fa'}): - self.check_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_err(n.node(data, {u'name:fa': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_not_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - with with_options(n, {'language': 'fa'}): - self.check_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_err(n.node(data, {u'name:fa': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_not_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - with with_options(n, {'language': 'fa'}): - self.check_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_err(n.node(data, {u'name:fa': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_not_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - with with_options(n, {'language': 'fa'}): - self.check_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_err(n.node(data, {u'name:fa': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0}) - self.check_not_err(n.node(data, {u'name': u'روابط عمومي مجتمع مس شهربابك'}), expected={'class': 50109001, 'subclass': 0})