Skip to content

Commit

Permalink
fix #23932 - patch by huntertur - Add cycleway:*:buffer to Highways/W…
Browse files Browse the repository at this point in the history
…ays/Cycle Lane/Track preset

git-svn-id: https://josm.openstreetmap.de/svn/trunk@19257 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Nov 15, 2024
1 parent 595e5e1 commit af4fb15
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/data/defaultpresets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1323,8 +1323,11 @@
<space />
<optional text="Cycleway Lane Attributes">
<combo key="cycleway:both:lane" text="Lane type (both)" values_context="cycleway" values="advisory,exclusive"/>
<check key="cycleway:both:buffer" text="Has buffer between automobiles and cycleway (both)" />
<combo key="cycleway:left:lane" text="Lane type (left)" values_context="cycleway" values="advisory,exclusive"/>
<check key="cycleway:left:buffer" text="Has buffer between automobiles and cycleway (left)" />
<combo key="cycleway:right:lane" text="Lane type (right)" values_context="cycleway" values="advisory,exclusive"/>
<check key="cycleway:right:buffer" text="Has buffer between automobiles and cycleway (right)" />
</optional>
<optional text="Edit Highway Attributes:">
<combo key="highway" text="Highway" values="motorway,motorway_link,trunk,trunk_link,primary,primary_link,secondary,secondary_link,tertiary,tertiary_link,unclassified,residential,living_street,service,bus_guideway,construction" values_context="Highway" values_sort="false" />
Expand Down
72 changes: 72 additions & 0 deletions resources/data/validator/combinations.mapcss
Original file line number Diff line number Diff line change
Expand Up @@ -1065,3 +1065,75 @@ area[/^(building|building:part)$/][building:levels][building:min_level][tag("bui
throwWarning: tr("{0} is lower or equal to {1} on {2}", "{1.key}", "{2.key}", "{0.key}");
group: tr("suspicious tag combination");
}

/* #23932 */
way[cycleway:right][cycleway:right!=lane][cycleway:right!=separate][/^cycleway(:right|:both|):buffer/],
way[cycleway:left][cycleway:left!=lane][cycleway:left!=separate][/^cycleway(:left|:both|):buffer/],
way[cycleway:both][cycleway:both!=lane][cycleway:both!=separate][/^cycleway(:right|:left|:both|):buffer/],
way[cycleway][cycleway!=lane][cycleway!=separate][/^cycleway(:right|:left|:both|):buffer/] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{3.tag}");
group: tr("suspicious tag combination");
assertMatch: "way cycleway:right=separate cycleway:right:buffer=yes";
assertMatch: "way cycleway:left=shared_lane cycleway:buffer=no";
assertMatch: "way cycleway:both=track cycleway:left:buffer=yes";
assertMatch: "way cycleway=shared_busway cycleway:buffer=no";
assertNoMatch: "way cycleway:right=lane cycleway:right:buffer=no";
assertNoMatch: "way cycleway:right=separate cycleway:right:buffer=yes";
assertNoMatch: "way cycleway:left=lane cycleway:left:buffer=yes";
assertNoMatch: "way cycleway:both=lane cycleway:both:buffer=no";
assertNoMatch: "way cycleway:both=lane cycleway:left:buffer=yes";
assertNoMatch: "way cycleway:both=lane cycleway:buffer=no";
assertNoMatch: "way cycleway=lane cycleway:buffer=yes";
assertNoMatch: "way cycleway=lane cycleway:right:buffer=no";
assertNoMatch: "way cycleway=lane cycleway:both:buffer=no";
}

way[cycleway:right=separate][/^cycleway(:right|:both):./],
way[cycleway:left=separate][/^cycleway(:left|:both):./],
way[cycleway:both=separate][/^cycleway(:right|:left|:both):./],
way[cycleway=separate][/^cycleway(:right|:left|:both):./] {
throwWarning: tr("{0} together with {1}. Remove {1}.", "{0.tag}", "{1.tag}");
group: tr("suspicious tag combination");
assertMatch: "way cycleway:right=separate cycleway:right:surface=asphalt";
assertMatch: "way cycleway:right=separate cycleway:both:buffer=yes";
assertMatch: "way cycleway:left=separate cycleway:left:surface=asphalt";
assertMatch: "way cycleway:left=separate cycleway:both:buffer=yes";
assertMatch: "way cycleway:both=separate cycleway:right:surface=asphalt";
assertMatch: "way cycleway:both=separate cycleway:left:surface=asphalt";
assertMatch: "way cycleway:both=separate cycleway:both:buffer=yes";
assertMatch: "way cycleway=separate cycleway:right:surface=asphalt";
assertMatch: "way cycleway=separate cycleway:left:surface=asphalt";
assertMatch: "way cycleway=separate cycleway:both:buffer=yes";
assertNoMatch: "way cycleway:right=separate cycleway:left:surface=asphalt";
assertNoMatch: "way cycleway:left=separate cycleway:right:buffer=yes";
assertNoMatch: "way cycleway:both=separate";
assertNoMatch: "way cycleway=separate";
}

way[/^cycleway:right:/][!cycleway:right][!cycleway:both][!cycleway],
way[/^cycleway:left:/][!cycleway:left][!cycleway:both][!cycleway],
way[/^cycleway:both:/][!cycleway:both][!cycleway][!cycleway:left][!cycleway:right],
way[/^cycleway(?!:right|:left|:both|:lanes):/][!cycleway][!cycleway:both][!cycleway:left][!cycleway:right][segregated!=yes] {
throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
group: tr("missing tag");
suggestAlternative: "{0.tag} + {1.key}=*";
assertMatch: "way cycleway:right=lane cycleway:left:buffer=yes";
assertMatch: "way cycleway:right:buffer=yes";
assertMatch: "way cycleway:right:surface=asphalt";
assertMatch: "way cycleway:left=lane cycleway:right:buffer=no";
assertMatch: "way cycleway:left:buffer=yes";
assertMatch: "way cycleway:left:surface=asphalt";
assertMatch: "way cycleway:both:buffer=yes";
assertMatch: "way cycleway:both:surface=asphalt";
assertMatch: "way cycleway:buffer=no";
assertNoMatch: "way cycleway:right=lane cycleway:right:buffer=yes";
assertNoMatch: "way cycleway:left=lane cycleway:left:buffer=yes";
assertNoMatch: "way cycleway:both=lane cycleway:both:buffer=yes";
assertNoMatch: "way cycleway=lane cycleway:buffer=yes";
assertNoMatch: "way cycleway:left=lane cycleway:right=lane cycleway:both:buffer=yes";
assertNoMatch: "way cycleway:left=lane cycleway:right=lane cycleway:buffer=no";
assertNoMatch: "way cycleway=lane cycleway:surface=asphalt";
assertNoMatch: "way cycleway:both=lane cycleway:both:surface=asphalt";
assertNoMatch: "way highway=path segregated=yes cycleway:surface=needles footway:surface=paving_stones";
assertNoMatch: "way highway=primary oneway=yes bicycle:lanes=no|designated|yes cycleway:lanes=|lane|no";
}

0 comments on commit af4fb15

Please sign in to comment.