Modify

Opened 6 years ago

Last modified 6 years ago

#17129 new defect

Cannot add assertMatch/assertNoMatch declarations with :selected pseudoclass

Reported by: taylor.smock Owned by: team
Priority: minor Milestone:
Component: Core validator Version: latest
Keywords: mapcss Cc:

Description (last modified by Klumbumbus)

It is not currently possible to do the following:

way[highway][turn:lanes][oneway][count(split("|", tag("turn:lanes"))) != tag("lanes")]:selected, 
way[highway][turn:lanes][!oneway][2 * count(split("|", tag("turn:lanes"))) != tag("lanes")]:selected, 
way[highway][turn:lanes][!lanes]:selected { 
        throwWarning: tr("turn:lanes do not match lanes");
        fixAdd: concat("lanes=", count(split("|", tag("turn.lanes")));
        assertMatch: "way highway=primary lanes=4 turn:lanes=left|through|through;right";
        assertNoMatch: "way highway=primary lanes=4 turn:lanes=left;through|through;right";
}

Since I've got another test without the :selected psuedoclass, I can move the assertMatch/assertNoMatch to that test, e.g.

way[highway][turn:lanes][oneway][count(split("|", tag("turn:lanes"))) != tag("lanes")], 
way[highway][turn:lanes][!oneway][2 * count(split("|", tag("turn:lanes"))) != tag("lanes")], 
way[highway][turn:lanes][!lanes] { 
        throwWarning: tr("turn:lanes do not match lanes");
        assertMatch: "way highway=primary lanes=4 turn:lanes=left|through|through;right";
        assertNoMatch: "way highway=primary lanes=4 turn:lanes=left;through|through;right";
}

instead of

way[highway][turn:lanes][oneway][count(split("|", tag("turn:lanes"))) != tag("lanes")], 
way[highway][turn:lanes][!oneway][2 * count(split("|", tag("turn:lanes"))) != tag("lanes")], 
way[highway][turn:lanes][!lanes] { 
        throwWarning: tr("turn:lanes do not match lanes");
}

and this should be possible for the vast majority of cases.

#17058 is similar, in that fake primitives are probably not selected when they should be (in that bug, the fake primitives where not being created in the country the tests where inside).

Use cases:
1) There is a common issue where the fix is almost always the same, but should be verified using aerial imagery/street level imagery, and selection is one way to ensure that.

Possible alternative: way|z21-[JOSM_search("inview")] {...} -- this is probably a much better alternative than the initial :selected for this use case.

Attachments (0)

Change History (1)

comment:1 by Klumbumbus, 6 years ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to taylor.smock.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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