Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add fallback values for oneway_bicycle to views.sql #627

Merged
merged 4 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Ensure bicycle crossing are drawn at crossings with highway=service. See #503.
* Handle `cycleway:left|right:oneway=-1` as aliases of
`cycleway:left|right=opposite_lane`. See #555.
* Cycleways and bicycle-designated paths with no oneway tag are now drawn like a
cycleway/path with oneway=no tag. See #601


## v0.6
Expand Down
7 changes: 4 additions & 3 deletions views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CREATE VIEW cyclosm_ways AS
END AS cyclestreet,
CASE
WHEN oneway IN ('yes', '-1') THEN oneway
WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'
WHEN junction IN ('roundabout') AND (oneway IS NULL OR oneway NOT IN ('no', 'reversible')) THEN 'yes'
ELSE 'no'
END AS oneway,
CASE
Expand Down Expand Up @@ -113,14 +113,15 @@ CREATE VIEW cyclosm_ways AS
END AS segregated,
CASE
WHEN tags->'oneway:bicycle' IS NOT NULL THEN tags->'oneway:bicycle'
WHEN highway='cycleway' AND oneway IS NOT NULL THEN oneway
WHEN tags->'cycleway' IN ('opposite', 'opposite_lane', 'opposite_track', 'opposite_share_busway')
OR tags->'cycleway:both' IN ('opposite', 'opposite_lane', 'opposite_track', 'opposite_share_busway')
OR tags->'cycleway:left' IN ('opposite', 'opposite_lane', 'opposite_track', 'opposite_share_busway')
OR tags->'cycleway:right' IN ('opposite', 'opposite_lane', 'opposite_track', 'opposite_share_busway')
OR tags->'cycleway:left:oneway'='-1' OR tags->'cycleway:right:oneway'='-1'
THEN 'no'
ELSE NULL
WHEN oneway IN ('yes', '-1') THEN oneway
WHEN junction IN ('roundabout') AND (oneway IS NULL OR oneway NOT IN ('no', 'reversible')) THEN 'yes'
ELSE 'no'
END AS oneway_bicycle,
COALESCE(
tags->'ramp:bicycle',
Expand Down