Skip to content

Commit

Permalink
Render maritime admin boundaries less prominently
Browse files Browse the repository at this point in the history
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes #621
* This possibly impacts solutions to #723, #2234m and #2663.
  • Loading branch information
math1985 committed Nov 20, 2017
1 parent d742f4a commit ab68fdd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
22 changes: 22 additions & 0 deletions admin.mss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@admin-boundaries: #ac46ac;
@admin-boundaries-maritime: darken(@water-color,15%);

/* For performance reasons, the admin border layers are split into three groups
for low, middle and high zoom levels.
Expand All @@ -16,6 +17,9 @@ overlapping borders correctly.
background/line-width: 1.2;
line-join: bevel;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 1.2;
}
[zoom >= 5] {
Expand Down Expand Up @@ -43,6 +47,9 @@ overlapping borders correctly.
background/line-width: 0.6;
line-join: bevel;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 0.6;
}
[zoom >= 7] {
Expand All @@ -63,6 +70,9 @@ overlapping borders correctly.
background/line-color: white;
background/line-width: 0.4;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-join: bevel;
line-width: 0.4;
line-clip: false;
Expand Down Expand Up @@ -116,6 +126,9 @@ overlapping borders correctly.
background/line-width: 2;
line-join: bevel;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 2;
line-dasharray: 6,3,2,3,2,3;
line-clip: false;
Expand All @@ -126,6 +139,9 @@ overlapping borders correctly.
background/line-width: 2;
line-join: bevel;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 2;
line-dasharray: 6,3,2,3;
line-clip: false;
Expand All @@ -138,6 +154,9 @@ overlapping borders correctly.
background/line-width: 1.5;
line-join: bevel;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 1.5;
line-dasharray: 5,2;
line-clip: false;
Expand All @@ -156,6 +175,9 @@ overlapping borders correctly.
background/line-width: 2;
line-join: bevel;
line-color: @admin-boundaries;
[maritime = 'yes'] {
line-color: @admin-boundaries-maritime;
}
line-width: 2;
line-dasharray: 2,3;
line-clip: false;
Expand Down
15 changes: 9 additions & 6 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1093,11 +1093,12 @@ Layer:
table: |-
(SELECT
way,
admin_level
admin_level,
tags->'maritime' as maritime
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4')
AND osm_id < 0
AND osm_id > 0
ORDER BY admin_level DESC
) AS admin_low_zoom
properties:
Expand All @@ -1111,11 +1112,12 @@ Layer:
table: |-
(SELECT
way,
admin_level
admin_level,
boundary
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8')
AND osm_id < 0
AND osm_id > 0
ORDER BY admin_level DESC
) AS admin_mid_zoom
properties:
Expand All @@ -1129,11 +1131,12 @@ Layer:
table: |-
(SELECT
way,
admin_level
admin_level,
boundary
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
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

0 comments on commit ab68fdd

Please sign in to comment.