Skip to content

Commit

Permalink
Combine the two medium place layers
Browse files Browse the repository at this point in the history
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 gravitystorm#522
  • Loading branch information
pnorman committed May 15, 2014
1 parent a4f8a66 commit 1b788bf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.
28 changes: 15 additions & 13 deletions placenames.mss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down
25 changes: 1 addition & 24 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1b788bf

Please sign in to comment.