From 1b788bfe68247a1669e51e9770805c6482042d2c Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Wed, 14 May 2014 21:54:00 -0700 Subject: [PATCH] Combine the two medium place layers Previously we had one place layer for capitals and one for non-capitals when it came to towns and cities. This combines them, reducing the number of queries, making the SQL simpler, and making the layers more useful for other styles. Incidentially fixes #522 --- placenames.mss | 28 +++++++++++++++------------- project.mml | 25 +------------------------ 2 files changed, 16 insertions(+), 37 deletions(-) diff --git a/placenames.mss b/placenames.mss index d98f2b96c3..c6940680e3 100644 --- a/placenames.mss +++ b/placenames.mss @@ -31,19 +31,21 @@ } } -#placenames-capital { - [zoom >= 5][zoom < 15] { - text-name: "[name]"; - text-size: 10; - text-fill: @placenames; - text-face-name: @book-fonts; - text-halo-radius: 1.5; - text-min-distance: 10; - [zoom >= 6] { - text-size: 12; - } - [zoom >= 11] { - text-size: 15; +#placenames-medium::capital { + [capital = 'yes'] { + [zoom >= 5][zoom < 15] { + text-name: "[name]"; + text-size: 10; + text-fill: @placenames; + text-face-name: @book-fonts; + text-halo-radius: 1.5; + text-min-distance: 10; + [zoom >= 6] { + text-size: 12; + } + [zoom >= 11] { + text-size: 15; + } } } } diff --git a/project.mml b/project.mml index 7082f69d30..ec222cbae5 100644 --- a/project.mml +++ b/project.mml @@ -1114,30 +1114,7 @@ ], "Datasource": { "type": "postgis", - "table": "(select way,place,name,ref\n from planet_osm_point\n where place in ('city','town') and capital='yes'\n ) as placenames_capital", - "extent": "-20037508,-19929239,20037508,19929239", - "key_field": "", - "geometry_field": "way", - "dbname": "gis" - }, - "id": "placenames-capital", - "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": "placenames-capital" - }, - { - "geometry": "point", - "extent": [ - -179.99999692067183, - -84.96651228427099, - 179.99999692067183, - 84.96651228427098 - ], - "Datasource": { - "type": "postgis", - "table": "(select way,place,name\n from planet_osm_point\n where place in ('city','town')\n and (capital is null or capital != 'yes')\n ) as placenames_medium", + "table": "(SELECT way,place,capital,name\n FROM planet_osm_point\n WHERE place IN ('city','town')) AS placenames_medium", "extent": "-20037508,-19929239,20037508,19929239", "key_field": "", "geometry_field": "way",