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

Move guideways to roads #5057

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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 openstreetmap-carto-flex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ local roads_info = {
primary_link = { z = 220, roads = true },
secondary_link = { z = 210, roads = true },
tertiary_link = { z = 200, roads = false },
busway = {z = 190, roads = false},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Whitespace inconsistency here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

bus_guideway = {z = 180, roads = false},
service = { z = 150, roads = false },
track = { z = 110, roads = false },
path = { z = 100, roads = false },
Expand Down
21 changes: 4 additions & 17 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ Layer:
table: |-
(SELECT
way,
(CASE WHEN feature IN ('highway_motorway_link', 'highway_trunk_link', 'highway_primary_link', 'highway_secondary_link', 'highway_tertiary_link') THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,
CASE WHEN link = 'yes' THEN substr(feature, 0, length(feature)-4) ELSE feature END AS feature,
tracktype,
int_surface,
int_access,
Expand Down Expand Up @@ -698,7 +698,7 @@ Layer:
table: &roads_sql |-
(SELECT
way,
(CASE WHEN feature IN ('highway_motorway_link', 'highway_trunk_link', 'highway_primary_link', 'highway_secondary_link', 'highway_tertiary_link') THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,
CASE WHEN link = 'yes' THEN substr(feature, 0, length(feature)-4) ELSE feature END AS feature,
tracktype,
int_surface,
int_access,
Expand Down Expand Up @@ -858,19 +858,6 @@ Layer:
cache-features: true
minzoom: 6
maxzoom: 9
- id: guideways
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE highway = 'bus_guideway'
) AS guideways
properties:
minzoom: 11
- id: bridges
geometry: linestring
<<: *extents
Expand All @@ -887,7 +874,7 @@ Layer:
table: |-
(SELECT
way,
(CASE WHEN feature IN ('highway_motorway_link', 'highway_trunk_link', 'highway_primary_link', 'highway_secondary_link', 'highway_tertiary_link') THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,
CASE WHEN link = 'yes' THEN substr(feature, 0, length(feature)-4) ELSE feature END AS feature,
tracktype,
int_surface,
int_access,
Expand Down Expand Up @@ -1946,7 +1933,7 @@ Layer:
END AS oneway
FROM planet_osm_line l
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')
'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street', 'construction', 'bus_guideway')
AND (name IS NOT NULL
OR oneway IN ('yes', '-1')
OR junction IN ('roundabout'))
Expand Down
65 changes: 61 additions & 4 deletions style/roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
@residential-tunnel-fill: darken(@residential-fill, 5%);
@living-street-tunnel-fill: lighten(@living-street-fill, 3%);

@bus-guideway-fill: #6699ff;
@bus-guideway-tunnel-fill: lighten(desaturate(@bus-guideway-fill, 20%), 8%);

@motorway-width-z6: 0.4;
@trunk-width-z6: 0.4;

Expand Down Expand Up @@ -303,6 +306,7 @@
@residential-oneway-arrow-color: darken(@residential-casing, 40%);
@living-street-oneway-arrow-color: darken(@residential-casing, 30%);
@pedestrian-oneway-arrow-color: darken(@pedestrian-casing, 25%);
@bus-guideway-oneway-arrow-color: darken(@bus-guideway-fill, 25%);
@raceway-oneway-arrow-color: darken(@raceway-fill, 50%);
@footway-oneway-arrow-color: darken(@footway-fill, 35%);
@steps-oneway-arrow-color: darken(@steps-fill, 35%);
Expand Down Expand Up @@ -789,6 +793,13 @@
}
}

[feature = 'highway_bus_guideway'][zoom >= 13] {
#bridges {
line-width: 6.5;
line-color: @bridge-casing;
line-join: round;
}
}

[feature = 'railway_tram'],
[feature = 'railway_tram-service'][zoom >= 15] {
Expand Down Expand Up @@ -1018,6 +1029,14 @@
}
}

[feature = 'highway_bus_guideway'][zoom >= 13] {
#bridges {
line-width: 5;
line-color: white;
line-join: round;
}
}

[feature = 'railway_rail'][zoom >= 13],
[feature = 'railway_monorail'][zoom >= 14] {
#bridges {
Expand Down Expand Up @@ -2516,6 +2535,41 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}
}
}

[feature = 'highway_bus_guideway'][zoom >= 11] {
[zoom < 13] {
line-width: 0.6;
[zoom >= 12] { line-width: 1; }
#roads-fill, #bridges {
line-color: @bus-guideway-fill;
}
#tunnels {
line-color: @bus-guideway-tunnel-fill;
line-dasharray: 5,2;
}
}
[zoom >= 13] {
line-width: 3;
line-join: round;
#roads-fill, #bridges {
line-color: @bus-guideway-fill;
}
#tunnels {
line-color: @bus-guideway-tunnel-fill;
}
b/line-width: 1;
b/line-color: white;
b/line-dasharray: 8,12;
b/line-join: round;
[zoom >= 14] {
b/line-dasharray: 0,11,8,1;
}
[zoom >= 17] {
line-width: 5;
b/line-width: 2.5;
}
}
}

[feature = 'railway_rail'][zoom >= 8][zoom < 10],
[feature = 'railway_rail'][preserved != 'yes'][zoom >= 10][zoom < 12],
Expand Down Expand Up @@ -4104,12 +4158,12 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
[highway = 'residential'],
[highway = 'unclassified'],
[highway = 'living_street'],
[highway = 'bus_guideway'],
[highway = 'road'],
[highway = 'service'],
[highway = 'pedestrian'],
[highway = 'raceway'] {
[oneway = 'yes'],
[oneway = '-1'] {
[oneway != null] {
marker-placement: line;
marker-spacing: 180;
marker-max-error: 0.5;
Expand Down Expand Up @@ -4144,6 +4198,10 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
[highway = 'service'] {
marker-fill: @residential-oneway-arrow-color;
}
[highway = 'bus_guideway'] {
marker-fill: @bus-guideway-oneway-arrow-color;
marker-offset: 7;
}
[highway = 'living_street'] {
marker-fill: @living-street-oneway-arrow-color;
}
Expand All @@ -4162,8 +4220,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
[highway = 'path'],
[highway = 'track'],
[highway = 'bridleway'] {
[oneway = 'yes'],
[oneway = '-1'] {
[oneway != null] {
text-name: "'🠖'";
text-size: 15;
text-clip: false;
Expand Down