Skip to content

Commit

Permalink
Render administrative boundary text labels for relations only (#3762)
Browse files Browse the repository at this point in the history
* Render text labels along borders of admin boundary relations only

Currently lines are only rendered for borders mapped as relations (i.e. osm_id <0) but the text labels along the borders are rendered for relations and closed ways. This commit adds a filter for "AND osm_id < 0" to the admin-text layer, so that the text labels do not appear in the rare occasions when an administrative boundary is mapped as a closed way instead of a relation

* Render central name labels for country and province/state relations only
  • Loading branch information
jeisenbe authored and imagico committed Jun 11, 2019
1 parent f706dcf commit 96c64fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,7 @@ Layer:
AND admin_level = '2'
AND name IS NOT NULL
AND way_area > 100*!pixel_width!::real*!pixel_height!::real
AND osm_id < 0
ORDER BY way_area DESC
) AS country_names
properties:
Expand Down Expand Up @@ -1234,6 +1235,7 @@ Layer:
AND admin_level = '4'
AND name IS NOT NULL
AND way_area > 100*!pixel_width!::real*!pixel_height!::real
AND osm_id < 0
ORDER BY way_area DESC
) AS state_names
properties:
Expand Down Expand Up @@ -2100,6 +2102,7 @@ Layer:
WHERE boundary = 'administrative'
AND admin_level IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10')
AND name IS NOT NULL
AND osm_id < 0
ORDER BY admin_level::integer ASC, way_area DESC
) AS admin_text
properties:
Expand Down

0 comments on commit 96c64fa

Please sign in to comment.