From 728032ecf7d1cbca4e564d7dbbe033b9000270f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Ragusa?= Date: Tue, 21 May 2019 22:03:13 +0200 Subject: [PATCH] Unify code of power=tower and power=pole (#3561) * unify code of power=tower and power=pole * invert pole and tower * add ORDER condition * fix ORDER BY --- power.mss | 27 +++++++++++++-------------- project.mml | 26 ++++++++++---------------- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/power.mss b/power.mss index a617c3d977..0b9242a4b2 100644 --- a/power.mss +++ b/power.mss @@ -33,21 +33,20 @@ } #power-towers { - [zoom >= 14] { - marker-file: url('symbols/man_made/power_tower_small.svg'); - marker-width: 3; - } - [zoom >= 15] { - marker-file: url('symbols/man_made/power_tower.svg'); - marker-width: 5; - } - [zoom >= 17] { - marker-width: 7; + [power = 'tower'] { + [zoom >= 14] { + marker-file: url('symbols/man_made/power_tower_small.svg'); + marker-width: 3; + } + [zoom >= 15] { + marker-file: url('symbols/man_made/power_tower.svg'); + marker-width: 5; + } + [zoom >= 17] { + marker-width: 7; + } } -} - -#power-poles { - [zoom >= 16] { + [power = 'pole'][zoom >= 16] { marker-file: url('symbols/square.svg'); marker-fill: #928f8f; marker-width: 3; diff --git a/project.mml b/project.mml index 60261738de..595e9a0e5f 100644 --- a/project.mml +++ b/project.mml @@ -1707,25 +1707,19 @@ Layer: <<: *osm2pgsql table: |- (SELECT - way - FROM planet_osm_point - WHERE power = 'tower' + way, + power + FROM planet_osm_point + WHERE power IN ('tower', 'pole') + ORDER BY + CASE + WHEN power = 'tower' THEN 1 + WHEN power = 'pole' THEN 2 + ELSE NULL + END ) AS power_towers properties: minzoom: 14 - - id: power-poles - geometry: point - <<: *extents - Datasource: - <<: *osm2pgsql - table: |- - (SELECT - way - FROM planet_osm_point - WHERE power = 'pole' - ) AS power_poles - properties: - minzoom: 16 - id: roads-text-ref-low-zoom geometry: linestring <<: *extents