diff --git a/openstreetmap-carto-flex.lua b/openstreetmap-carto-flex.lua index 832cbe5a2..4f2611eac 100644 --- a/openstreetmap-carto-flex.lua +++ b/openstreetmap-carto-flex.lua @@ -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 }, + bus_guideway = { z = 180, roads = false }, service = { z = 150, roads = false }, track = { z = 110, roads = false }, path = { z = 100, roads = false }, diff --git a/project.mml b/project.mml index 8e9dce243..06e48aaab 100644 --- a/project.mml +++ b/project.mml @@ -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, @@ -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, @@ -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 @@ -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, @@ -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')) diff --git a/style/roads.mss b/style/roads.mss index bbfabb4dc..6e86e3000 100644 --- a/style/roads.mss +++ b/style/roads.mss @@ -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; @@ -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%); @@ -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] { @@ -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 { @@ -2516,6 +2535,37 @@ 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; + } + } + } [feature = 'railway_rail'][zoom >= 8][zoom < 10], [feature = 'railway_rail'][preserved != 'yes'][zoom >= 10][zoom < 12], @@ -4104,12 +4154,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; @@ -4144,6 +4194,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; } @@ -4162,8 +4216,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;