Modify

Opened 16 months ago

Last modified 7 months ago

#19677 new enhancement

[Patch] Unnecessary tagging: cycleway:surface + surface + highway=cycleway

Reported by: Famlam Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: surface cycleway footway Cc: Klumbumbus

Description

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:

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 :)

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";
}

Attachments (0)

Change History (4)

comment:1 Changed 15 months ago by Famlam

Summary: Unnecessary tagging: cycleway:surface + surface + highway=cycleway[Patch] Unnecessary tagging: cycleway:surface + surface + highway=cycleway

comment:2 Changed 7 months ago by simon04

Cc: Klumbumbus added

comment:3 in reply to:  description Changed 7 months ago by skyper

Replying to Famlam:

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.


+1, but we need to change the text, too. Simply removing cycleway:surface is not what we want to suggest here, right?

comment:4 Changed 7 months ago by Famlam

+1, but we need to change the text, too. Simply removing cycleway:surface is not what we want to suggest here, right?

Right, maybe simply without Remove {0}.? If they remove the "wrong one", the validator will simply warn a second time to use surface instead

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