Opened 4 months ago
Closed 4 months ago
#23407 closed enhancement (worksforme)
Error in MapCSS Rule?
Reported by: | GerdP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core validator | Version: | |
Keywords: | route bicycle mtb | Cc: |
Description
While working on #23397 I stumbled over this.
I wonder if the throwerror clause in this test in relation.mapcss
could be improved:
/* #15208, #16242 */ relation[type=route][route=mtb ] > way[bicycle=no], relation[type=route][route=bicycle] > way[bicycle=no], relation[type=route][route=mtb ] > way[bicycle=private], relation[type=route][route=bicycle] > way[bicycle=private], relation[type=route][route=mtb ] > way[bicycle=use_sidepath], relation[type=route][route=bicycle] > way[bicycle=use_sidepath], relation[type=route][route=fitness_trail] > way[foot=no], relation[type=route][route=hiking ] > way[foot=no], relation[type=route][route=running ] > way[foot=no], relation[type=route][route=walking ] > way[foot=no], relation[type=route][route=fitness_trail] > way[foot=private], relation[type=route][route=hiking ] > way[foot=private], relation[type=route][route=running ] > way[foot=private], relation[type=route][route=walking ] > way[foot=private], relation[type=route][route=fitness_trail] > way[foot=use_sidepath], relation[type=route][route=hiking ] > way[foot=use_sidepath], relation[type=route][route=running ] > way[foot=use_sidepath], relation[type=route][route=walking ] > way[foot=use_sidepath], relation[type=route][route=horse] > way[horse=no], relation[type=route][route=horse] > way[horse=private], relation[type=route][route=horse] > way[horse=use_sidepath] { throwWarning: tr("way with {0} is part of a {1} route relation", "{0.tag}", "{0.key}");
If I have a way with bicycle=no
in a route=mtb
relation it will report
way with bicycle=no is part of a bicycle route relation
I would expect to get a message like
way with bicycle=no is part of a mtb route relation
Another question that I wondered about:
Should this message be produced when a way with bicycle=no + mtb=yes is member of a route=mtb relation?
Attachments (0)
Change History (4)
comment:1 by , 4 months ago
Keywords: | route bicycle mtb added |
---|
follow-up: 3 comment:2 by , 4 months ago
Would not work well with mtb=designated. Please concentrate on the first part, this mtb special case is not important.
Is it possible to refer to the route=* tag value in the relation when producing the error?
comment:3 by , 4 months ago
Replying to GerdP:
Would not work well with mtb=designated.
Ok, [mtb!~/yes|designated/]
?
Please concentrate on the first part, this mtb special case is not important.
Is it possible to refer to the route=* tag value in the relation when producing the error?
No, you can only use the keys/tags on the right of the last child/parent selector.
comment:4 by , 4 months ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
OK, then the existing rule is a good compromise.
So we need to change
bicycle
tomtb
forroute=mtb
and add a new block. Untested: