Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Render path with bicycle=designated almost as a cycleway and segregated as a cycleway #184

Merged
merged 6 commits into from
Oct 1, 2019
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
12 changes: 7 additions & 5 deletions labels.mss
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,14 @@
marker-max-error: 0.5;
marker-spacing: 100;
marker-fill: #777777;
[oneway != 'yes'][oneway_bicycle = 'yes'] {
marker-fill: #00f;
}
[highway='cycleway'] {
[highway='cycleway'],
[highway='path'] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to have an is_primary_bike value exported in the SQL output and filter on this one. This one, we could also account for some bicycle=designated cases or roads without motor traffic.

Might also be better in terms of Mapnik XML file size / etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_primary_bike for what tags combination ?

marker-fill: #ddf;
}
/* Weird case where the road is oneway for only the bicycles, blue arrow. */
[oneway != 'yes'][oneway_bicycle = 'yes'][highway!='path'][highway!='cycleway'] {
Phyks marked this conversation as resolved.
Show resolved Hide resolved
marker-fill: #00f;
}
marker-file: url(symbols/oneway.svg);
[oneway='-1'] {
marker-file: url(symbols/oneway-reverse.svg);
Expand All @@ -549,7 +551,7 @@
}
}
[oneway = 'yes'][oneway_bicycle = 'no'],
[oneway='-1'][oneway_bicycle = 'no'] {
[oneway = '-1'][oneway_bicycle = 'no'] {
bike/marker-placement:line;
bike/marker-max-error: 0.5;
bike/marker-spacing: 100;
Expand Down
46 changes: 42 additions & 4 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,18 @@ Layer:
WHEN access='no' AND (bicycle IS NULL OR bicycle='no') THEN 'no'
ELSE NULL
END AS can_bicycle,
CASE
WHEN bicycle IN ('designated') THEN 'yes'
ELSE NULL
END AS designated,
CASE
WHEN tags->'segregated' IN ('yes') THEN 'yes'
ELSE 'no'
END AS segregated,
CASE
WHEN tags->'oneway:bicycle' IN ('yes', '-1') THEN 'yes'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THEN tags->'oneway:bicycle' to keep the direction, or we will never need it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the question.

ELSE 'no'
END AS oneway_bicycle,
tags->'ramp:stroller' AS ramp_stroller,
tags->'ramp:bicycle' AS ramp_cycle,
tags->'ramp:wheelchair' AS ramp_wheelchair,
Expand Down Expand Up @@ -627,6 +639,18 @@ Layer:
WHEN access='no' AND (bicycle IS NULL OR bicycle='no') THEN 'no'
ELSE NULL
END AS can_bicycle,
CASE
WHEN bicycle IN ('designated') THEN 'yes'
ELSE NULL
END AS designated,
CASE
WHEN tags->'segregated' IN ('yes') THEN 'yes'
ELSE 'no'
END AS segregated,
CASE
WHEN tags->'oneway:bicycle' IN ('yes', '-1') THEN 'yes'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THEN tags->'oneway:bicycle' to keep the direction, or we will never need it?

ELSE 'no'
END AS oneway_bicycle,
tags->'ramp:stroller' AS ramp_stroller,
tags->'ramp:bicycle' AS ramp_cycle,
tags->'ramp:wheelchair' AS ramp_wheelchair,
Expand Down Expand Up @@ -778,6 +802,18 @@ Layer:
WHEN access='no' AND (bicycle IS NULL OR bicycle='no') THEN 'no'
ELSE NULL
END AS can_bicycle,
CASE
WHEN bicycle IN ('designated') THEN 'yes'
ELSE NULL
END AS designated,
CASE
WHEN tags->'segregated' IN ('yes') THEN 'yes'
ELSE 'no'
END AS segregated,
CASE
WHEN tags->'oneway:bicycle' IN ('yes', '-1') THEN 'yes'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THEN tags->'oneway:bicycle' to keep the direction, or we will never need it?

ELSE 'no'
END AS oneway_bicycle,
tags->'ramp:stroller' AS ramp_stroller,
tags->'ramp:bicycle' AS ramp_cycle,
tags->'ramp:wheelchair' AS ramp_wheelchair,
Expand Down Expand Up @@ -1987,8 +2023,7 @@ Layer:
ELSE 'no'
END AS oneway,
CASE
WHEN tags->'oneway:bicycle'='no' THEN 'no'
WHEN tags->'oneway:bicycle'='yes' THEN 'yes'
WHEN tags->'oneway:bicycle' IN ('yes', '-1') THEN 'yes'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THEN tags->'oneway:bicycle' to keep the direction, or we will never need it?

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')
Expand Down Expand Up @@ -2023,9 +2058,12 @@ Layer:
USING (highway)
WHERE highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary',
'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street', 'construction', 'cycleway', 'path')
AND (name IS NOT NULL
AND (
name IS NOT NULL
OR oneway IN ('yes', '-1')
OR junction IN ('roundabout'))
OR tags->'oneway:bicycle' IN ('yes', '-1')
OR junction IN ('roundabout')
)
ORDER BY
z_order DESC, -- put important roads first
CASE WHEN layer~E'^\\d+$' THEN layer::integer ELSE 0 END, -- put top layered roads first
Expand Down
2 changes: 1 addition & 1 deletion road-colors-generated.mss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@icn-shield-fill: #f6f6f6;
@lcn-overlay: #0000ff;
@lcn-shield-fill: #f6f6f6;
@mixed-cycle-fill: #0080ff;
@mixed-cycle-fill: #0050ff;
@motorway-trunk-case: #f6f6f6;
@motorway-trunk-fill: #c0ccc4;
@motorway-trunk-line: #f6f6f6;
Expand Down
2 changes: 1 addition & 1 deletion road-colors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mss:
fill: '#0000ff'
case: '@land'
mixed-cycle:
fill: '#0080ff'
fill: '#0050ff'
footway:
fill: '#4f874f'
steps:
Expand Down
Loading