Skip to content

Commit

Permalink
bigger text size, no capitals at z3, fewer capitals on z4, be more st…
Browse files Browse the repository at this point in the history
…rict with capitals, no dots at z8, N,S,E,W placement, correction of query
  • Loading branch information
nebulon42 committed Sep 2, 2016
1 parent 743162c commit 3747894
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
17 changes: 11 additions & 6 deletions placenames.mss
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand All @@ -78,6 +79,7 @@
}
[zoom >= 7] {
shield-file: url('symbols/place/place-capital-8.svg');
shield-text-dx: 7;
shield-text-dy: 7;
}
}
Expand All @@ -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] {
Expand All @@ -123,6 +126,7 @@
shield-wrap-width: 60;

shield-file: url('symbols/place/place-6.svg');
shield-text-dx: 5;
shield-text-dy: 5;
}
}
Expand All @@ -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;
Expand All @@ -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] {
Expand Down
4 changes: 2 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down
6 changes: 3 additions & 3 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3747894

Please sign in to comment.