diff --git a/buildings.mss b/buildings.mss index 9e988c4efd..e230e7244f 100644 --- a/buildings.mss +++ b/buildings.mss @@ -1,52 +1,37 @@ -#buildings-lz { - [zoom >= 10] { - [railway = 'station']::railway, - [building = 'station'] { - polygon-fill: #d4aaaa; - polygon-clip: false; - } +@building-fill: #bbae92; +@building-line: darken(@building-fill, 22%); - [building = 'supermarket'] { - polygon-fill: pink; - polygon-opacity: 0.5; - polygon-clip: false; - } +@building-aeroway-fill: #cc99ff; +@building-aeroway-line: darken(@building-aeroway-fill,15%); - [amenity = 'place_of_worship']::amenity { - polygon-opacity: 0.5; - polygon-fill: #777; - polygon-clip: false; - [zoom >= 15] { - polygon-opacity: 0.9; - polygon-fill: #aaa; - line-width: 0.3; - line-color: #111; - } - } + +#buildings-major { + opacity: 0.4; + [zoom >= 10][zoom < 12] { + polygon-fill: @building-fill; + polygon-clip: false; } } #buildings { - [building = 'INT-light'][zoom >= 12] { - polygon-fill: #bca9a9; - polygon-opacity: 0.7; + opacity: 0.4; + [zoom >= 12] { + /* Set the base styling for buildings. We'll need to reset the fill and + line colours for more specialized building rendering lower down, but + not the clipping or line-width. + */ + polygon-fill: @building-fill; polygon-clip: false; - } - [building != 'INT-light'][building != ''][zoom >= 12] { - polygon-fill: #bca9a9; - polygon-opacity: 0.9; - polygon-clip: false; - [zoom >= 16] { - line-color: #330066; - line-width: 0.2; + [zoom >= 15] { + line-color: @building-line; + line-width: .75; + line-clip: false; } - } - [aeroway = 'terminal'][zoom >= 12]::aeroway { - polygon-fill: #cc99ff; - polygon-clip: false; - [zoom >= 14] { - line-color: #330066; - line-width: 0.2; + [aeroway = 'terminal'] { + polygon-fill: @building-aeroway-fill; + [zoom >= 15] { + line-color: @building-aeroway-line; + } } } } diff --git a/landcover.mss b/landcover.mss index 54e4d47a09..fdf7ea804b 100644 --- a/landcover.mss +++ b/landcover.mss @@ -34,6 +34,8 @@ @farmyard: #ddbf92; @farm: #ead8bd; // also farmland @parking: #f7efb7; +@place_of_worship: #cdccc9; +@place_of_worship_outline: #111; @playground: #ccfff1; @power: #bbb; @rest_area: #efc8c8; // also services @@ -41,6 +43,7 @@ @residential: #ddd; @sand: #ffdf88; @school: #f0f0d8; // also university, college, hospital, kindergarten +@station: #d4aaaa; #landcover { [feature = 'leisure_swimming_pool'][zoom >= 14] { @@ -102,6 +105,16 @@ } } + [feature = 'amenity_place_of_worship'] { + polygon-fill: @place_of_worship; + polygon-clip: false; + [zoom >= 15] { + line-color: @place_of_worship_outline; + line-width: 0.3; + line-clip: false; + } + } + [feature = 'landuse_residential'][zoom >= 10] { polygon-fill: @residential; } @@ -332,6 +345,12 @@ polygon-fill: @rest_area; } } + + [feature = 'railway_station'] { + [zoom >= 10] { + polygon-fill: @station; + } + } } /* man_made=cutline */ diff --git a/project.mml b/project.mml old mode 100644 new mode 100755 index 26e381d7bc..c1680a436b --- a/project.mml +++ b/project.mml @@ -121,7 +121,7 @@ ], "Datasource": { "type": "postgis", - "table": "(select way, religion,\ncoalesce (aeroway, amenity, landuse, leisure, military, \"natural\", power, tourism, highway) as feature from (\nselect way,\n('aeroway_' || (case when aeroway in ('apron', 'aerodrome') then aeroway else null end)) as aeroway,\n('amenity_' || (case when amenity in ('parking', 'university', 'college', 'school', 'hospital', 'kindergarten', 'grave_yard') then amenity else null end)) as amenity,\n('landuse_' || (case when landuse in ('quarry', 'vineyard', 'orchard', 'cemetery', 'grave_yard', 'residential', 'garages', 'field', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'recreation_ground', 'conservation', 'village_green', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'greenfield', 'construction') then landuse else null end)) as landuse,\n('leisure_' || (case when leisure in ('swimming_pool', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'golf_course', 'picnic_table') then leisure else null end)) as leisure,\n('military_' || (case when military in ('barracks', 'danger_area') then military else null end)) as military,\n('natural_' || (case when \"natural\" in ('field','beach','desert','heath','mud','grassland','wood','sand','scrub') then \"natural\" else null end)) as \"natural\",\n('power_' || (case when power in ('station','sub_station','substation','generator') then power else null end)) as power,\n('tourism_' || (case when tourism in ('attraction', 'camp_site', 'caravan_site', 'picnic_site', 'zoo') then tourism else null end)) as tourism,\n('highway_' || (case when highway in ('services', 'rest_area') then highway else null end)) as highway,\ncase when religion in ('christian','jewish') then religion else 'INT-generic'::text end as religion\n from planet_osm_polygon\n where landuse is not null\n or leisure is not null\n or aeroway in ('apron','aerodrome')\n or amenity in ('parking','university','college','school','hospital','kindergarten','grave_yard')\n or military in ('barracks','danger_area')\n or \"natural\" in ('field','beach','desert','heath','mud','grassland','wood','sand','scrub')\n or power in ('station','sub_station','generator')\n or tourism in ('attraction','camp_site','caravan_site','picnic_site','zoo')\n or highway in ('services','rest_area')\n order by z_order,way_area desc\n ) as landcover\n) as features", + "table": "(select way, religion,\ncoalesce (aeroway, amenity, landuse, leisure, military, \"natural\", power, tourism, highway, railway) as feature from (\nselect way,\n('aeroway_' || (case when aeroway in ('apron', 'aerodrome') then aeroway else null end)) as aeroway,\n('amenity_' || (case when amenity in ('parking', 'university', 'college', 'school', 'hospital', 'kindergarten', 'grave_yard') then amenity else null end)) as amenity,\n('landuse_' || (case when landuse in ('quarry', 'vineyard', 'orchard', 'cemetery', 'grave_yard', 'residential', 'garages', 'field', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'recreation_ground', 'conservation', 'village_green', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'greenfield', 'construction') then landuse else null end)) as landuse,\n('leisure_' || (case when leisure in ('swimming_pool', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'golf_course', 'picnic_table') then leisure else null end)) as leisure,\n('military_' || (case when military in ('barracks', 'danger_area') then military else null end)) as military,\n('natural_' || (case when \"natural\" in ('field','beach','desert','heath','mud','grassland','wood','sand','scrub') then \"natural\" else null end)) as \"natural\",\n('power_' || (case when power in ('station','sub_station','substation','generator') then power else null end)) as power,\n('tourism_' || (case when tourism in ('attraction', 'camp_site', 'caravan_site', 'picnic_site', 'zoo') then tourism else null end)) as tourism,\n('highway_' || (case when highway in ('services', 'rest_area') then highway else null end)) as highway,\n('railway_' || (case when railway = 'station' then railway else null end)) as railway,\ncase when religion in ('christian','jewish') then religion else 'INT-generic'::text end as religion\n from planet_osm_polygon\n where landuse is not null\n or leisure is not null\n or aeroway in ('apron','aerodrome')\n or amenity in ('parking','university','college','school','hospital','kindergarten','grave_yard')\n or military in ('barracks','danger_area')\n or \"natural\" in ('field','beach','desert','heath','mud','grassland','wood','sand','scrub')\n or power in ('station','sub_station','generator')\n or tourism in ('attraction','camp_site','caravan_site','picnic_site','zoo')\n or highway in ('services','rest_area')\n or railway = 'station'\n order by z_order,way_area desc\n ) as landcover\n) as features", "extent": "-20037508,-19929239,20037508,19929239", "key_field": "", "geometry_field": "", @@ -721,18 +721,18 @@ ], "Datasource": { "type": "postgis", - "table": " (select way,building,railway,amenity from planet_osm_polygon\n where railway='station'\n or building in ('station','supermarket')\n or amenity='place_of_worship'\n order by z_order,way_area desc) as buildings_lz", + "table": "(SELECT way,building,amenity\n FROM planet_osm_polygon\n WHERE building IN ('station','supermarket')\n OR (building IS NOT NULL AND building != 'no' \n AND (\n amenity IN ('place_of_worship','supermarket')\n OR shop = 'mall'\n OR tourism = 'attraction'\n )\n )\n ORDER BY z_order,way_area DESC)\nAS buildings_major", "extent": "-20037508,-19929239,20037508,19929239", "key_field": "", "geometry_field": "way", "dbname": "gis" }, - "id": "buildings-lz", + "id": "buildings-major", "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": "buildings-lz" + "name": "buildings-major" }, { "geometry": "polygon", @@ -744,7 +744,7 @@ ], "Datasource": { "type": "postgis", - "table": " (select way,aeroway,\n case\n when building in ('garage','roof','garages','service','shed','shelter','cabin','storage_tank','tank','support','glasshouse','greenhouse','mobile_home','kiosk','silo','canopy','tent') then 'INT-light'::text\n else building\n end as building\n from planet_osm_polygon\n where (building is not null\n and building not in ('no','station','supermarket','planned')\n and (railway is null or railway != 'station')\n and (amenity is null or amenity != 'place_of_worship'))\n or aeroway = 'terminal'\n order by z_order,way_area desc) as buildings", + "table": "(SELECT way,name,building,amenity,aeroway,way_area\n FROM planet_osm_polygon\n WHERE (building IS NOT NULL OR aeroway = 'terminal')\n AND building != 'no'\n ORDER BY z_order,way_area DESC) AS buildings", "extent": "-20037508,-19929239,20037508,19929239", "key_field": "", "geometry_field": "way",