﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11146	"Change ""highway=*; construction=yes"" to ""highway=construction; construction=*"""	mkoniecz	team	"There are two methods for mapping road under construction[1]. One is [highway=construction; construction=*], second is [highway=*; construction=yes].

First method is significantly better as it is easier to process and not processing construction-related values is not resulting in wrong data (fail-safe tagging).

In addition construction=yes is used 3366 times with highway=*, highway=construction is used 79730 times[2].

[highway=construction; construction=*] also has wider support (for examples see JOSM and default map style).

[1] http://wiki.openstreetmap.org/wiki/Key:construction 
[3] http://taginfo.openstreetmap.org/tags/highway=construction http://taginfo.openstreetmap.org/tags/construction=yes#combinations

I propose to change in validator [highway=*; construction=yes] to [highway=construction; construction=*].

Below I am attaching validator rule accomplishing this from my custom validator rules. Unfortunately due to #10913 it is impossible to write single rule for this task and it is necessary to have separate for every processed highway value.

Script used to generate this set of rules is attached as comment to validator rule below.

{{{
/*
generated by following ruby script:
puts '/' + '*'
puts 'generated by following ruby script:'
file = File.open(__FILE__)
puts file.read
puts
file.close
puts '*' + '/'

=begin
this script generates set of validator rules that is equivalent to following rule but unaffected by http://josm.openstreetmap.de/ticket/10913

*[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"";
}
=end

highway_values = %w(motorway trunk primary secondary tertiary unclassified residential service living_street pedestrian cycleway footway steps path bridleway track bus_guideway raceway road)

highway_values.each {|value|
  puts ""*[construction=yes][highway=#{value}] {""
  puts '    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");'
  puts 'fixRemove: ""construction"";'
  puts 'fixRemove: ""highway"";'
  puts 'fixAdd: ""construction=' + value + '"";'
  puts 'fixAdd: ""highway=construction"";'
  puts '}'
  puts
}

*/
*[construction=yes][highway=motorway] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=motorway"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=trunk] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=trunk"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=primary] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=primary"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=secondary] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=secondary"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=tertiary] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=tertiary"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=unclassified] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=unclassified"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=residential] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=residential"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=service] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=service"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=living_street] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=living_street"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=pedestrian] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=pedestrian"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=cycleway] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=cycleway"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=footway] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=footway"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=steps] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=steps"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=path] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=path"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=bridleway] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=bridleway"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=track] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=track"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=bus_guideway] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=bus_guideway"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=raceway] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=raceway"";
fixAdd: ""highway=construction"";
}

*[construction=yes][highway=road] {
    throwWarning: tr(""{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)"", ""{0.tag}"", ""{1.key}"", ""{1.value}"");
fixRemove: ""construction"";
fixRemove: ""highway"";
fixAdd: ""construction=road"";
fixAdd: ""highway=construction"";
}
}}}

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Revision: 8090
Repository Root: http://josm.openstreetmap.de/svn
Relative URL: ^/trunk
Last Changed Author: Don-vip
Last Changed Date: 2015-02-20 21:35:53 +0100 (Fri, 20 Feb 2015)
Build-Date: 2015-02-21 02:31:02
URL: http://josm.openstreetmap.de/svn/trunk
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last Changed Rev: 8090

Identification: JOSM/1.5 (8090 en) Linux Ubuntu 14.04.2 LTS
Memory Usage: 512 MB / 889 MB (219 MB allocated, but free)
Java version: 1.8.0_31, Oracle Corporation, Java HotSpot(TM) Server VM
Dataset consistency test: No problems found

Plugins:
- OpeningHoursEditor (30962)
- buildings_tools (30955)
- continuosDownload (1413902943)
- ext_tools (30892)
- measurement (30892)
- undelete (30892)

Last errors/warnings:
- W: TMS - Failed downloading http://ecn.t3.tiles.virtualearth.net/tiles/a12021021232231121211.jpeg?g=3293: Attribution is not loaded yet
- W: TMS - Failed downloading http://ecn.t0.tiles.virtualearth.net/tiles/a12021021232231121213.jpeg?g=3293: Attribution is not loaded yet
- W: TMS - Failed downloading http://ecn.t1.tiles.virtualearth.net/tiles/a12021021232231121031.jpeg?g=3293: Attribution is not loaded yet
- W: TMS - Failed downloading http://ecn.t2.tiles.virtualearth.net/tiles/a12021021232231121210.jpeg?g=3293: Attribution is not loaded yet
- E: Failed to locate image 'null'
}}}
"	enhancement	closed	normal		Core validator		wontfix	template_report	
