Modify

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 skyper, 4 months ago

Keywords: route bicycle mtb added

So we need to change bicycle to mtb for route=mtb and add a new block. Untested:

relation[type=route][route=mtb] > way[mtb!=yes][bicycle=no],
relation[type=route][route=mtb] > way[mtb!=yes][bicycle=private],
relation[type=route][route=mtb] > way[mtb!=yes][bicycle=use_sidepath] {
  throwWarning: tr("way with {0} and without {1} is part of a {2} route relation", "{1.tag}", "mtb=yes", "{0.key}");
}

comment:2 by GerdP, 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?

in reply to:  2 comment:3 by skyper, 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 GerdP, 4 months ago

Resolution: worksforme
Status: newclosed

OK, then the existing rule is a good compromise.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.