﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
19677	[Patch] Unnecessary tagging: cycleway:surface + surface + highway=cycleway	Famlam	team	"Similar to `highway=residential`, where the key `surface` refers to the ""residential road"" and only `sidewalk`/`cycleway` are keys on this way that can have a `:surface` suffix, on `highway=cycleway`, there is no need to specify `cycleway:surface=*`. Just `surface` would be sufficient (and it's definitely not needed to use both).
(The same applies to `highway=footway` and `footway:surface`=*)

Affects roughly 2000 ways in Europe:
https://overpass-turbo.eu/s/X3F

Hence, I'd propose the following rules:
{{{
#!rule
way[/^cycleway:(\w+:)?surface$/][surface][highway=cycleway],
way[/^footway:(\w+:)?surface$/][surface][highway=footway] {
  throwWarning: tr(""{0} together with {1} and {2}. Remove {0}."", ""{0.key}"", ""{1.key}"", ""{2.tag}"");
  group: tr(""unnecessary tag"");
  assertMatch: ""way highway=cycleway surface=asphalt cycleway:left:surface=asphalt"";
  assertMatch: ""way highway=footway surface=paved footway:surface=paved"";
  assertNoMatch: ""way highway=cycleway surface=asphalt sidewalk:surface=paved"";
  assertNoMatch: ""way highway=cycleway surface=asphalt footway:surface=paved"";
  assertNoMatch: ""way highway=unclassified cycleway=lane surface=paving_stones cycleway:surface=asphalt"";
  assertNoMatch: ""way highway=path cycleway:surface=asphalt footway:surface=paved"";
}
way[/^cycleway:(\w+:)?surface$/][highway=cycleway][!surface],
way[/^footway:(\w+:)?surface$/][highway=footway][!surface] {
  throwWarning: tr(""{0} together with {1}"", ""{0.key}"", ""{1.tag}"");
  group: tr(""suspicious tag combination"");
  assertMatch: ""way highway=cycleway cycleway:left:surface=asphalt"";
  assertMatch: ""way highway=footway footway:surface=paved"";
  assertNoMatch: ""way highway=cycleway sidewalk:surface=paved"";
  assertNoMatch: ""way highway=unclassified cycleway=lane cycleway:surface=asphalt"";
  assertNoMatch: ""way highway=path cycleway:surface=asphalt footway:surface=paved"";
  suggestAlternative: ""surface"";
  fixChangeKey: ""{0.key}=>surface"";
}
}}}

Note: I left out autofix for the first test, in case of i.e. `surface=paved` and `cycleway:surface=paving_stones`, where the latter is the most specific in the type of pavement, and thus surface=paving_stones should be used.


p.s. for the cases where it's allowed to use `cycleway:surface` and `footway:surface` together, the following might be interesting, but it's rare to encounter such cases, so probably not worth adding :)
{{{
#!rule
way[""footway:surface""][""cycleway:surface""][segregated=no][highway][""footway:surface""!=*""cycleway:surface""] {
  throwWarning: tr(""{0} and {1} together with {2} and conflicting values"", ""{0.key}"", ""{1.key}"", ""{2.tag}"");
  group: tr(""suspicious tag combination"");
  assertMatch: ""way highway=path footway:surface=sett cycleway:surface=asphalt segregated=no"";
}
}}}"	enhancement	new	normal		Core validator			surface cycleway footway	Klumbumbus
