Skip to content

Commit

Permalink
mapcss: regen from mapcss
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Jul 8, 2019
1 parent 16e95c9 commit 0b31cc7
Show file tree
Hide file tree
Showing 16 changed files with 2,126 additions and 202 deletions.
20 changes: 15 additions & 5 deletions mapcss/item_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_',
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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']},
Expand All @@ -309,27 +312,34 @@
'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,
'Missing ref tag for line number on a public_transport relation': 9014017,
'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_',
Expand Down
42 changes: 36 additions & 6 deletions plugins/Colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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')))
Expand All @@ -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 = {}
Expand All @@ -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')))
Expand All @@ -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 = {}
Expand All @@ -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')))
Expand All @@ -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 = {}
Expand All @@ -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')))
Expand Down Expand Up @@ -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 = {}
Expand All @@ -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')))
Expand All @@ -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 = {}
Expand All @@ -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')))
Expand Down
Loading

0 comments on commit 0b31cc7

Please sign in to comment.