Permalink
Browse files

Separate water line text into its own layer.

Fixes longstanding issues of river names appearing below admin
boundaries, bridges etc.

Also fixes #106
  • Loading branch information...
gravitystorm committed Aug 27, 2013
1 parent 4c097c5 commit 4d691acbbe0d4f927b9787df43fd118fdac157a2
Showing with 95 additions and 50 deletions.
  1. +23 −0 project.mml
  2. +72 −50 water.mss
@@ -2089,6 +2089,29 @@
"advanced": {},
"name": "housenames"
},
{
"geometry": "linestring",
"extent": [
-179.99999692067183,
-84.96651228427099,
179.99999692067183,
84.96651228427098
],
"Datasource": {
"type": "postgis",
"table": " (select way,waterway,disused,lock,name,\n case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel\n from planet_osm_line\n where waterway in ('weir','river','canal','derelict_canal','stream','drain','ditch','wadi')\n order by z_order\n ) as water_lines",
"extent": "-20037508,-19929239,20037508,19929239",
"key_field": "",
"geometry_field": "way",
"dbname": "gis"
},
"id": "water-lines-text",
"class": "",
"srs-name": "900913",
"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",
"advanced": {},
"name": "water-lines-text"
},
{
"extent": [
-179.99999692067183,
122 water.mss
@@ -111,17 +111,9 @@
line-join: round;
[zoom >= 13] {
line-width: 3;
text-name: "[name]";
text-face-name: @book-fonts;
text-placement: line;
text-fill: #6699cc;
text-spacing: 400;
text-size: 9;
text-halo-radius: 1;
}
[zoom >= 14] {
line-width: 5;
text-size: 10;
}
[zoom >= 15] {
line-width: 6;
@@ -139,7 +131,6 @@
a/line-color: @water-color;
b/line-width: 4;
b/line-color: white;
text-min-distance: 200;
}
[zoom >= 15] {
a/line-width: 7;
@@ -162,12 +153,6 @@
line-join: round;
[zoom >= 13] {
line-width: 4;
text-name: "[name]";
text-face-name: @book-fonts;
text-halo-radius: 1;
text-size: 8;
text-placement: line;
text-fill: #6699cc;
}
}

@@ -183,13 +168,6 @@
[waterway = 'stream'][zoom >= 15] {
line-width: 2;
line-color: @water-color;
text-name: "[name]";
text-size: 8;
text-face-name: @book-fonts;
text-fill: #6699cc;
text-halo-radius: 1;
text-spacing: 600;
text-placement: line;
[tunnel = 'yes'] {
line-dasharray: 4,2;
line-width: 2.4;
@@ -203,13 +181,6 @@
[zoom >= 15] {
line-width: 1;
line-color: @water-color;
text-name: "[name]";
text-face-name: @book-fonts;
text-size: 8;
text-fill: #6699cc;
text-spacing: 600;
text-placement: line;
text-halo-radius: 1;
[tunnel = 'yes'] {
line-width: 2;
line-dasharray: 4,2;
@@ -224,23 +195,13 @@
line-color: @water-color;
line-join: round;
line-cap: round;
text-name: "[name]";
text-size: 9;
text-fill: #6699cc;
text-placement: line;
text-face-name: @book-fonts;
text-halo-radius: 1;
[zoom >= 17] { line-width: 11; }
[tunnel = 'yes'] {
line-dasharray: 4,2;
b/line-width: 3;
b/line-color: white;
[zoom >= 17] { line-width: 7; }
}
[lock = 'yes'][zoom >= 17] {
text-placement: point;
text-wrap-width: 20;
}
}

[waterway = 'derelict_canal'],
@@ -256,18 +217,10 @@
[zoom >= 13] {
line-width: 2.5;
line-dasharray: 4,6;
text-name: "[name]";
text-size: 9;
text-fill: #80d1ae;
text-face-name: @book-fonts;
text-placement: line;
text-spacing: 600;
text-halo-radius: 1;
}
[zoom >= 14] {
line-width: 4.5;
line-dasharray: 4,8;
text-size: 10;
}
}
}
@@ -281,15 +234,84 @@
b/line-color: @water-color;
b/line-cap: round;
b/line-join: round;
[zoom >= 17] {
line-width: 11;
b/line-width: 10;
}
}
}

#water-lines-text {
[waterway = 'river'][zoom >= 13] {
text-name: "[name]";
text-face-name: @book-fonts;
text-placement: line;
text-fill: #6699cc;
text-spacing: 400;
text-size: 9;
text-halo-radius: 1;
[zoom >= 14] { text-size: 10; }
[tunnel = 'yes'] { text-min-distance: 200; }
}

[waterway = 'canal'][zoom >= 13][zoom < 14] {
text-name: "[name]";
text-face-name: @book-fonts;
text-halo-radius: 1;
text-size: 8;
text-placement: line;
text-fill: #6699cc;
}

[waterway = 'stream'][zoom >= 15] {
text-name: "[name]";
text-size: 8;
text-face-name: @book-fonts;
text-fill: #6699cc;
text-halo-radius: 1;
text-spacing: 600;
text-placement: line;
}

[waterway = 'drain'],
[waterway = 'ditch'] {
[zoom >= 15] {
text-name: "[name]";
text-face-name: @book-fonts;
text-size: 8;
text-fill: #6699cc;
text-spacing: 600;
text-placement: line;
text-halo-radius: 1;
}
}

[waterway = 'canal'][zoom >= 14] {
text-name: "[name]";
text-size: 9;
text-fill: #6699cc;
text-placement: line;
text-face-name: @book-fonts;
text-halo-radius: 1;
[zoom >= 17] {
line-width: 11;
b/line-width: 10;
[lock = 'yes'][zoom >= 17] {
text-placement: point;
text-wrap-width: 20;
}
}

[waterway = 'derelict_canal'],
[waterway = 'canal'][disused = 'yes'] {
[zoom >= 13] {
text-name: "[name]";
text-size: 9;
text-fill: #80d1ae;
text-face-name: @book-fonts;
text-placement: line;
text-spacing: 600;
text-halo-radius: 1;
}
[zoom >= 14] {
text-size: 10;
}
}
}

0 comments on commit 4d691ac

Please sign in to comment.