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

Adjust width of highway=construction rendering #3580

Merged
merged 3 commits into from
Jan 3, 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
3 changes: 2 additions & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1985,9 +1985,10 @@ Layer:
(SELECT
way,
highway,
construction,
name
FROM planet_osm_line
WHERE highway IN ('bridleway', 'footway', 'cycleway', 'path', 'track', 'steps')
WHERE highway IN ('bridleway', 'footway', 'cycleway', 'path', 'track', 'steps', 'construction')
AND name IS NOT NULL
) AS paths_text_name
properties:
Expand Down
245 changes: 179 additions & 66 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

@unimportant-road: @residential-casing;

@residential-construction: #aaa;
@minor-construction: #aaa;
@service-construction: #aaa;

@destination-marking: #c2e0ff;
Expand Down Expand Up @@ -1149,60 +1149,34 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */

::fill {
/*
* The construction rules for small roads are strange, since if construction is null its assumed that
* it's a more major road. The line-width = 0 could be removed by playing with the query to set a construction
* string for non-small roads.
*
* Also note that these rules are quite sensitive to re-ordering, since the instances end up swapping round
* (and then the dashes appear below the fills). See
* The highway_construction rules below are quite sensitive to re-ordering, since the instances end up swapping round
* (and then the dashes appear below the fills). See:
* https://github.com/gravitystorm/openstreetmap-carto/issues/23
* https://github.com/mapbox/carto/issues/235
* https://github.com/mapbox/carto/issues/237
*/
[feature = 'highway_construction'] {
[zoom >= 12] {
line-width: 2;
line-color: #9cc;

[feature = 'highway_construction'][zoom >= 12] {
[construction = 'motorway'][zoom >= 12],
[construction = 'motorway_link'][zoom >= 13],
[construction = 'trunk'][zoom >= 12],
[construction = 'trunk_link'][zoom >= 13],
[construction = 'primary'][zoom >= 12],
[construction = 'primary_link'][zoom >= 13],
[construction = 'secondary'][zoom >= 12],
[construction = 'secondary_link'][zoom >= 13],
[construction = 'tertiary'][zoom >= 13],
[construction = 'tertiary_link'][zoom >= 14] {
[construction = 'motorway'],
[construction = 'motorway_link'] {
line-color: @motorway-fill;
}
[construction = 'motorway_link'] { line-color: @motorway-fill; }
[construction = 'trunk'],
[construction = 'trunk_link'] {
line-color: @trunk-fill;
}
[construction = 'trunk_link'] { line-color: @trunk-fill; }
[construction = 'primary'],
[construction = 'primary_link'] {
line-color: @primary-fill;
}
[construction = 'primary_link'] { line-color: @primary-fill; }
[construction = 'secondary'],
[construction = 'secondary_link'] {
line-color: @secondary-fill;
}
[construction = 'secondary_link'] { line-color: @secondary-fill; }
[construction = 'tertiary'],
[construction = 'tertiary_link'],
[construction = 'residential'],
[construction = 'unclassified'],
[construction = 'living_street'] {
line-color: @residential-construction;
[zoom < 13] {
line-width: 0;
b/line-width: 0;
}
[zoom >= 13][zoom < 14] {
line-width: 3;
b/line-width: 2;
b/line-dasharray: 5,3;
}
}
[construction = 'service'] {
line-color: @service-construction;
[zoom < 14] {
line-width: 0;
b/line-width: 0;
}
}
[construction = 'tertiary_link'] { line-color: @minor-construction; }
line-width: 2;
b/line-width: 2;
b/line-dasharray: 4,2;
b/line-color: white;
Expand All @@ -1215,24 +1189,156 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
line-width: 8;
b/line-width: 7;
b/line-dasharray: 8,6;
[construction = 'secondary_link'] {
line-width: @secondary-link-width-z15;
b/line-width: @secondary-link-width-z15 - 2 * @casing-width-z15;
}
[construction = 'tertiary_link'] {
line-width: @tertiary-link-width-z15;
b/line-width: @tertiary-link-width-z15 - 2 * @casing-width-z15;
}
}
[construction = 'footway'],
[construction = 'cycleway'],
[construction = 'bridleway'],
[construction = 'path'],
[construction = 'track'],
[construction = 'steps']{
[zoom < 14] {
line-width: 0;
b/line-width: 0;
[zoom >= 17] {
line-width: 8;
b/line-width: 7;
}
}

[construction = null][zoom >= 14],
[construction = 'residential'][zoom >= 14],
[construction = 'unclassified'][zoom >= 14] {
line-color: @minor-construction;
b/line-color: white;
line-width: @residential-width-z14;
b/line-width: @residential-width-z14 - 2 * @casing-width-z13;
b/line-dasharray: 6,4;
[zoom >= 15] {
line-width: @residential-width-z15;
b/line-width: @residential-width-z15 - 2 * @casing-width-z15;
}
line-color: white;
line-width: 3;
line-opacity: 0.4;
b/line-width: 1.2;
b/line-color: #69f;
b/line-dasharray: 2,6;
[zoom >= 16] {
line-width: @residential-width-z16;
b/line-width: @residential-width-z16 - 2 * @casing-width-z16;
b/line-dasharray: 8,6;
}
[zoom >= 17] {
line-width: 8;
b/line-width: 7;
}
}
[construction = 'living_street'][zoom >= 14] {
line-color: @minor-construction;
b/line-color: @living-street-fill;
line-width: @living-street-width-z14;
b/line-width: @living-street-width-z14 - 2 * @casing-width-z13;
b/line-dasharray: 6,4;
[zoom >= 15] {
line-width: @living-street-width-z15;
b/line-width: @living-street-width-z15 - 2 * @casing-width-z15;
}
[zoom >= 16] {
line-width: @living-street-width-z16;
b/line-width: @living-street-width-z16 - 2 * @casing-width-z16;
b/line-dasharray: 8,6;
}
[zoom >= 17] {
line-width: 8;
b/line-width: 7;
}
}
[construction = 'pedestrian'][zoom >= 14] {
line-color: @minor-construction;
b/line-color: @pedestrian-fill;
line-width: @pedestrian-width-z14;
b/line-width: @pedestrian-width-z14 - 2 * @casing-width-z13;
b/line-dasharray: 6,4;
[zoom >= 15] {
line-width: @pedestrian-width-z15;
b/line-width: @pedestrian-width-z15 - 2 * @casing-width-z15;
}
[zoom >= 16] {
line-width: @pedestrian-width-z16;
b/line-width: @pedestrian-width-z16 - 2 * @casing-width-z16;
b/line-dasharray: 8,6;
}
[zoom >= 17] {
line-width: 8;
b/line-width: 7;
}
}

[construction = 'service'] {
[zoom >= 15][service = 'INT-normal'],
[zoom >= 17][service = 'INT-minor'] {
line-color: @minor-construction;
b/line-color: white;
b/line-dasharray: 6,4;
[service = 'INT-normal'] {
line-width: @service-width-z14;
b/line-width: @service-width-z14;
[zoom >= 16] {
line-width: @service-width-z16;
b/line-width: @service-width-z16 - 2 * @casing-width-z16;
b/line-dasharray: 8,6;
}
[zoom >= 17] {
line-width: @service-width-z17;
b/line-width: @service-width-z17 - 2 * @casing-width-z17;
}
[zoom >= 18] {
line-width: 8;
b/line-width: 7
}
}
[service = 'INT-minor'] {
line-width: @minor-service-width-z17;
b/line-width: @minor-service-width-z17 - 2 * @casing-width-z17;
b/line-dasharray: 8,6;
[zoom >= 18] {
line-width: @minor-service-width-z18;
b/line-width: @minor-service-width-z18 - 2 * @casing-width-z18;
}
[zoom >= 19] {
line-width: @minor-service-width-z19 - 2 * @casing-width-z19;
b/line-width: @minor-service-width-z19 - 4 * @casing-width-z19;
}
}
}
}

[construction = 'road'][zoom >= 15],
[construction = 'raceway'][zoom >= 15] {
line-color: @minor-construction;
b/line-color: @road-fill;
line-width: @road-width-z14;
b/line-width: @road-width-z14;
b/line-dasharray: 6,4;
[zoom >= 16] {
line-width: @road-width-z16;
b/line-width: @road-width-z16 - 2 * @casing-width-z16;
b/line-dasharray: 8,6;
}
[zoom >= 17] {
line-width: @road-width-z17;
b/line-width: @road-width-z17 - 2 * @casing-width-z17;
}
[zoom >= 18] {
line-width: 8;
b/line-width: 7;
}
}
[construction = 'footway'][zoom >= 15],
[construction = 'cycleway'][zoom >= 15],
[construction = 'bridleway'][zoom >= 15],
[construction = 'path'][zoom >= 15],
[construction = 'track'][zoom >= 15],
[construction = 'steps'][zoom >= 15] {
line-color: white;
line-width: 3;
line-opacity: 0.4;
b/line-width: 1.2;
b/line-color: @minor-construction;
b/line-dasharray: 2,6;
}
}

Expand Down Expand Up @@ -3046,6 +3152,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
[highway = 'residential'],
[highway = 'unclassified'],
[highway = 'road'],
[highway = 'construction'][construction = null],
[highway = 'construction'][construction = 'residential'],
[highway = 'construction'][construction = 'unclassified'],
[highway = 'construction'][construction = 'road'] {
Expand Down Expand Up @@ -3078,7 +3185,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
[highway = 'raceway'],
[highway = 'service'],
[highway = 'construction'][construction = 'raceway'],
[highway = 'construction'][construction = 'service'] {
[highway = 'construction'][construction = 'service'][zoom >= 17] {
[zoom >= 16] {
text-name: "[name]";
text-size: 9;
Expand All @@ -3099,8 +3206,8 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */

[highway = 'living_street'],
[highway = 'pedestrian'],
[highway = 'construction'][construction = 'living_street'],
[highway = 'construction'][construction = 'pedestrian'] {
[highway = 'construction'][construction = 'living_street'][zoom >= 16],
[highway = 'construction'][construction = 'pedestrian'][zoom >= 16] {
[zoom >= 15] {
text-name: "[name]";
text-size: 8;
Expand Down Expand Up @@ -3142,7 +3249,8 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}

#paths-text-name {
[highway = 'track'] {
[highway = 'track'],
[highway = 'construction'][construction = 'track'][zoom >= 16] {
[zoom >= 15] {
text-name: "[name]";
text-fill: #222;
Expand Down Expand Up @@ -3171,7 +3279,12 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
[highway = 'footway'],
[highway = 'cycleway'],
[highway = 'path'],
[highway = 'steps'] {
[highway = 'steps'],
[highway = 'construction'][construction = 'bridleway'],
[highway = 'construction'][construction = 'footway'],
[highway = 'construction'][construction = 'cycleway'],
[highway = 'construction'][construction = 'path'],
[highway = 'construction'][construction = 'steps'] {
[zoom >= 16] {
text-name: "[name]";
text-fill: #222;
Expand Down