Skip to content

Commit

Permalink
Mini-roundabouts: fixes and trunk road support (#4904)
Browse files Browse the repository at this point in the history
* Fix mini_roundabout/turning_circle fill for tertiary and unclassified

* Fix mini_roundabout/turning_circle casing for primary and secondary

* Add support for mini_roundabout/turning_circle on trunk roads
  • Loading branch information
tpetillon authored Nov 17, 2023
1 parent 73ea404 commit 2f23896
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 27 deletions.
17 changes: 9 additions & 8 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -623,14 +623,15 @@ Layer:
JOIN planet_osm_line l
ON ST_DWithin(p.way, l.way, 0.1) -- Assumes Mercator
JOIN (VALUES
('primary', 1),
('secondary', 2),
('tertiary', 3),
('unclassified', 4),
('residential', 5),
('living_street', 6),
('service', 7),
('track', 8)
('trunk', 1),
('primary', 2),
('secondary', 3),
('tertiary', 4),
('unclassified', 5),
('residential', 6),
('living_street', 7),
('service', 8),
('track', 9)
) AS v (highway, prio)
ON v.highway = l.highway
WHERE p.highway IN (
Expand Down
82 changes: 63 additions & 19 deletions style/roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2780,21 +2780,42 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}

#turning-circle-casing {
[int_tc_type = 'trunk'][zoom >= 15] {
marker-fill: @trunk-casing;
marker-width: @trunk-width-z15 * 1.6 + 2 * @major-casing-width-z15;
marker-height: @trunk-width-z15 * 1.6 + 2 * @major-casing-width-z15;
[zoom >= 17] {
marker-width: @trunk-width-z17 * 1.6 + 2 * @major-casing-width-z17;
marker-height: @trunk-width-z17 * 1.6 + 2 * @major-casing-width-z17;
}
[zoom >= 18] {
marker-width: @trunk-width-z18 * 1.6 + 2 * @major-casing-width-z18;
marker-height: @trunk-width-z18 * 1.6 + 2 * @major-casing-width-z18;
}
[zoom >= 19] {
marker-width: @trunk-width-z19 * 1.6 + 2 * @major-casing-width-z19;
marker-height: @trunk-width-z19 * 1.6 + 2 * @major-casing-width-z19;
}
marker-allow-overlap: true;
marker-ignore-placement: true;
marker-line-width: 0;
}

[int_tc_type = 'primary'][zoom >= 15] {
marker-fill: @primary-casing;
marker-width: @primary-width-z15 * 1.6 + 2 * @casing-width-z15;
marker-height: @primary-width-z15 * 1.6 + 2 * @casing-width-z15;
marker-width: @primary-width-z15 * 1.6 + 2 * @major-casing-width-z15;
marker-height: @primary-width-z15 * 1.6 + 2 * @major-casing-width-z15;
[zoom >= 17] {
marker-width: @primary-width-z17 * 1.6 + 2 * @casing-width-z17;
marker-height: @primary-width-z17 * 1.6 + 2 * @casing-width-z17;
marker-width: @primary-width-z17 * 1.6 + 2 * @major-casing-width-z17;
marker-height: @primary-width-z17 * 1.6 + 2 * @major-casing-width-z17;
}
[zoom >= 18] {
marker-width: @primary-width-z18 * 1.6 + 2 * @casing-width-z18;
marker-height: @primary-width-z18 * 1.6 + 2 * @casing-width-z18;
marker-width: @primary-width-z18 * 1.6 + 2 * @major-casing-width-z18;
marker-height: @primary-width-z18 * 1.6 + 2 * @major-casing-width-z18;
}
[zoom >= 19] {
marker-width: @primary-width-z19 * 1.6 + 2 * @casing-width-z19;
marker-height: @primary-width-z19 * 1.6 + 2 * @casing-width-z19;
marker-width: @primary-width-z19 * 1.6 + 2 * @major-casing-width-z19;
marker-height: @primary-width-z19 * 1.6 + 2 * @major-casing-width-z19;
}
marker-allow-overlap: true;
marker-ignore-placement: true;
Expand All @@ -2803,23 +2824,23 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */

[int_tc_type = 'secondary'][zoom >= 15] {
marker-fill: @secondary-casing;
marker-width: @secondary-width-z15 * 1.6 + 2 * @casing-width-z15;
marker-height: @secondary-width-z15 * 1.6 + 2 * @casing-width-z15;
marker-width: @secondary-width-z15 * 1.6 + 2 * @secondary-casing-width-z15;
marker-height: @secondary-width-z15 * 1.6 + 2 * @secondary-casing-width-z15;
[zoom >= 16] {
marker-width: @secondary-width-z16 * 1.6 + 2 * @casing-width-z16;
marker-height: @secondary-width-z16 * 1.6 + 2 * @casing-width-z16;
marker-width: @secondary-width-z16 * 1.6 + 2 * @secondary-casing-width-z16;
marker-height: @secondary-width-z16 * 1.6 + 2 * @secondary-casing-width-z16;
}
[zoom >= 17] {
marker-width: @secondary-width-z17 * 1.6 + 2 * @casing-width-z17;
marker-height: @secondary-width-z17 * 1.6 + 2 * @casing-width-z17;
marker-width: @secondary-width-z17 * 1.6 + 2 * @secondary-casing-width-z17;
marker-height: @secondary-width-z17 * 1.6 + 2 * @secondary-casing-width-z17;
}
[zoom >= 18] {
marker-width: @secondary-width-z18 * 1.6 + 2 * @casing-width-z18;
marker-height: @secondary-width-z18 * 1.6 + 2 * @casing-width-z18;
marker-width: @secondary-width-z18 * 1.6 + 2 * @secondary-casing-width-z18;
marker-height: @secondary-width-z18 * 1.6 + 2 * @secondary-casing-width-z18;
}
[zoom >= 19] {
marker-width: @secondary-width-z19 * 1.6 + 2 * @casing-width-z19;
marker-height: @secondary-width-z19 * 1.6 + 2 * @casing-width-z19;
marker-width: @secondary-width-z19 * 1.6 + 2 * @secondary-casing-width-z19;
marker-height: @secondary-width-z19 * 1.6 + 2 * @secondary-casing-width-z19;
}
marker-allow-overlap: true;
marker-ignore-placement: true;
Expand Down Expand Up @@ -2946,6 +2967,27 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
}

#turning-circle-fill {
[int_tc_type = 'trunk'][zoom >= 15] {
marker-fill: @trunk-fill;
marker-width: @trunk-width-z15 * 1.6;
marker-height: @trunk-width-z15 * 1.6;
[zoom >= 17] {
marker-width: @trunk-width-z17 * 1.6;
marker-height: @trunk-width-z17 * 1.6;
}
[zoom >= 18] {
marker-width: @trunk-width-z18 * 1.6;
marker-height: @trunk-width-z18 * 1.6;
}
[zoom >= 19] {
marker-width: @trunk-width-z19 * 1.6;
marker-height: @trunk-width-z19 * 1.6;
}
marker-allow-overlap: true;
marker-ignore-placement: true;
marker-line-width: 0;
}

[int_tc_type = 'primary'][zoom >= 15] {
marker-fill: @primary-fill;
marker-width: @primary-width-z15 * 1.6;
Expand Down Expand Up @@ -3131,9 +3173,11 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */
marker-ignore-placement: true;
marker-line-width: 0;

[int_tc_type = 'trunk'] { marker-fill: @trunk-casing; }
[int_tc_type = 'primary'] { marker-fill: @primary-casing; }
[int_tc_type = 'secondary'] { marker-fill: @secondary-casing; }
[int_tc_type = 'tertiary'] { marker-fill: @primary-casing; }
[int_tc_type = 'tertiary'] { marker-fill: @tertiary-casing; }
[int_tc_type = 'unclassified'] { marker-fill: @residential-casing; }
[int_tc_type = 'residential'] { marker-fill: @residential-casing; }
[int_tc_type = 'living_street'] { marker-fill: @living-street-casing; }
[int_tc_type = 'service'] { marker-fill: @service-casing; }
Expand Down

0 comments on commit 2f23896

Please sign in to comment.