From ecd76754862e24b7b19cf2e62fbbb2099a5d6ff6 Mon Sep 17 00:00:00 2001 From: math1985 Date: Tue, 11 Nov 2014 01:09:22 +0000 Subject: [PATCH] Don't render halo in roads in tunnels This resolves #1089 --- project.mml | 2 +- project.yaml | 5 ++++- roads.mss | 10 ++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/project.mml b/project.mml index e50b356e29..d8c6a6f773 100644 --- a/project.mml +++ b/project.mml @@ -1400,7 +1400,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": " (SELECT way, CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway end, name\n FROM planet_osm_line\n WHERE highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street', 'construction', 'proposed')\n AND name IS NOT NULL\n ) AS roads_text_name", + "table": " (SELECT way,\n CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway END,\n CASE WHEN (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') THEN 'yes' ELSE 'no' END AS tunnel,\n name\n FROM planet_osm_line\n WHERE highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street', 'construction', 'proposed')\n AND name IS NOT NULL\n ) AS roads_text_name", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index c9c0ee586f..0cf2386e2d 100644 --- a/project.yaml +++ b/project.yaml @@ -1329,7 +1329,10 @@ Layer: Datasource: <<: *osm2pgsql table: |2- - (SELECT way, CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway end, name + (SELECT way, + CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway END, + CASE WHEN (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') THEN 'yes' ELSE 'no' END AS tunnel, + name FROM planet_osm_line WHERE highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street', 'construction', 'proposed') AND name IS NOT NULL diff --git a/roads.mss b/roads.mss index 6f23f8ba3c..9cb9d78e4e 100644 --- a/roads.mss +++ b/roads.mss @@ -2126,10 +2126,12 @@ text-clip: false; text-placement: line; text-face-name: @book-fonts; - text-halo-radius: 1; - [highway = 'motorway'] { text-halo-fill: @motorway-fill; } - [highway = 'trunk'] { text-halo-fill: @trunk-fill; } - [highway = 'primary'] { text-halo-fill: @primary-fill; } + [tunnel = 'no'] { + text-halo-radius: 1; + [highway = 'motorway'] { text-halo-fill: @motorway-fill; } + [highway = 'trunk'] { text-halo-fill: @trunk-fill; } + [highway = 'primary'] { text-halo-fill: @primary-fill; } + } } [zoom >= 14] { text-size: 9;