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

Introduce sac_scale and trail_visibility on highway=path #4692

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
32 changes: 30 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ Layer:
bicycle,
tracktype,
int_surface,
int_difficulty,
access,
construction,
service,
Expand All @@ -454,6 +455,11 @@ Layer:
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 (tags->'sac_scale' IN ('demanding_mountain_hiking', 'alpine_hiking', 'demanding_alpine_hiking', 'difficult_alpine_hiking')
OR
tags->'trail_visibility' IN ('intermediate','bad','horrible','no')) THEN 'demanding'
ELSE 'normal'
END AS int_difficulty,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
END AS access,
Expand Down Expand Up @@ -483,6 +489,7 @@ Layer:
bicycle,
tracktype,
'null',
'null',
CASE
WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
Expand All @@ -502,7 +509,8 @@ 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 1 END
CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 1 END,
CASE WHEN int_difficulty IN ('demanding') THEN 0 ELSE 1 END
) AS tunnels
properties:
cache-features: true
Expand Down Expand Up @@ -690,6 +698,7 @@ Layer:
bicycle,
tracktype,
int_surface,
int_difficulty,
access,
construction,
service,
Expand All @@ -708,6 +717,11 @@ Layer:
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 (tags->'sac_scale' IN ('demanding_mountain_hiking', 'alpine_hiking', 'demanding_alpine_hiking', 'difficult_alpine_hiking')
OR
tags->'trail_visibility' IN ('intermediate','bad','horrible','no')) THEN 'demanding'
ELSE 'normal'
END AS int_difficulty,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
END AS access,
Expand Down Expand Up @@ -745,6 +759,11 @@ Layer:
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface,
CASE WHEN (tags->'sac_scale' IN ('demanding_mountain_hiking', 'alpine_hiking', 'demanding_alpine_hiking', 'difficult_alpine_hiking')
OR
tags->'trail_visibility' IN ('intermediate','bad','horrible','no')) THEN 'demanding'
ELSE 'normal'
END AS int_difficulty,
CASE
WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
Expand All @@ -768,6 +787,7 @@ Layer:
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 1 END,
CASE WHEN int_difficulty IN ('demanding') THEN 0 ELSE 1 END,
osm_id
) AS roads_sql
properties:
Expand Down Expand Up @@ -923,6 +943,7 @@ Layer:
bicycle,
tracktype,
int_surface,
int_difficulty,
access,
construction,
service,
Expand All @@ -941,6 +962,11 @@ Layer:
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 (tags->'sac_scale' IN ('demanding_mountain_hiking', 'alpine_hiking', 'demanding_alpine_hiking', 'difficult_alpine_hiking')
OR
tags->'trail_visibility' IN ('intermediate','bad','horrible','no')) THEN 'demanding'
ELSE 'normal'
END AS int_difficulty,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
END AS access,
Expand Down Expand Up @@ -970,6 +996,7 @@ Layer:
bicycle,
tracktype,
'null',
'null',
CASE
WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
Expand All @@ -989,7 +1016,8 @@ 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 1 END
CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 1 END,
CASE WHEN int_difficulty IN ('demanding') THEN 0 ELSE 1 END
) AS bridges
properties:
cache-features: true
Expand Down
18 changes: 18 additions & 0 deletions style/roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2285,10 +2285,12 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
background/line-join: round;
background/line-width: @bridleway-width-z15 + 2 * @paths-background-width;
background/line-opacity: 0.4;
[int_difficulty = 'demanding'] {background/line-opacity: 0.1;}
}
line/line-color: @bridleway-fill;
[access = 'no'] { line/line-color: @bridleway-fill-noaccess; }
line/line-dasharray: 4,2;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-width: @bridleway-width-z13;
[zoom >= 15] { line/line-width: @bridleway-width-z15; }
#tunnels {
Expand All @@ -2308,6 +2310,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
background/line-join: round;
background/line-width: @footway-width-z15 + 2 * @paths-background-width;
background/line-opacity: 0.4;
[int_difficulty = 'demanding'] {background/line-opacity: 0.1;}
[zoom >= 16] {
background/line-width: @footway-width-z16 + 2 * @paths-background-width;
}
Expand All @@ -2321,18 +2324,22 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line/line-color: @footway-fill;
[access = 'no'] { line/line-color: @footway-fill-noaccess; }
line/line-dasharray: 1,3;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
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;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
imagico marked this conversation as resolved.
Show resolved Hide resolved
line/line-width: @footway-width-z15;
[zoom >= 16] {
line/line-dasharray: 3,3.5;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-width: @footway-width-z16;
}
[zoom >= 17] {
line/line-dasharray: 3,3;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
}
[zoom >= 18] {
line/line-width: @footway-width-z18;
Expand All @@ -2345,11 +2352,13 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line/line-color: @footway-fill;
[access = 'no'] { line/line-color: @footway-fill-noaccess; }
line/line-dasharray: 1,3,2,4;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-join: round;
line/line-cap: round;
line/line-width: @footway-width-z15;
[zoom >= 16] {
line/line-dasharray: 1,4,2,3;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-width: @footway-width-z16;
}
[zoom >= 18] {
Expand All @@ -2363,6 +2372,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line/line-color: @footway-fill;
[access = 'no'] { line/line-color: @footway-fill-noaccess; }
line/line-dasharray: 1,4;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-join: round;
line/line-cap: round;
line/line-width: @footway-width-z15;
Expand All @@ -2389,6 +2399,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
background/line-join: round;
background/line-width: @cycleway-width-z15 + 2 * @paths-background-width;
background/line-opacity: 0.4;
[int_difficulty = 'demanding'] {background/line-opacity: 0.1;}
[zoom >= 16] {
background/line-width: @cycleway-width-z16 + 2 * @paths-background-width;
}
Expand All @@ -2402,18 +2413,22 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line/line-color: @cycleway-fill;
[access = 'no'] { line/line-color: @cycleway-fill-noaccess; }
line/line-dasharray: 1,3;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
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;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-width: @cycleway-width-z15;
[zoom >= 16] {
line/line-dasharray: 3,3.5;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-width: @cycleway-width-z16;
}
[zoom >= 17] {
line/line-dasharray: 3,3;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
}
[zoom >= 18] {
line/line-width: @cycleway-width-z18;
Expand All @@ -2426,11 +2441,13 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line/line-color: @cycleway-fill;
[access = 'no'] { line/line-color: @cycleway-fill-noaccess; }
line/line-dasharray: 1,3,2,4;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-join: round;
line/line-cap: round;
line/line-width: @cycleway-width-z15;
[zoom >= 16] {
line/line-dasharray: 1,4,2,3;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-width: @cycleway-width-z16;
}
[zoom >= 18] {
Expand All @@ -2444,6 +2461,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line/line-color: @cycleway-fill;
[access = 'no'] { line/line-color: @cycleway-fill-noaccess; }
line/line-dasharray: 1,4;
[int_difficulty = 'demanding'] {line/line-dasharray: 1,12;}
line/line-join: round;
line/line-cap: round;
line/line-width: @cycleway-width-z15;
Expand Down