Skip to content

Commit

Permalink
Don't render halo in roads in tunnels
Browse files Browse the repository at this point in the history
This resolves gravitystorm#1089
  • Loading branch information
matthijsmelissen committed Nov 11, 2014
1 parent 739298d commit ecd7675
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
5 changes: 4 additions & 1 deletion project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ecd7675

Please sign in to comment.