diff --git a/placenames.mss b/placenames.mss index 5a7d913fdb..27ae09cb0f 100644 --- a/placenames.mss +++ b/placenames.mss @@ -56,17 +56,18 @@ [zoom >= 4][zoom < 8][population > 600000], [zoom >= 5][zoom < 8] { shield-file: url('symbols/place/place-capital-6.svg'); + shield-text-dx: 6; shield-text-dy: 6; shield-name: '[name]'; shield-face-name: @book-fonts; shield-fill: @placenames; shield-size: 11; - shield-min-distance: 10; + shield-min-distance: 5; shield-wrap-width: 30; shield-halo-fill: @standard-halo-fill; shield-halo-radius: @standard-halo-radius * 1.5; shield-placement-type: simple; - shield-placements: 'S,N'; + shield-placements: 'S,N,E,W'; shield-unlock-image: true; [zoom >= 5] { @@ -78,6 +79,7 @@ } [zoom >= 7] { shield-file: url('symbols/place/place-capital-8.svg'); + shield-text-dx: 7; shield-text-dy: 7; } } @@ -102,17 +104,18 @@ [category = 1][zoom < 14][score >= 400000] { [zoom >= 5][zoom < 8] { shield-file: url('symbols/place/place-4.svg'); + shield-text-dx: 4; shield-text-dy: 4; shield-name: '[name]'; shield-face-name: @book-fonts; shield-fill: @placenames; shield-size: 11; - shield-min-distance: 10; + shield-min-distance: 5; shield-wrap-width: 30; shield-halo-fill: @standard-halo-fill; shield-halo-radius: @standard-halo-radius * 1.5; shield-placement-type: simple; - shield-placements: 'S,N'; + shield-placements: 'S,N,E,W'; shield-unlock-image: true; [zoom >= 5] { @@ -123,6 +126,7 @@ shield-wrap-width: 60; shield-file: url('symbols/place/place-6.svg'); + shield-text-dx: 5; shield-text-dy: 5; } } @@ -149,6 +153,7 @@ [zoom >= 6][zoom < 8][score >= 70000], [zoom >= 7][zoom < 8] { shield-file: url('symbols/place/place-4.svg'); + shield-text-dx: 4; shield-text-dy: 4; shield-name: "[name]"; shield-size: 10; @@ -157,9 +162,9 @@ shield-halo-fill: @standard-halo-fill; shield-halo-radius: @standard-halo-radius * 1.5; shield-wrap-width: 30; - shield-min-distance: 10; + shield-min-distance: 5; shield-placement-type: simple; - shield-placements: 'S,N'; + shield-placements: 'S,N,E,W'; shield-unlock-image: true; } [zoom >= 7] { diff --git a/project.mml b/project.mml index 52f7b9a5f0..63032d538f 100644 --- a/project.mml +++ b/project.mml @@ -1291,7 +1291,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 name,\n CASE\n WHEN population ~ '^-?\\d+(\\.\\d+)?$' THEN population::NUMERIC ELSE 0\n END as population\n FROM planet_osm_point\n WHERE capital = 'yes'\n AND (admin_level = '2' OR admin_level IS NULL)\n ORDER BY population DESC\n) AS capital_names", + "table": "(SELECT\n way,\n name,\n CASE\n WHEN (population ~ '^[0-9]{1,8}$') THEN population::INTEGER ELSE 0\n END as population\n FROM planet_osm_point\n WHERE capital = 'yes'\n AND admin_level = '2'\n ORDER BY population DESC\n) AS capital_names", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -1344,7 +1344,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 name,\n score,\n CASE\n WHEN (place = 'city') THEN 1\n ELSE 2\n END as category\n FROM \n (SELECT\n way,\n place,\n name,\n (\n (CASE\n WHEN (population ~ '^[0-9]{1,8}$') THEN population::INTEGER\n WHEN (place = 'city') THEN 100000\n WHEN (place = 'town') THEN 1000\n ELSE 1\n END)\n *\n (CASE\n WHEN (capital = '4' OR (capital = 'yes' AND admin_level = '4')) THEN 2\n ELSE 1\n END)\n ) AS score\n FROM planet_osm_point\n WHERE place IN ('city', 'town')\n AND name IS NOT NULL\n AND capital IS NULL OR capital = '4' OR (capital = 'yes' AND admin_level = '4')\n ) as p\n ORDER BY score DESC, length(name) DESC, name\n) AS placenames_medium", + "table": "(SELECT\n way,\n name,\n score,\n CASE\n WHEN (place = 'city') THEN 1\n ELSE 2\n END as category\n FROM \n (SELECT\n way,\n place,\n name,\n (\n (CASE\n WHEN (population ~ '^[0-9]{1,8}$') THEN population::INTEGER\n WHEN (place = 'city') THEN 100000\n WHEN (place = 'town') THEN 1000\n ELSE 1\n END)\n *\n (CASE\n WHEN (capital = '4' OR (capital = 'yes' AND admin_level = '4')) THEN 2\n ELSE 1\n END)\n ) AS score\n FROM planet_osm_point\n WHERE place IN ('city', 'town')\n AND name IS NOT NULL\n AND capital IS NULL OR capital != '2' OR (capital = 'yes' AND admin_level != '2')\n ) as p\n ORDER BY score DESC, length(name) DESC, name\n) AS placenames_medium", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index 144d24e02c..8051d272f1 100644 --- a/project.yaml +++ b/project.yaml @@ -1523,11 +1523,11 @@ Layer: way, name, CASE - WHEN population ~ '^-?\d+(\.\d+)?$' THEN population::NUMERIC ELSE 0 + WHEN (population ~ '^[0-9]{1,8}$') THEN population::INTEGER ELSE 0 END as population FROM planet_osm_point WHERE capital = 'yes' - AND (admin_level = '2' OR admin_level IS NULL) + AND admin_level = '2' ORDER BY population DESC ) AS capital_names properties: @@ -1594,7 +1594,7 @@ Layer: FROM planet_osm_point WHERE place IN ('city', 'town') AND name IS NOT NULL - AND capital IS NULL OR capital = '4' OR (capital = 'yes' AND admin_level = '4') + AND capital IS NULL OR capital != '2' OR (capital = 'yes' AND admin_level != '2') ) as p ORDER BY score DESC, length(name) DESC, name ) AS placenames_medium