Opened 5 years ago
Last modified 4 years 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 (8)
comment:1 by , 5 years ago
| Summary: | Unnecessary tagging: cycleway:surface + surface + highway=cycleway → [Patch] Unnecessary tagging: cycleway:surface + surface + highway=cycleway |
|---|
comment:2 by , 4 years ago
| Cc: | added |
|---|
comment:3 by , 4 years ago
comment:4 by , 4 years ago
+1, but we need to change the text, too. Simply removing
cycleway:surfaceis 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
comment:5 by , 4 years ago
A cycleway can be a shared way if tagged with foot=designated|yes, so the following is a valid tagging:
highway=cycleway foot=designated cycleway:surface=asphalt footway:surface=asphalt surface=asphalt
In this case, the proposed rule suggests removing the cycleway:surface=asphalt which is not good. The same applies to highway=path|footway.
As far as I know, mostly StreetComplete adds the :surface suffixes, not editors directly. When we simplify the tags from the example to surface=asphalt, they will re-add them again without removing the common surface tag.
Also, the numbers have risen since. Today affecting more than 15k ways (the overpass query missing the highway=path).
comment:6 by , 4 years ago
@gaben, I'm sorry, but I don't follow what you're saying. Why is it good to have both surface as well as cycleway:surface for a cycleway? The surface tag always refers to the cycleway part, any other additions (footways on a designated cycleway) can indeed have their own *:surface tag, but cycleway:surface means the same as surface on a cycleway, so having them both is just plain wrong (and indeed it seems StreetComplete is the biggest source of this issue). Just like residential:surface, or highway:surface would be bad for a highway=residential, but cycleway:surface on a residential would be perfectly fine if it has a cycleway=lane for instance (and the lane has a different surface than the main road).
Also, I purposefully didn't add highway=path to the check. (What's the default of a path? It can allow or disallow bikes, pedestrians, horses, ..., so as long as no-one makes up path:surface, there's no need for that check to be added)
comment:7 by , 4 years ago
Replying to Famlam:
Why is it good to have both
surfaceas well ascycleway:surfacefor a cycleway?
With the example, I meant valid, not ideal/good.
Just like
residential:surface, orhighway:surfacewould be bad for ahighway=residential, butcycleway:surfaceon a residential would be perfectly fine if it has acycleway=lanefor instance (and the lane has a different surface than the main road).
Yes, this exactly. See the example, the surface is the same and the rule suggests deleting only cycleway:surface, not both suffixed ones.
Also, I purposefully didn't add
highway=pathto the check. (What's the default of a path? It can allow or disallow bikes, pedestrians, horses, ..., so as long as no-one makes uppath:surface, there's no need for that check to be added)
I think if a highway=residential can have cycleway:surface, then highway=path can have cycleway:surface as well. Of course, only if it's designated as a combined foot- and cycleway (see the wiki).
comment:8 by , 4 years ago
With the example, I meant valid, not ideal/good.
True, but that's why it's not a throwError.
Yes, this exactly. See the example, the surface is the same and the rule suggests deleting only cycleway:surface, not both suffixed ones.
Why would footway:surface have to be deleted? A cycleway can have a separate - but not designated - footway. Very common in The Netherlands is to have a designated cycleway with a (non-designated) sidewalk for pedestrians (which would be tagged sidewalk:surface, but that's a different story). Typically, they're paved with square bricks while cycleways are either asphalt or paving_stones.
I think if a highway=residential can have cycleway:surface, then highway=path can have cycleway:surface as well. Of course, only if it's designated as a combined foot- and cycleway (see the wiki).
Agreed, that's why it's not part of the check :)



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