Modify

Opened 10 years ago

Closed 10 years ago

Last modified 4 years ago

#10913 closed defect (fixed)

Sequential execution of fix* commands in validator rules

Reported by: mkoniecz Owned by: team
Priority: normal Milestone: 15.04
Component: Core validator Version:
Keywords: template_report Cc: Klumbumbus

Description

What steps will reproduce the problem?

  1. Make validator rule with multiple fix* commands

For example:

fixChangeKey: "highway => construction";
fixAdd: "highway=construction";

executed on

highway=tertiary, construction=yes

What is the expected result?

fix* commands operate on state modified by previous fix* operations:

1.
highway=tertiary; construction=yes
<before>

2.
construction=tertiary
<after fixChangeKey: "highway => construction";>

3.
highway=construction; construction=tertiary
<after fixAdd: "highway => construction";>

What happens instead?

Output is

construction=construction

It is equivalent of executing fixAdd before fixChangeKey. Order of fix* commands is ignored (it is neither going first to last nor from last to first). Adding fixRemove "construction"; failed to improve situation (I hoped that fixChangeKey refuses to overwrite existing key).

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

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-01-01 02:35:00
Last Changed Author: Don-vip
Revision: 7919
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-01-01 02:55:34 +0100 (Thu, 01 Jan 2015)
Last Changed Rev: 7919

Identification: JOSM/1.5 (7919 en) Linux Ubuntu 14.04.1 LTS
Memory Usage: 326 MB / 889 MB (164 MB allocated, but free)
Java version: 1.7.0_72, Oracle Corporation, Java HotSpot(TM) Server VM
Dataset consistency test: No problems found

Plugins:
- OpeningHoursEditor (30892)
- buildings_tools (30892)
- continuosDownload (1413902943)
- ext_tools (30892)
- measurement (30892)

I was attempting to run custom validation rule

*[construction=yes][highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street|pedestrian|cycleway|footway|steps|path|bridleway|track|bus_guideway|raceway|road|/][highway!=construction] {
  throwWarning: tr("{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)", "{0.tag}", "{1.key}", "{1.value}");
  fixRemove: "construction";
  fixChangeKey: "highway => construction";
  fixAdd: "highway=construction";
}

on http://www.openstreetmap.org/way/185001688

Making separate rule for every highway value would be feasible but awful hack.

Attachments (0)

Change History (9)

comment:1 by Klumbumbus, 10 years ago

Cc: Klumbumbus added

comment:2 by Don-vip, 10 years ago

Component: CoreCore validator
Milestone: 15.01

comment:3 by Don-vip, 10 years ago

Milestone: 15.0115.02

comment:4 by Don-vip, 10 years ago

Milestone: 15.02

comment:5 by mkoniecz, 10 years ago

So I should rather use workaround rather than waiting for fix?

comment:6 by Don-vip, 10 years ago

I plan to fix it but I have no time right now and I can't promise any date. It won't be for this release at least.

comment:7 by simon04, 10 years ago

Resolution: fixed
Status: newclosed

In 8265/josm:

fix #10913 - MapCSS validator: retain sequence of fixing commands

comment:8 by simon04, 10 years ago

Milestone: 15.04

comment:9 by Don-vip, 4 years ago

In 17499/josm:

see #20498 - see #10913 - partial revert of r17497, breaks other use cases

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.