From 92735caca3a907f73e557f19a6e64444c2f6cadf Mon Sep 17 00:00:00 2001 From: Famlam Date: Sat, 24 Aug 2024 22:35:56 +0200 Subject: [PATCH] Update mapcss --- plugins/Josm_DutchSpecific.py | 73 +++++++------ plugins/Josm_FranceSpecificRules.py | 53 ++++++---- plugins/Josm_deprecated.py | 156 ++++++++++++++++++++++++++++ 3 files changed, 227 insertions(+), 55 deletions(-) diff --git a/plugins/Josm_DutchSpecific.py b/plugins/Josm_DutchSpecific.py index 69af6b798..a829349cd 100644 --- a/plugins/Josm_DutchSpecific.py +++ b/plugins/Josm_DutchSpecific.py @@ -73,6 +73,7 @@ def init(self, logger): self.re_3254c1c6 = re.compile(r'(?i)(parkeren$|parkeerplaats$|^toegang(sweg)?\s|^richting\s|drive.thro?u(gh)?)') self.re_32d334cf = re.compile(r'(^|.+:)addr:street($|:.+)') self.re_33480e64 = re.compile(r'^maxheight(:forward|:backward|:both_ways)?(:conditional)?$') + self.re_334bd9c9 = re.compile(r'\bhout|\bmetaal\b|^beton$|^brons$|steen\b|ijzer\b|staal\b') self.re_339dfcbd = re.compile(r'^maxweight(:backward|:both_ways)?(:conditional)?$') self.re_33af5199 = re.compile(r'^motorcycle(:backward|:both_ways)?(:conditional)?$') self.re_33fbfa8d = re.compile(r'(?i)post\W?nl$') @@ -108,7 +109,6 @@ def init(self, logger): self.re_556f4d08 = re.compile(r'^maxweight(:forward|:both_ways)?(:conditional)?$') self.re_5577fcc2 = re.compile(r'^hgv(:backward|:both_ways)?(:conditional)?$') self.re_5578cc63 = re.compile(r'100.+19:00') - self.re_55879a11 = re.compile(r'^(no|-1|0)$') self.re_561be3ff = re.compile(r'^addr:(city|postcode)$') self.re_594405dc = re.compile(r'^(00|\+)31 ?0( ?[0-9]){7,}') self.re_59aca94c = re.compile(r'(^|; ?)NL:C20\b') @@ -408,6 +408,20 @@ def node(self, data, tags): mapcss._tag_uncapture(capture_tags, '{0.key}')]) }}) + # *[material][material=~/\bhout|\bmetaal\b|^beton$|^brons$|steen\b|ijzer\b|staal\b/] + if ('material' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'material')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_334bd9c9), mapcss._tag_capture(capture_tags, 1, tags, 'material')))) + except mapcss.RuleAbort: pass + if match: + # group:tr("NL deprecated features") + # throwWarning:tr("unusual value of {0}","{0.key}") + # assertMatch:"node tourism=artwork material=brons" + # assertMatch:"node tourism=artwork material=hout,metaal" + err.append({'class': 90202, 'subclass': 1686750599, 'text': mapcss.tr('unusual value of {0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # *[surface][surface=~/^paving_stones:([1-9])0$/][inside("NL")] if ('surface' in keys): match = False @@ -2337,19 +2351,25 @@ def way(self, data, tags, nds): err.append({'class': 90202, 'subclass': 1111134078, 'text': mapcss.tr('Het concept {0} bestaat niet in Nederland', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) # way[surface][surface=~/stenen$|^hout$|\bbestraa?t(ing)?$|grond$|^puin$|^grind$|zand$/] - if ('surface' in keys): + # *[material][material=~/\bhout|\bmetaal\b|^beton$|^brons$|steen\b|ijzer\b|staal\b/] + if ('material' in keys) or ('surface' in keys): match = False if not match: capture_tags = {} try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'surface')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_6454d3f5), mapcss._tag_capture(capture_tags, 1, tags, 'surface')))) except mapcss.RuleAbort: pass + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'material')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_334bd9c9), mapcss._tag_capture(capture_tags, 1, tags, 'material')))) + except mapcss.RuleAbort: pass if match: # group:tr("NL deprecated features") # throwWarning:tr("unusual value of {0}","{0.key}") # assertMatch:"way highway=service surface=\"niet bestraat\"" # assertNoMatch:"way highway=service surface=paving_stones" # assertMatch:"way highway=service surface=straatstenen" - err.append({'class': 90202, 'subclass': 1678452337, 'text': mapcss.tr('unusual value of {0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # assertNoMatch:"way tourism=artwork material=bronze" + err.append({'class': 90202, 'subclass': 1205828493, 'text': mapcss.tr('unusual value of {0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) # *[surface][surface=~/^paving_stones:([1-9])0$/][inside("NL")] if ('surface' in keys): @@ -2933,27 +2953,6 @@ def way(self, data, tags, nds): # assertNoMatch:"way highway=unclassified access=permissive note=eigen_weg maxspeed=25" err.append({'class': 90207, 'subclass': 293871183, 'text': mapcss.tr('{0} is a non-standard speed limit. Possibly this is an advisory speed limit instead?', mapcss._tag_uncapture(capture_tags, '{0.tag}'))}) - # way[oneway:bicycle][!oneway:mofa][oneway?][oneway:bicycle=~/^(no|-1|0)$/][mofa!~/^(no|use_sidepath)$/][motor_vehicle!~/^(no|use_sidepath)$/][mofa:backward!~/^(no|use_sidepath)$/][motor_vehicle:backward!~/^(no|use_sidepath)$/][inside("NL")] - if ('oneway' in keys and 'oneway:bicycle' in keys): - match = False - if not match: - capture_tags = {} - try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'oneway:bicycle')) and (not mapcss._tag_capture(capture_tags, 1, tags, 'oneway:mofa')) and (mapcss._tag_capture(capture_tags, 2, tags, 'oneway') in ('yes', 'true', '1')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 3, self.re_55879a11), mapcss._tag_capture(capture_tags, 3, tags, 'oneway:bicycle'))) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 4, self.re_143f11c5, '^(no|use_sidepath)$'), mapcss._tag_capture(capture_tags, 4, tags, 'mofa'))) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 5, self.re_143f11c5, '^(no|use_sidepath)$'), mapcss._tag_capture(capture_tags, 5, tags, 'motor_vehicle'))) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 6, self.re_143f11c5, '^(no|use_sidepath)$'), mapcss._tag_capture(capture_tags, 6, tags, 'mofa:backward'))) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 7, self.re_143f11c5, '^(no|use_sidepath)$'), mapcss._tag_capture(capture_tags, 7, tags, 'motor_vehicle:backward'))) and (mapcss.inside(self.father.config.options, 'NL'))) - except mapcss.RuleAbort: pass - if match: - # group:tr("NL mofa tagging") - # throwWarning:tr("{0} without {1}","{0.tag}","{1.key}") - # fixAdd:"{1.key}={0.value}" - # assertNoMatch:"way highway=residential oneway:bicycle=no oneway=no" - # assertNoMatch:"way highway=residential oneway:bicycle=no oneway=yes mofa:backward=no" - # assertNoMatch:"way highway=residential oneway:bicycle=no oneway=yes mofa=no" - # assertNoMatch:"way highway=residential oneway:bicycle=no oneway=yes oneway:mofa=yes" - # assertNoMatch:"way highway=residential oneway:bicycle=yes oneway=yes" - err.append({'class': 90208, 'subclass': 45390626, 'text': mapcss.tr('{0} without {1}', mapcss._tag_uncapture(capture_tags, '{0.tag}'), mapcss._tag_uncapture(capture_tags, '{1.key}')), 'allow_fix_override': True, 'fix': { - '+': dict([ - (mapcss._tag_uncapture(capture_tags, '{1.key}={0.value}')).split('=', 1)]) - }}) - # way[bicycle:conditional][moped:conditional][bicycle:conditional=*"moped:conditional"][!mofa:conditional][inside("NL")] # way[bicycle:forward][moped:forward][bicycle:forward=*"moped:forward"][!mofa:forward][!mofa][!mofa:both_ways][bicycle:forward!=designated][bicycle:forward!=yes][inside("NL")] # way[bicycle:backward][moped:backward][bicycle:backward=*"moped:backward"][!mofa:backward][!mofa][!mofa:both_ways][bicycle:backward!=designated][bicycle:backward!=yes][inside("NL")] @@ -3354,6 +3353,18 @@ def relation(self, data, tags, members): mapcss._tag_uncapture(capture_tags, '{0.key}')]) }}) + # *[material][material=~/\bhout|\bmetaal\b|^beton$|^brons$|steen\b|ijzer\b|staal\b/] + if ('material' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'material')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_334bd9c9), mapcss._tag_capture(capture_tags, 1, tags, 'material')))) + except mapcss.RuleAbort: pass + if match: + # group:tr("NL deprecated features") + # throwWarning:tr("unusual value of {0}","{0.key}") + err.append({'class': 90202, 'subclass': 1686750599, 'text': mapcss.tr('unusual value of {0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # *[surface][surface=~/^paving_stones:([1-9])0$/][inside("NL")] if ('surface' in keys): match = False @@ -3647,6 +3658,8 @@ class father: self.check_not_err(n.node(data, {'addr:city': 'XXX', 'addr:housenumber:construction': '123', 'addr:postcode': '1234AB', 'addr:street': 'XXX'}), expected={'class': 90201, 'subclass': 509151640}) self.check_not_err(n.node(data, {'addr:city': 'XXX', 'addr:housenumber': '123', 'addr:postcode': '1234AB', 'addr:street': 'XXX'}), expected={'class': 90201, 'subclass': 509151640}) self.check_not_err(n.node(data, {'addr:city': 'XXX', 'addr:postcode': '1234AB', 'addr:street': 'XXX', 'proposed:addr:housenumber': '123'}), expected={'class': 90201, 'subclass': 509151640}) + self.check_err(n.node(data, {'material': 'brons', 'tourism': 'artwork'}), expected={'class': 90202, 'subclass': 1686750599}) + self.check_err(n.node(data, {'material': 'hout,metaal', 'tourism': 'artwork'}), expected={'class': 90202, 'subclass': 1686750599}) self.check_not_err(n.node(data, {'amenity': 'charging_station', 'motor_vehicle': 'designated'}), expected={'class': 90209, 'subclass': 1720314934}) self.check_not_err(n.node(data, {'amenity': 'parking_entrance', 'motor_vehicle': 'designated'}), expected={'class': 90209, 'subclass': 1720314934}) self.check_not_err(n.node(data, {'circumference': '8.6', 'natural': 'tree'}), expected={'class': 90209, 'subclass': 68044720}) @@ -3761,9 +3774,10 @@ class father: self.check_not_err(n.way(data, {'cycleway': 'no', 'highway': 'footway'}, [0]), expected={'class': 90206, 'subclass': 1018129333}) self.check_not_err(n.way(data, {'highway': 'footway', 'segregated': 'yes', 'traffic_sign': 'NL:G07-ZB'}, [0]), expected={'class': 90206, 'subclass': 1018129333}) self.check_not_err(n.way(data, {'highway': 'footway', 'segregated': 'yes', 'traffic_sign': 'NL:G7'}, [0]), expected={'class': 90206, 'subclass': 1018129333}) - self.check_err(n.way(data, {'highway': 'service', 'surface': 'niet bestraat'}, [0]), expected={'class': 90202, 'subclass': 1678452337}) - self.check_not_err(n.way(data, {'highway': 'service', 'surface': 'paving_stones'}, [0]), expected={'class': 90202, 'subclass': 1678452337}) - self.check_err(n.way(data, {'highway': 'service', 'surface': 'straatstenen'}, [0]), expected={'class': 90202, 'subclass': 1678452337}) + self.check_err(n.way(data, {'highway': 'service', 'surface': 'niet bestraat'}, [0]), expected={'class': 90202, 'subclass': 1205828493}) + self.check_not_err(n.way(data, {'highway': 'service', 'surface': 'paving_stones'}, [0]), expected={'class': 90202, 'subclass': 1205828493}) + self.check_err(n.way(data, {'highway': 'service', 'surface': 'straatstenen'}, [0]), expected={'class': 90202, 'subclass': 1205828493}) + self.check_not_err(n.way(data, {'material': 'bronze', 'tourism': 'artwork'}, [0]), expected={'class': 90202, 'subclass': 1205828493}) self.check_not_err(n.way(data, {'highway': 'footway', 'surface': 'paving_stones'}, [0]), expected={'class': 90202, 'subclass': 1868473171}) self.check_not_err(n.way(data, {'cycleway:surface': 'paving_stones:20', 'highway': 'residential', 'sidewalk:surface': 'paving_stones'}, [0]), expected={'class': 90202, 'subclass': 1911834456}) self.check_not_err(n.way(data, {'cycleway:surface': 'paving_stones:20', 'highway': 'residential', 'sidewalk:surface': 'paving_stones:30'}, [0]), expected={'class': 90202, 'subclass': 1911834456}) @@ -3813,11 +3827,6 @@ class father: self.check_not_err(n.way(data, {'highway': 'cycleway', 'maxspeed': '40'}, [0]), expected={'class': 90207, 'subclass': 293871183}) self.check_not_err(n.way(data, {'highway': 'residential', 'maxspeed': '30'}, [0]), expected={'class': 90207, 'subclass': 293871183}) self.check_not_err(n.way(data, {'access': 'permissive', 'highway': 'unclassified', 'maxspeed': '25', 'note': 'eigen_weg'}, [0]), expected={'class': 90207, 'subclass': 293871183}) - self.check_not_err(n.way(data, {'highway': 'residential', 'oneway': 'no', 'oneway:bicycle': 'no'}, [0]), expected={'class': 90208, 'subclass': 45390626}) - self.check_not_err(n.way(data, {'highway': 'residential', 'mofa:backward': 'no', 'oneway': 'yes', 'oneway:bicycle': 'no'}, [0]), expected={'class': 90208, 'subclass': 45390626}) - self.check_not_err(n.way(data, {'highway': 'residential', 'mofa': 'no', 'oneway': 'yes', 'oneway:bicycle': 'no'}, [0]), expected={'class': 90208, 'subclass': 45390626}) - self.check_not_err(n.way(data, {'highway': 'residential', 'oneway': 'yes', 'oneway:bicycle': 'no', 'oneway:mofa': 'yes'}, [0]), expected={'class': 90208, 'subclass': 45390626}) - self.check_not_err(n.way(data, {'highway': 'residential', 'oneway': 'yes', 'oneway:bicycle': 'yes'}, [0]), expected={'class': 90208, 'subclass': 45390626}) self.check_not_err(n.way(data, {'access': 'designated', 'bicycle': 'designated', 'highway': 'residential', 'moped': 'designated'}, [0]), expected={'class': 90208, 'subclass': 2061019359}) self.check_not_err(n.way(data, {'bicycle': 'designated', 'highway': 'residential', 'moped': 'designated'}, [0]), expected={'class': 90208, 'subclass': 2061019359}) self.check_not_err(n.way(data, {'access': 'no', 'bicycle': 'designated', 'highway': 'residential', 'mofa': 'designated', 'moped': 'designated'}, [0]), expected={'class': 90208, 'subclass': 2061019359}) diff --git a/plugins/Josm_FranceSpecificRules.py b/plugins/Josm_FranceSpecificRules.py index 819acf9c4..62f69bc81 100644 --- a/plugins/Josm_FranceSpecificRules.py +++ b/plugins/Josm_FranceSpecificRules.py @@ -39,19 +39,17 @@ def init(self, logger): self.re_107d2c86 = re.compile(r'PT[1-9]{1}[0-9]*') self.re_1473b7c6 = re.compile(r'^(motorway|trunk|primary|secondary|tertiary|unclassified)$') self.re_173ac8d4 = re.compile(r'[0-9]{5}[A-Z0-9]{3}') + self.re_2341f750 = re.compile(r'^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$') self.re_23d0d993 = re.compile(r'[A-Z0-9]{3}') self.re_299ea34e = re.compile(r'^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$') self.re_30299d59 = re.compile(r'^(Enedis|GRDF)$') self.re_3b28b3c0 = re.compile(r'^(motorway|trunk|primary|secondary|tertiary|unclassified|service)$') self.re_3b90619c = re.compile(r'^\D') - self.re_419bc5d2 = re.compile(r'^(([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$') self.re_4507c4e3 = re.compile(r'^(((((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|))(|;(((((0[1-9]|1[0-9]|2A|2B|2[1-9]|[3-8][0-9]|9[0-5])([0-9]{3}))|((971(0[1-9]|[1-3][0-9]))|(972(0[1-9]|[1-3][0-9]))|(973(0[1-9]|[1-6][0-9]))|(974(0[1-9]|[1-2][0-9]))|(976(0[1-9]|1[0-7]))))([0-9]|[A-Z])([0-9]{3}))([ABCDEFGHJKLMNPRSTUVWXYZ]|)))+)|no)$') self.re_4bae79a8 = re.compile(r'[0-9AB]{5}[A-Z]{1,3}[0-9]{4}|[0-9AB]{5}EEM[0-9]{2}') - self.re_4e9373ac = re.compile(r'^(([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$') - self.re_66c32242 = re.compile(r'^([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$') + self.re_5a641603 = re.compile(r'^^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9])(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$') + self.re_60717768 = re.compile(r'^((0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)PR([0-9]|[1-9][0-9]|[1-9][0-9][0-9])[DGU](|C))$') self.re_6ac6c83c = re.compile(r'^(pole|tower)$') - self.re_6beaf147 = re.compile(r'^([1-9][0-9]|0[1-9])[AN]8[0-9]{3}(|A|N)([0-9]?[0-9])(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$') - self.re_7510958f = re.compile(r'^(([1-9][0-9]|0[1-9])PR([0-9]|[1-9][0-9]|[1-9][0-9][0-9])[DGU](|C))$') self.re_7f2e60da = re.compile(r'^(75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])D)$') @@ -265,19 +263,22 @@ def node(self, data, tags): # throwWarning:tr("{0} is invalid. Should look like 12345ABC","{0.tag}") err.append({'class': 30410, 'subclass': 0, 'text': mapcss.tr('{0} is invalid. Should look like 12345ABC', mapcss._tag_uncapture(capture_tags, '{0.tag}'))}) - # node[highway=milestone][operator][nat_ref][nat_ref!~/^(([1-9][0-9]|0[1-9])PR([0-9]|[1-9][0-9]|[1-9][0-9][0-9])[DGU](|C))$/][inside("FR")] + # node[highway=milestone][operator][nat_ref][nat_ref!~/^((0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)PR([0-9]|[1-9][0-9]|[1-9][0-9][0-9])[DGU](|C))$/][inside("FR")] if ('highway' in keys and 'nat_ref' in keys and 'operator' in keys): match = False if not match: capture_tags = {} - try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'highway') == mapcss._value_capture(capture_tags, 0, 'milestone')) and (mapcss._tag_capture(capture_tags, 1, tags, 'operator')) and (mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 3, self.re_7510958f, '^(([1-9][0-9]|0[1-9])PR([0-9]|[1-9][0-9]|[1-9][0-9][0-9])[DGU](|C))$'), mapcss._tag_capture(capture_tags, 3, tags, 'nat_ref'))) and (mapcss.inside(self.father.config.options, 'FR'))) + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'highway') == mapcss._value_capture(capture_tags, 0, 'milestone')) and (mapcss._tag_capture(capture_tags, 1, tags, 'operator')) and (mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 3, self.re_60717768, '^((0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)PR([0-9]|[1-9][0-9]|[1-9][0-9][0-9])[DGU](|C))$'), mapcss._tag_capture(capture_tags, 3, tags, 'nat_ref'))) and (mapcss.inside(self.father.config.options, 'FR'))) except mapcss.RuleAbort: pass if match: # group:tr("validation rules highway milestone") # -osmoseTags:list("ref","highway") # -osmoseItemClassLevel:"3040/30403/3" # throwWarning:tr("{0} is not a milestone valid reference RIU","{2.tag}") + # -osmoseAssertMatchWithContext:list("node highway=milestone distance=38 nat_ref=20PR38DC operator=SANEF","inside=FR") # -osmoseAssertNoMatchWithContext:list("node highway=milestone distance=38 nat_ref=77PR38DC operator=SANEF","inside=FR") + # -osmoseAssertNoMatchWithContext:list("node highway=milestone distance=38 nat_ref=973PR38DC operator=SANEF","inside=FR") + # -osmoseAssertMatchWithContext:list("node highway=milestone distance=38 nat_ref=974PR38DC operator=SANEF","inside=FR") err.append({'class': 30403, 'subclass': 0, 'text': mapcss.tr('{0} is not a milestone valid reference RIU', mapcss._tag_uncapture(capture_tags, '{2.tag}'))}) # node[highway=milestone][operator][nat_ref][!distance][inside("FR")] @@ -576,7 +577,7 @@ def way(self, data, tags, nds): err.append({'class': 30410, 'subclass': 0, 'text': mapcss.tr('{0} is invalid. Should look like 12345ABC', mapcss._tag_uncapture(capture_tags, '{0.tag}'))}) # way[highway=~/^(motorway|trunk|primary|secondary|tertiary|unclassified)$/][nat_ref][operator][!junction][inside("FR")] - # way[highway=service][nat_ref][nat_ref!~/^([1-9][0-9]|0[1-9])[AN]8[0-9]{3}(|A|N)([0-9]?[0-9])(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][operator][!junction][inside("FR")] + # way[highway=service][nat_ref][nat_ref!~/^^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9])(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][operator][!junction][inside("FR")] if ('highway' in keys and 'nat_ref' in keys and 'operator' in keys): match = False if not match: @@ -585,7 +586,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, 'highway') == mapcss._value_capture(capture_tags, 0, 'service')) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_6beaf147, '^([1-9][0-9]|0[1-9])[AN]8[0-9]{3}(|A|N)([0-9]?[0-9])(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref'))) and (mapcss._tag_capture(capture_tags, 3, tags, 'operator')) and (not mapcss._tag_capture(capture_tags, 4, tags, 'junction')) and (mapcss.inside(self.father.config.options, 'FR'))) + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'highway') == mapcss._value_capture(capture_tags, 0, 'service')) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_5a641603, '^^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9])(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref'))) and (mapcss._tag_capture(capture_tags, 3, tags, 'operator')) and (not mapcss._tag_capture(capture_tags, 4, tags, 'junction')) and (mapcss.inside(self.father.config.options, 'FR'))) except mapcss.RuleAbort: pass if match: # group:tr("validation rules nat_ref in France") @@ -618,12 +619,12 @@ def way(self, data, tags, nds): # -osmoseAssertNoMatchWithContext:list("way highway=motorway_link nat_ref:forward=62A902615CD_11D nat_ref:backward=62A902615CD_2D operator='SANEF'","inside=FR") err.append({'class': 9019002, 'subclass': 0, 'text': mapcss.tr('{0} must be a link road ', mapcss._tag_uncapture(capture_tags, '{1.tag}'))}) - # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/][nat_ref][nat_ref!~/^([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][operator!="VILLE DE PARIS"][inside("FR")] + # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/][nat_ref][nat_ref!~/^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][operator!="Ville de Paris"][inside("FR")] if ('highway' in keys and 'nat_ref' in keys): match = False if not match: capture_tags = {} - try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_66c32242, '^([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref'))) and (mapcss._tag_capture(capture_tags, 3, tags, 'operator') != mapcss._value_const_capture(capture_tags, 3, 'VILLE DE PARIS', 'VILLE DE PARIS')) and (mapcss.inside(self.father.config.options, 'FR'))) + try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_2341f750, '^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref'))) and (mapcss._tag_capture(capture_tags, 3, tags, 'operator') != mapcss._value_const_capture(capture_tags, 3, 'Ville de Paris', 'Ville de Paris')) and (mapcss.inside(self.father.config.options, 'FR'))) except mapcss.RuleAbort: pass if match: # group:tr("validation rules nat_ref in France") @@ -636,12 +637,12 @@ def way(self, data, tags, nds): # -osmoseAssertNoMatchWithContext:list("way highway=motorway_link nat_ref=80A901645CD_16D operator=SANEF","inside=FR") err.append({'class': 9019002, 'subclass': 0, 'text': mapcss.tr('{0} is not a valid reference', mapcss._tag_uncapture(capture_tags, '{1.tag}'))}) - # way[junction=roundabout][highway=~/^(motorway|trunk|primary|secondary|tertiary|unclassified|service)$/][nat_ref][nat_ref!~/^(([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$/][inside("FR")] + # way[junction=roundabout][highway=~/^(motorway|trunk|primary|secondary|tertiary|unclassified|service)$/][nat_ref][nat_ref!~/^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][inside("FR")] if ('highway' in keys and 'junction' in keys and 'nat_ref' in keys): match = False if not match: capture_tags = {} - try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'junction') == mapcss._value_capture(capture_tags, 0, 'roundabout')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b28b3c0), mapcss._tag_capture(capture_tags, 1, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 3, self.re_419bc5d2, '^(([1-9][0-9]|0[1-9])[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$'), mapcss._tag_capture(capture_tags, 3, tags, 'nat_ref'))) and (mapcss.inside(self.father.config.options, 'FR'))) + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'junction') == mapcss._value_capture(capture_tags, 0, 'roundabout')) and (mapcss.regexp_test(mapcss._value_capture(capture_tags, 1, self.re_3b28b3c0), mapcss._tag_capture(capture_tags, 1, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 3, self.re_2341f750, '^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$'), mapcss._tag_capture(capture_tags, 3, tags, 'nat_ref'))) and (mapcss.inside(self.father.config.options, 'FR'))) except mapcss.RuleAbort: pass if match: # group:tr("validation rules nat_ref in France") @@ -654,33 +655,33 @@ def way(self, data, tags, nds): # -osmoseAssertNoMatchWithContext:list("way highway=service junction=roundabout nat_ref=80A801645_6D operator=DIRN","inside=FR") err.append({'class': 9019002, 'subclass': 0, 'text': mapcss.tr('{0} is not a valid reference', mapcss._tag_uncapture(capture_tags, '{2.tag}'))}) - # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/][nat_ref][nat_ref!~/^(75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])D)$/][operator="VILLE DE PARIS"][inside("FR")] + # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/][nat_ref][nat_ref!~/^(75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])D)$/][operator="Ville de Paris"][inside("FR")] if ('highway' in keys and 'nat_ref' in keys and 'operator' in keys): match = False if not match: capture_tags = {} - try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_7f2e60da, '^(75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])D)$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref'))) and (mapcss._tag_capture(capture_tags, 3, tags, 'operator') == mapcss._value_capture(capture_tags, 3, 'VILLE DE PARIS')) and (mapcss.inside(self.father.config.options, 'FR'))) + try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_7f2e60da, '^(75Periph_Paris_[0-9]{2}_(1[0-9]|[1-9])D)$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref'))) and (mapcss._tag_capture(capture_tags, 3, tags, 'operator') == mapcss._value_capture(capture_tags, 3, 'Ville de Paris')) and (mapcss.inside(self.father.config.options, 'FR'))) except mapcss.RuleAbort: pass if match: # group:tr("validation rules nat_ref in France") # -osmoseTags:list("ref","highway") # -osmoseItemClassLevel:"9019/9019002/3" # throwWarning:tr("{0} is not a valid reference (Paris)","{1.tag}") - # -osmoseAssertNoMatchWithContext:list("way highway=primary_link nat_ref=75Periph_Paris_05_13D operator=\"VILLE DE PARIS\"","inside=FR") - # -osmoseAssertNoMatchWithContext:list("way highway=trunk_link nat_ref=75Periph_Paris_05_3D operator=\"VILLE DE PARIS\"","inside=FR") + # -osmoseAssertNoMatchWithContext:list("way highway=primary_link nat_ref=75Periph_Paris_05_13D operator=\"Ville de Paris\"","inside=FR") + # -osmoseAssertNoMatchWithContext:list("way highway=trunk_link nat_ref=75Periph_Paris_05_3D operator=\"Ville de Paris\"","inside=FR") err.append({'class': 9019002, 'subclass': 0, 'text': mapcss.tr('{0} is not a valid reference (Paris)', mapcss._tag_uncapture(capture_tags, '{1.tag}'))}) - # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:forward"]["nat_ref:forward"!~/^(([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$/][inside("FR")] - # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:backward"]["nat_ref:backward"!~/^(([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$/][inside("FR")] + # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:forward"]["nat_ref:forward"!~/^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][inside("FR")] + # way[highway=~/^(motorway_link|trunk_link|primary_link|secondary_link|tertiary_link)$/]["nat_ref:backward"]["nat_ref:backward"!~/^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$/][inside("FR")] if ('highway' in keys and 'nat_ref:backward' in keys) or ('highway' in keys and 'nat_ref:forward' in keys): match = False if not match: capture_tags = {} - try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref:forward')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_4e9373ac, '^(([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref:forward'))) and (mapcss.inside(self.father.config.options, 'FR'))) + try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref:forward')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_2341f750, '^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref:forward'))) and (mapcss.inside(self.father.config.options, 'FR'))) except mapcss.RuleAbort: pass if not match: capture_tags = {} - try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref:backward')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_4e9373ac, '^(([1-9][0-9]|0[1-9])[ANP]9[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D)$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref:backward'))) and (mapcss.inside(self.father.config.options, 'FR'))) + try: match = ((mapcss.regexp_test(mapcss._value_capture(capture_tags, 0, self.re_299ea34e), mapcss._tag_capture(capture_tags, 0, tags, 'highway'))) and (mapcss._tag_capture(capture_tags, 1, tags, 'nat_ref:backward')) and (not mapcss.regexp_test(mapcss._value_const_capture(capture_tags, 2, self.re_2341f750, '^(0[1-9]|1[0-9]|2[1-9]|[3-8][0-9]|9[0-5]|973|975|976)[ANP](8|9)[0-9]{3}(|A|N)([0-9]?[0-9]|B1|B2)(|[A-Z]|[a-z])(|CD)_(1[0-9]|[1-9])D$'), mapcss._tag_capture(capture_tags, 2, tags, 'nat_ref:backward'))) and (mapcss.inside(self.father.config.options, 'FR'))) except mapcss.RuleAbort: pass if match: # group:tr("validation rules nat_ref in France") @@ -1034,8 +1035,14 @@ class father: with with_options(n, {'country': 'FR'}): self.check_err(n.node(data, {'amenity': 'parking', 'name': 'Aire de Covoiturage'}), expected={'class': 20806, 'subclass': 0}) + with with_options(n, {'country': 'FR'}): + self.check_err(n.node(data, {'distance': '38', 'highway': 'milestone', 'nat_ref': '20PR38DC', 'operator': 'SANEF'}), expected={'class': 30403, 'subclass': 0}) with with_options(n, {'country': 'FR'}): self.check_not_err(n.node(data, {'distance': '38', 'highway': 'milestone', 'nat_ref': '77PR38DC', 'operator': 'SANEF'}), expected={'class': 30403, 'subclass': 0}) + with with_options(n, {'country': 'FR'}): + self.check_not_err(n.node(data, {'distance': '38', 'highway': 'milestone', 'nat_ref': '973PR38DC', 'operator': 'SANEF'}), expected={'class': 30403, 'subclass': 0}) + with with_options(n, {'country': 'FR'}): + self.check_err(n.node(data, {'distance': '38', 'highway': 'milestone', 'nat_ref': '974PR38DC', 'operator': 'SANEF'}), expected={'class': 30403, 'subclass': 0}) with with_options(n, {'country': 'FR'}): self.check_not_err(n.node(data, {'distance': '38', 'highway': 'milestone', 'nat_ref': '77PR38DC', 'operator': 'SANEF'}), expected={'class': 9019001, 'subclass': 0}) with with_options(n, {'country': 'FR'}): @@ -1083,9 +1090,9 @@ class father: with with_options(n, {'country': 'FR'}): self.check_not_err(n.way(data, {'highway': 'service', 'junction': 'roundabout', 'nat_ref': '80A801645_6D', 'operator': 'DIRN'}, [0]), expected={'class': 9019002, 'subclass': 0}) with with_options(n, {'country': 'FR'}): - self.check_not_err(n.way(data, {'highway': 'primary_link', 'nat_ref': '75Periph_Paris_05_13D', 'operator': 'VILLE DE PARIS'}, [0]), expected={'class': 9019002, 'subclass': 0}) + self.check_not_err(n.way(data, {'highway': 'primary_link', 'nat_ref': '75Periph_Paris_05_13D', 'operator': 'Ville de Paris'}, [0]), expected={'class': 9019002, 'subclass': 0}) with with_options(n, {'country': 'FR'}): - self.check_not_err(n.way(data, {'highway': 'trunk_link', 'nat_ref': '75Periph_Paris_05_3D', 'operator': 'VILLE DE PARIS'}, [0]), expected={'class': 9019002, 'subclass': 0}) + self.check_not_err(n.way(data, {'highway': 'trunk_link', 'nat_ref': '75Periph_Paris_05_3D', 'operator': 'Ville de Paris'}, [0]), expected={'class': 9019002, 'subclass': 0}) with with_options(n, {'country': 'FR'}): self.check_not_err(n.way(data, {'highway': 'motorway_link', 'nat_ref:backward': '62A902615CD_2D', 'nat_ref:forward': '62A902615CD_11D', 'operator': 'SANEF'}, [0]), expected={'class': 9019002, 'subclass': 0}) with with_options(n, {'country': 'FR'}): diff --git a/plugins/Josm_deprecated.py b/plugins/Josm_deprecated.py index b088ba44a..df3f237e9 100644 --- a/plugins/Josm_deprecated.py +++ b/plugins/Josm_deprecated.py @@ -4422,6 +4422,58 @@ def node(self, data, tags): # suggestAlternative:"{1.key}" err.append({'class': 9002001, 'subclass': 1736205096, 'text': mapcss.tr('{0} is deprecated', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # *[natural=landform][landform=esker] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'esker'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","geological=esker") + # suggestAlternative:"natural=ridge or geological=esker" + err.append({'class': 9002001, 'subclass': 1008024827, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'geological=esker')}) + + # *[natural=landform][landform=moraine] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'moraine'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","geological=moraine") + # suggestAlternative:"geological=moraine" + err.append({'class': 9002001, 'subclass': 1223091758, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'geological=moraine')}) + + # *[natural=landform][landform=beach] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'beach'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","natural=beach") + # suggestAlternative:"natural=beach" + err.append({'class': 9002001, 'subclass': 2005356131, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'natural=beach')}) + + # *[natural=landform][landform=tundra_polygon] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'tundra_polygon'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","natural=tundra") + # suggestAlternative:"natural=tundra or natural=fell" + err.append({'class': 9002001, 'subclass': 149743951, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'natural=tundra')}) + return err def way(self, data, tags, nds): @@ -8902,6 +8954,58 @@ def way(self, data, tags, nds): # suggestAlternative:"{1.key}" err.append({'class': 9002001, 'subclass': 1736205096, 'text': mapcss.tr('{0} is deprecated', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # *[natural=landform][landform=esker] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'esker'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","geological=esker") + # suggestAlternative:"natural=ridge or geological=esker" + err.append({'class': 9002001, 'subclass': 1008024827, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'geological=esker')}) + + # *[natural=landform][landform=moraine] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'moraine'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","geological=moraine") + # suggestAlternative:"geological=moraine" + err.append({'class': 9002001, 'subclass': 1223091758, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'geological=moraine')}) + + # *[natural=landform][landform=beach] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'beach'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","natural=beach") + # suggestAlternative:"natural=beach" + err.append({'class': 9002001, 'subclass': 2005356131, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'natural=beach')}) + + # *[natural=landform][landform=tundra_polygon] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'tundra_polygon'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","natural=tundra") + # suggestAlternative:"natural=tundra or natural=fell" + err.append({'class': 9002001, 'subclass': 149743951, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'natural=tundra')}) + return err def relation(self, data, tags, members): @@ -12770,6 +12874,58 @@ def relation(self, data, tags, members): # suggestAlternative:"{1.key}" err.append({'class': 9002001, 'subclass': 1736205096, 'text': mapcss.tr('{0} is deprecated', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # *[natural=landform][landform=esker] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'esker'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","geological=esker") + # suggestAlternative:"natural=ridge or geological=esker" + err.append({'class': 9002001, 'subclass': 1008024827, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'geological=esker')}) + + # *[natural=landform][landform=moraine] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'moraine'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","geological=moraine") + # suggestAlternative:"geological=moraine" + err.append({'class': 9002001, 'subclass': 1223091758, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'geological=moraine')}) + + # *[natural=landform][landform=beach] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'beach'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","natural=beach") + # suggestAlternative:"natural=beach" + err.append({'class': 9002001, 'subclass': 2005356131, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'natural=beach')}) + + # *[natural=landform][landform=tundra_polygon] + if ('landform' in keys and 'natural' in keys): + match = False + if not match: + capture_tags = {} + try: match = ((mapcss._tag_capture(capture_tags, 0, tags, 'natural') == mapcss._value_capture(capture_tags, 0, 'landform')) and (mapcss._tag_capture(capture_tags, 1, tags, 'landform') == mapcss._value_capture(capture_tags, 1, 'tundra_polygon'))) + except mapcss.RuleAbort: pass + if match: + # group:tr("deprecated tagging") + # throwWarning:tr("{0} should be replaced by {1}","{1.tag}","natural=tundra") + # suggestAlternative:"natural=tundra or natural=fell" + err.append({'class': 9002001, 'subclass': 149743951, 'text': mapcss.tr('{0} should be replaced by {1}', mapcss._tag_uncapture(capture_tags, '{1.tag}'), 'natural=tundra')}) + return err