﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10837	Some more validation rules for JOSM	naoliv	Klumbumbus	"Good that you have included #10825 :-)
I have some more rules that we are using here that probably could be used everywhere else (and maybe you could be interested in including some of them in JOSM)

{{{
#!mapcss
/* is using any other *_name tag but not a name */
*[/_name$/][!name] {
        throwWarning: tr(""using alternative name without {0}"", ""{1.key}"");
}
}}}
'''Done.'''
{{{
#!mapcss
/* using nomame = yes + name is contradictory */
*[noname?][name] {
        throwWarning: tr(""contradictory use of {0} and {1}"", ""{0.key}"", ""{1.key}"");
}
}}}
'''Done.'''
{{{
#!mapcss
/* follows http://wiki.openstreetmap.org/wiki/Proposed_features/drop_recommendation_for_place_name */

/* when name = place_name we just remove place_name */
*[place][place_name = *name] {
        throwWarning: tr(""{0} = {1}; remove {0}"", ""{1.key}"", ""{1.value}"");
        fixRemove: ""{1.key}"";
}

/* when it has place_name but not name, we rename place_name to name */
*[place][place_name][!name] {
        throwWarning: tr(""do not use {0}"", ""{1.key}"");
        suggestAlternative: ""name"";
        fixChangeKey: ""{1.key} => {2.key}"";
}
}}}
'''Done.'''
{{{
#!mapcss
/* the highway ""name"" already define it's own address; it's strange to also have a ""addr:street"" on highways */
*[highway][""addr:street""] {
        throwWarning: tr(""{0} should not have a {1} tag"", ""{0.key}"", ""{1.key}"");
}
}}}
'''Done.'''
{{{
#!mapcss
/* should use building:levels instead building + levels */
*[building][levels] {
        throwWarning: tr(""use building:levels instead {0}"", ""{1.key}"");
        fixChangeKey: ""levels => building:levels"";
}
}}}
'''Done.'''
{{{
#!mapcss
/* they shouldn't have a ""yes"" or ""true"" value */
*[amenity?],
*[place?] {
        throwWarning: tr(""unspecific value for {0}"", ""{0.key}"");
}
}}}
'''Done.'''
{{{
#!mapcss
/* lanes* must be an integer positive number only */
way[highway][lanes][lanes !~ /^[1-9]([0-9]*)$/],
way[highway][""lanes:backward""][""lanes:backward"" !~ /^[1-9]([0-9]*)$/],
way[highway][""lanes:forward""][""lanes:forward"" !~ /^[1-9]([0-9]*)$/] {
        throwError: tr(""{0} must be a positive integer number"", ""{1.key}"");
}
}}}
'''Done.'''
{{{
#!mapcss
/* destination rules http://wiki.openstreetmap.org/wiki/Key:destination */
/* destination is ""Worthwile only if used in combination with oneway=yes"" */
way[destination][!oneway?] {
        throwWarning: tr(""incomplete usage of {0}"", ""{0.key}"");
        suggestAlternative: ""destination:forward"";
        suggestAlternative: ""destination:backward"";
}
}}}
'''Done.'''

Note that those tests were created for data that we were seeing here in Brazil but they aren't specific for here.
Some warning messages probably need a better wording.

Anything that could be useful for JOSM?"	enhancement	closed	normal	14.12	Core validator		fixed	mapcss	
