Modify

Opened 4 months ago

Last modified 4 months 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 Changed 4 months ago by Klumbumbus

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.
to The owner will be changed from team to the specified user.
The owner will change to taylor.smock
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.