Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place area city/town #538

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions placenames.mss
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@
}
}

#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;
#place-medium {
[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;
}
}
}
}

#placenames-medium::city {
[place = 'city'] {
[zoom >= 6][zoom < 15] {
text-name: "[name]";
Expand All @@ -65,9 +65,7 @@
}
}
}
}

#placenames-medium::town {
[place = 'town'] {
[zoom >= 9] {
text-name: "[name]";
Expand Down
29 changes: 3 additions & 26 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1114,41 +1114,18 @@
],
"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",
"table": "(SELECT way,place,name,capital,population\n FROM\n (SELECT \n way,place,name,NULL AS capital,way_area,\n CASE WHEN population~E'^\\d+$' AND length(population)<10 THEN population::integer ELSE NULL END AS population\n FROM planet_osm_polygon\n UNION ALL\n SELECT \n way,place,name,capital,NULL AS way_area,\n CASE WHEN population~E'^\\d+$' AND length(population)<10 THEN population::integer ELSE NULL END AS population \n FROM planet_osm_point) AS p\n WHERE place IN ('city','town')\n ORDER BY \n CASE place WHEN 'city' THEN 0 ELSE 10 END,\n CASE capital WHEN 'yes' THEN 0 ELSE 10 END, \n way_area DESC NULLS LAST, \n population DESC NULLS LAST\n) AS place_medium",
"extent": "-20037508,-19929239,20037508,19929239",
"key_field": "",
"geometry_field": "way",
"dbname": "gis"
},
"id": "placenames-capital",
"id": "place-medium",
"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",
"extent": "-20037508,-19929239,20037508,19929239",
"key_field": "",
"geometry_field": "way",
"dbname": "gis"
},
"id": "placenames-medium",
"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-medium"
"name": "place-medium"
},
{
"geometry": "point",
Expand Down