Modify

Opened 9 months ago

Last modified 9 months ago

#19511 new enhancement

Support of complete tag in fixChange and FixRemove

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: template_report tag fixChange fixRemove Cc:

Description

What steps will reproduce the problem?

  1. Have
    way[highway][placement=transition]["placement:forward"=transition],
    way[highway][placement=transition]["placement:backward"=transition] {
      throwWarning: tr("Use {0} only as value of {1}", "{1.value}", "{2.key}=*");
      group: tr("suspicious tag combination");
      fixAdd: "placement=transition";
      fixChange: "placement:forward=transition=>placement=transition";
      fixRemove: "placement:backward=transition";
    }
    
  2. Load rule

What is the expected result?

No warning and rule is loaded

What happens instead?

  • SEVERE: Cannot add MapCSS rule: Cannot add instruction fixChange: placement:forward=transition=>placement=transition!
  • SEVERE: Cannot add MapCSS rule: java.lang.IllegalArgumentException: Unexpected '='. Please only specify the key to remove in: fixRemove: String<placement:backward=transition>;

and rule is not loaded

Please provide any additional information below. Attach a screenshot if possible.

I want to only change or remove placement;backward/forward with value transition
It would be nice if I do not have to write the needed syntax to change or remove only specific key-value combinations for each rule. Thanks a lot.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-07-09 17:42:41 +0200 (Thu, 09 Jul 2020)
Revision:16740
Build-Date:2020-07-10 01:30:51
URL:https://josm.openstreetmap.de/svn/trunk

Last errors/warnings:
- E: Cannot add MapCSS rule: java.lang.IllegalArgumentException: Unexpected '='. Please only specify the key to remove in: fixRemove: String<placement:forward=transition>;
- E: Cannot add MapCSS rule: Cannot add instruction fixChange: placement:forward=transition=>placement=transition!

Attachments (0)

Change History (3)

comment:1 Changed 9 months ago by Klumbumbus

I don't understand the point. Why not use

  fixRemove: "placement:forward";
  fixRemove: "placement:backward";

?

And if needed

  fixAdd: "placement=transition";

but in your example it is not needed as it is already in the selector.

comment:2 in reply to:  1 Changed 9 months ago by skyper

Replying to Klumbumbus:

I don't understand the point. Why not use

  fixRemove: "placement:forward";
  fixRemove: "placement:backward";


Because it removes e.g. placement:backward=left_of:4 as well.

And if needed

  fixAdd: "placement=transition";

but in your example it is not needed as it is already in the selector.

I condensed the example. The complete block is:

way[highway][placement=transition]["placement:forward"=transition],
way[highway][placement=transition]["placement:backward"=transition],
way[highway][placement=transition]["placement:both_ways"=transition],
way[highway]["placement:forward"=transition]["placement:backward"=transition],
way[highway]["placement:forward"=transition]["placement:both_ways"=transition],
way[highway]["placement:backward"=transition]["placement:both_ways"=transition] {
  throwWarning: tr("Use {0} only as value of {1}", "{1.value}", "{2.key}=*");
  group: tr("suspicious tag combination");
  fixAdd: "placement=transition";
  fixRemove: "placement:forward=transition";
  fixRemove: "placement:backward=transition";
  fixRemove: "placement:both_ways=transition";
  assertMatch: "way highway=primary placement:backward=transition placement:forward=transition";
  assertNoMatch: "way highway=primary placement=middle_of:1 placement:forward=transition";
}

comment:3 Changed 9 months ago by skyper

See #19094 which could be improved if this request would be implemented.

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 skyper
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.