diff --git a/project.mml b/project.mml index 4c935c2ed6..17812a9b28 100644 --- a/project.mml +++ b/project.mml @@ -1762,12 +1762,12 @@ Layer: osm_id, way, COALESCE( - CASE WHEN highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'track') THEN highway ELSE NULL END, + CASE WHEN highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary') THEN highway ELSE NULL END, CASE WHEN aeroway IN ('runway', 'taxiway') THEN aeroway ELSE NULL END ) AS highway, string_to_array(ref, ';') AS refs FROM planet_osm_line - WHERE (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'track') OR aeroway IN ('runway', 'taxiway')) + WHERE (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary') OR aeroway IN ('runway', 'taxiway')) AND ref IS NOT NULL ) AS p) AS q WHERE height <= 4 AND width <= 11 @@ -1778,9 +1778,6 @@ Layer: WHEN highway = 'primary' THEN 36 WHEN highway = 'secondary' THEN 35 WHEN highway = 'tertiary' THEN 34 - WHEN highway = 'unclassified' THEN 33 - WHEN highway = 'residential' THEN 32 - WHEN highway = 'track' THEN 30 WHEN highway = 'runway' THEN 6 WHEN highway = 'taxiway' THEN 5 ELSE NULL @@ -1933,6 +1930,51 @@ Layer: ) AS railways_text_name properties: minzoom: 11 + - id: roads-text-ref-minor + geometry: linestring + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + highway, + height, + width, + refs + FROM ( + SELECT + osm_id, + way, + highway, + array_length(refs,1) AS height, + (SELECT MAX(char_length(ref)) FROM unnest(refs) AS u(ref)) AS width, + array_to_string(refs, E'\n') AS refs + FROM ( + SELECT + osm_id, + way, + CASE WHEN highway IN ('unclassified', 'residential', 'track') THEN highway ELSE NULL END AS highway, + string_to_array(ref, ';') AS refs + FROM planet_osm_line + WHERE highway IN ('unclassified', 'residential', 'track') + AND ref IS NOT NULL + ) AS p) AS q + WHERE height <= 4 AND width <= 11 + ORDER BY + CASE + WHEN highway = 'unclassified' THEN 33 + WHEN highway = 'residential' THEN 32 + WHEN highway = 'track' THEN 30 + ELSE NULL + END DESC NULLS LAST, + height DESC, + width DESC, + refs, + osm_id + ) AS roads_text_ref_minor + properties: + minzoom: 15 - id: text-poly-low-zoom class: text-low-zoom geometry: polygon diff --git a/roads.mss b/roads.mss index 8b339fcc72..a40d24ed04 100644 --- a/roads.mss +++ b/roads.mss @@ -3040,7 +3040,24 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ } } } + [highway = 'runway'], + [highway = 'taxiway'] { + [zoom >= 15] { + text-name: "[refs]"; + text-size: 10; + text-fill: #333; + text-spacing: 750; + text-clip: false; + text-placement: line; + text-face-name: @oblique-fonts; + text-halo-radius: @standard-halo-radius; + text-halo-fill: @standard-halo-fill; + text-repeat-distance: @minor-highway-text-repeat-distance; + } + } +} +#roads-text-ref-minor { [highway = 'unclassified'], [highway = 'residential'] { [zoom >= 15] { @@ -3050,15 +3067,15 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [zoom >= 16] { text-size: 9; } - [zoom >= 18] { - text-size: 10; + [zoom >= 17] { + text-size: 11; } text-fill: #000; - text-face-name: @book-fonts; + text-face-name: @oblique-fonts; text-placement: line; text-repeat-distance: @major-highway-text-repeat-distance; - text-halo-radius: 2; + text-halo-radius: @standard-halo-radius; text-halo-fill: @standard-halo-fill; text-spacing: 760; text-clip: false; @@ -3082,7 +3099,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ text-clip: false; text-fill: #222; - text-face-name: @book-fonts; + text-face-name: @oblique-fonts; text-halo-radius: @standard-halo-radius; text-halo-fill: @standard-halo-fill; text-margin: 10; @@ -3092,22 +3109,6 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ text-vertical-alignment: middle; } } - - [highway = 'runway'], - [highway = 'taxiway'] { - [zoom >= 15] { - text-name: "[refs]"; - text-size: 10; - text-fill: #333; - text-spacing: 750; - text-clip: false; - text-placement: line; - text-face-name: @book-fonts; - text-halo-radius: @standard-halo-radius; - text-halo-fill: @standard-halo-fill; - text-repeat-distance: @minor-highway-text-repeat-distance; - } - } } #roads-text-name {