Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with empty value + warning #2426

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions plugins/TagFix_BadValue.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ def check(self, data, tags, check_list_open):
for k in keyss:
if tags[k] in ("unknown", "*"):
err.append({"class": 40613, "subclass": stablehash64(k), "text": T_("Concerns tag: `{0}`", '='.join([k, tags[k]])) })
elif len(tags[k].strip()) == 0 and k not in check_list_open and k not in self.check_list_closed:
err.append({
"class": 3040,
"subclass": stablehash64(k),
"text": T_("Concerns tag: `{0}`", '='.join([k, tags[k]])),
"fix": {"-": [k]}
})

return err

Expand Down Expand Up @@ -158,6 +165,9 @@ def test(self):
{"sport": "rugby_union;shot-put;long-jump"}, # good;whitelisted;bad
{"access": "unknown"},
{"tracktype": "gradde1"},
{"leaf_cycle": ""},
{"wetland": ""},
{"random_key": ""},
]:
self.check_err(a.node(None, t), t)
self.check_err(a.way(None, t, None), t)
Expand Down
2 changes: 1 addition & 1 deletion plugins/TagFix_Maxspeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def init(self, logger):

def way(self, data, tags, nds):
err = []
maxspeed_tags = list(filter(lambda t: t.startswith('maxspeed') and tags[t][0] in "0123456789", tags))
maxspeed_tags = list(filter(lambda t: t.startswith('maxspeed') and tags[t] and tags[t][0] in "0123456789", tags))

# Check that maxspeed:advisory/practical <= maxspeed
for t in maxspeed_tags:
Expand Down
Loading