From b5ecc81a33dad88d935087633000fa3592154b6c Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Sat, 28 Mar 2020 23:23:37 -0700 Subject: [PATCH] Render foot/cyclepaths without regard to surface Rendering with a different dash pattern to indicate paved, unpaved, or unknown was a good idea, but in practice the difference between them is too subtle to be seen and understood. The existing rendering also constrained us cartographically, making it near-impossible to balance the patterns against a variety of backgrounds. --- project.mml | 37 ++------------- style/roads.mss | 122 ++++++++++-------------------------------------- 2 files changed, 27 insertions(+), 132 deletions(-) diff --git a/project.mml b/project.mml index d4d80a4194..fa2ed8f650 100644 --- a/project.mml +++ b/project.mml @@ -430,7 +430,6 @@ Layer: foot, bicycle, tracktype, - int_surface, access, construction, service, @@ -444,11 +443,6 @@ Layer: foot, bicycle, tracktype, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', - 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' - WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text END AS access, @@ -477,7 +471,6 @@ Layer: foot, bicycle, tracktype, - 'null', CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text @@ -496,8 +489,7 @@ Layer: z_order, CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, - CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, - CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END + CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END ) AS tunnels properties: cache-features: true @@ -676,7 +668,6 @@ Layer: foot, bicycle, tracktype, - int_surface, access, construction, service, @@ -690,11 +681,6 @@ Layer: foot, bicycle, tracktype, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', - 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' - WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text END AS access, @@ -726,7 +712,6 @@ Layer: foot, bicycle, tracktype, - 'null', CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text @@ -749,7 +734,6 @@ Layer: CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, - CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END, osm_id ) AS roads_sql properties: @@ -841,14 +825,7 @@ Layer: THEN substr(highway, 0, length(highway)-4) ELSE highway end)), ('railway_' || (CASE WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' WHEN railway IN ('rail', 'tram', 'light_rail', 'funicular', 'narrow_gauge') THEN railway END)) - ) AS feature, - CASE WHEN tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes' THEN 'yes' ELSE 'no' END AS int_tunnel, - CASE WHEN highway IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') THEN 'yes' ELSE 'no' END AS link, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', - 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' - WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - END AS int_surface + ) AS feature FROM planet_osm_roads WHERE highway IS NOT NULL OR (railway IS NOT NULL AND railway != 'preserved' @@ -894,7 +871,6 @@ Layer: foot, bicycle, tracktype, - int_surface, access, construction, service, @@ -908,11 +884,6 @@ Layer: foot, bicycle, tracktype, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', - 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' - WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' - END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text END AS access, @@ -941,7 +912,6 @@ Layer: foot, bicycle, tracktype, - 'null', CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text @@ -960,8 +930,7 @@ Layer: z_order, CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, - CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, - CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END + CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END ) AS bridges properties: cache-features: true diff --git a/style/roads.mss b/style/roads.mss index 5ccc85dbc2..0ef8bb7eda 100644 --- a/style/roads.mss +++ b/style/roads.mss @@ -1874,57 +1874,20 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ line/line-join: round; line/line-cap: round; line/line-width: @footway-width-z14; - [zoom >= 15][int_surface = 'paved'] { - line/line-dasharray: 2,3.5; - line/line-width: @footway-width-z15; - [zoom >= 16] { - line/line-dasharray: 3,3.5; - line/line-width: @footway-width-z16; - } - [zoom >= 17] { - line/line-dasharray: 3,3; - } - [zoom >= 18] { - line/line-width: @footway-width-z18; - } - [zoom >= 19] { - line/line-width: @footway-width-z19; - } + line/line-dasharray: 2,3.5; + line/line-width: @footway-width-z15; + [zoom >= 16] { + line/line-dasharray: 3,3.5; + line/line-width: @footway-width-z16; } - [zoom >= 15][int_surface = null] { - line/line-color: @footway-fill; - [access = 'no'] { line/line-color: @footway-fill-noaccess; } - line/line-dasharray: 1,3,2,4; - line/line-join: round; - line/line-cap: round; - line/line-width: @footway-width-z15; - [zoom >= 16] { - line/line-dasharray: 1,4,2,3; - line/line-width: @footway-width-z16; - } - [zoom >= 18] { - line/line-width: @footway-width-z18; - } - [zoom >= 19] { - line/line-width: @footway-width-z19; - } + [zoom >= 17] { + line/line-dasharray: 3,3; } - [zoom >= 15][int_surface = 'unpaved'] { - line/line-color: @footway-fill; - [access = 'no'] { line/line-color: @footway-fill-noaccess; } - line/line-dasharray: 1,4; - line/line-join: round; - line/line-cap: round; - line/line-width: @footway-width-z15; - [zoom >= 16] { - line/line-width: @footway-width-z16; - } - [zoom >= 18] { - line/line-width: @footway-width-z18; - } - [zoom >= 19] { - line/line-width: @footway-width-z19; - } + [zoom >= 18] { + line/line-width: @footway-width-z18; + } + [zoom >= 19] { + line/line-width: @footway-width-z19; } } } @@ -1955,57 +1918,20 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ line/line-join: round; line/line-cap: round; line/line-width: @cycleway-width-z13; - [zoom >= 15][int_surface = 'paved'] { - line/line-dasharray: 2,3.5; - line/line-width: @cycleway-width-z15; - [zoom >= 16] { - line/line-dasharray: 3,3.5; - line/line-width: @cycleway-width-z16; - } - [zoom >= 17] { - line/line-dasharray: 3,3; - } - [zoom >= 18] { - line/line-width: @cycleway-width-z18; - } - [zoom >= 19] { - line/line-width: @cycleway-width-z19; - } + line/line-dasharray: 2,3.5; + line/line-width: @cycleway-width-z15; + [zoom >= 16] { + line/line-dasharray: 3,3.5; + line/line-width: @cycleway-width-z16; } - [zoom >= 15][int_surface = null] { - line/line-color: @cycleway-fill; - [access = 'no'] { line/line-color: @cycleway-fill-noaccess; } - line/line-dasharray: 1,3,2,4; - line/line-join: round; - line/line-cap: round; - line/line-width: @cycleway-width-z15; - [zoom >= 16] { - line/line-dasharray: 1,4,2,3; - line/line-width: @cycleway-width-z16; - } - [zoom >= 18] { - line/line-width: @cycleway-width-z18; - } - [zoom >= 19] { - line/line-width: @cycleway-width-z19; - } + [zoom >= 17] { + line/line-dasharray: 3,3; } - [zoom >= 15][int_surface = 'unpaved'] { - line/line-color: @cycleway-fill; - [access = 'no'] { line/line-color: @cycleway-fill-noaccess; } - line/line-dasharray: 1,4; - line/line-join: round; - line/line-cap: round; - line/line-width: @cycleway-width-z15; - [zoom >= 16] { - line/line-width: @cycleway-width-z16; - } - [zoom >= 18] { - line/line-width: @cycleway-width-z18; - } - [zoom >= 19] { - line/line-width: @cycleway-width-z19; - } + [zoom >= 18] { + line/line-width: @cycleway-width-z18; + } + [zoom >= 19] { + line/line-width: @cycleway-width-z19; } } }