Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework admin boundaries (without z4 logic) #1989

Merged
merged 1 commit into from
Feb 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 65 additions & 16 deletions admin.mss
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,86 @@ overlapping borders correctly.
#admin-low-zoom[zoom < 11],
#admin-mid-zoom[zoom >= 11][zoom < 13],
#admin-high-zoom[zoom >= 13] {
[admin_level = '2'],
[admin_level = '3'] {
[admin_level = '2'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 0.6;
background/line-width: 1.2;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 0.6;
line-width: 1.2;
}
[zoom >= 5] {
background/line-width: 1.5;
line-width: 1.5;
}
[zoom >= 6] {
background/line-width: 1.8;
line-width: 1.8;
}
[zoom >= 7] {
background/line-width: 2;
line-width: 2;
}
[zoom >= 10] {
[admin_level = '2'] {
background/line-width: 6;
line-width: 6;
}
[admin_level = '3'] {
background/line-width: 5;
line-width: 5;
line-dasharray: 4,2;
line-clip: false;
}
background/line-width: 6;
line-width: 6;
}
}
[admin_level = '4'] {

[admin_level = '3'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 0.6;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 0.6;
}
[zoom >= 7] {
background/line-width: 1.2;
line-width: 1.2;
}
[zoom >= 10] {
background/line-width: 4;
line-width: 4;
line-dasharray: 4,2;
line-clip: false;
}
}

[admin_level = '4'] {
[zoom >= 4] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 0.4;
line-color: @admin-boundaries;
line-join: bevel;
line-width: 0.4;
line-dasharray: 4,3;
line-clip: false;
}
[zoom >= 5] {
background/line-width: 0.6;
line-width: 0.6;
}
[zoom >= 6] {
background/line-width: 0.8;
line-width: 0.8;
}
[zoom >= 7] {
background/line-width: 1;
line-width: 1;
}
[zoom >= 11] {
[zoom >= 9] {
background/line-width: 1.8;
line-width: 1.8;
}
[zoom >= 10] {
background/line-width: 2.5;
line-width: 2.5;
}
[zoom >= 12] {
background/line-width: 3;
line-width: 3;
}
Expand All @@ -70,16 +111,20 @@ overlapping borders correctly.
#admin-mid-zoom[zoom >= 11][zoom < 13],
#admin-high-zoom[zoom >= 13] {
[admin_level = '5'][zoom >= 11] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 2;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
line-dasharray: 6,3,2,3,2,3;
line-clip: false;
}
[admin_level = '6'][zoom >= 11] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 2;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
line-dasharray: 6,3,2,3;
Expand All @@ -88,8 +133,10 @@ overlapping borders correctly.
[admin_level = '7'],
[admin_level = '8'] {
[zoom >= 12] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 1.5;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 1.5;
line-dasharray: 5,2;
Expand All @@ -104,8 +151,10 @@ overlapping borders correctly.
[admin_level = '9'],
[admin_level = '10'] {
[zoom >= 13] {
background/line-join: bevel;
background/line-color: white;
background/line-width: 2;
line-join: bevel;
line-color: @admin-boundaries;
line-width: 2;
line-dasharray: 2,3;
Expand Down
41 changes: 31 additions & 10 deletions placenames.mss
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
@placenames: #222;
@placenames-light: #777777;
@country-labels: darken(@admin-boundaries, 15%);
@state-labels: desaturate(darken(@admin-boundaries, 5%), 20%);

.country {
[admin_level = '2'][zoom >= 2][way_pixels > 3000][way_pixels < 196000] {
[admin_level = '2'][zoom >= 3][way_pixels > 1000][way_pixels < 360000] {
text-name: "[name]";
text-size: 9;
text-fill: #9d6c9d;

[zoom >= 3] {
text-size: 10;
}
[zoom >= 4] {
text-size: 11;
}
[zoom >= 5] {
text-size: 12;
}
[zoom >= 7] {
text-size: 13;
}
[zoom >= 10] {
text-size: 14;
}

text-fill: @country-labels;
text-face-name: @book-fonts;
text-halo-fill: rgba(255,255,255,0.6);
text-halo-radius: 1.5;
text-wrap-width: 50;
text-wrap-width: 35;
text-placement: interior;
[zoom >= 4] {
text-size: 10;
}
text-character-spacing: 0.5;
text-min-distance: 3;
text-line-spacing: 1;
}
}

Expand All @@ -22,26 +42,27 @@
[zoom >= 5][way_pixels > 3000][way_pixels < 196000] {
text-name: "[ref]";
text-size: 9;
text-fill: #9d6c9d;
text-fill: @state-labels;
text-face-name: @oblique-fonts;
text-halo-fill: rgba(255,255,255,0.6);
text-halo-radius: 1.5;
text-wrap-width: 0;
text-placement: interior;
text-min-distance: 3;
[zoom >= 5] {
text-name: "[name]";
text-wrap-width: 50;
text-wrap-width: 30;
}
[zoom >= 7] {
text-size: 11;
text-wrap-width: 70;
text-wrap-width: 50;
}
}
}
}

#placenames-medium::high-importance {
[category = 1][zoom < 14] {
[zoom >= 3][score >= 5000000],
[zoom >= 4][score >= 3000000],
[zoom >= 5][score >= 400000] {
text-name: "[name]";
Expand Down
6 changes: 3 additions & 3 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,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\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4')\n ORDER BY admin_level DESC\n) AS admin_low_zoom",
"table": "(SELECT\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4')\n AND osm_id < 0\n ORDER BY admin_level DESC\n) AS admin_low_zoom",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand All @@ -1083,7 +1083,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\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8')\n ORDER BY admin_level DESC\n) AS admin_mid_zoom",
"table": "(SELECT\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8')\n AND osm_id < 0\n ORDER BY admin_level DESC\n) AS admin_mid_zoom",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand All @@ -1110,7 +1110,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\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')\n ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering\n) AS admin_high_zoom",
"table": "(SELECT\n way,\n admin_level\n FROM planet_osm_roads\n WHERE boundary = 'administrative'\n AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')\n AND osm_id < 0\n ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering\n) AS admin_high_zoom",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand Down
3 changes: 3 additions & 0 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,7 @@ Layer:
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4')
AND osm_id < 0
ORDER BY admin_level DESC
) AS admin_low_zoom
properties:
Expand All @@ -1344,6 +1345,7 @@ Layer:
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8')
AND osm_id < 0
ORDER BY admin_level DESC
) AS admin_mid_zoom
properties:
Expand All @@ -1364,6 +1366,7 @@ Layer:
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')
AND osm_id < 0
ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering
) AS admin_high_zoom
properties:
Expand Down
8 changes: 7 additions & 1 deletion shapefiles.mss
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#necountries {
[zoom >= 1][zoom < 4] {
line-width: 0.5;
line-width: 0.2;
[zoom >= 2] {
line-width: 0.3;
}
[zoom >= 3] {
line-width: 0.4;
}
line-color: @admin-boundaries;
}
}
Expand Down